Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/gnu/dist/sendmail Pull up revision 1.7 (requested by it...



details:   https://anonhg.NetBSD.org/src/rev/cfe8f003881b
branches:  netbsd-1-5
changeset: 492794:cfe8f003881b
user:      he <he%NetBSD.org@localhost>
date:      Wed Feb 20 23:12:29 2002 +0000

description:
Pull up revision 1.7 (requested by itojun):
  Upgrade to sendmail version 8.11.6.

diffstat:

 gnu/dist/sendmail/libmilter/listener.c    |   26 ++++-
 gnu/dist/sendmail/mail.local/mail.local.c |    2 +-
 gnu/dist/sendmail/rmail/rmail.c           |    4 +-
 gnu/dist/sendmail/sendmail/control.c      |   53 ++++++----
 gnu/dist/sendmail/sendmail/headers.c      |    4 +-
 gnu/dist/sendmail/sendmail/recipient.c    |   15 ++-
 gnu/dist/sendmail/sendmail/savemail.c     |    6 +-
 gnu/dist/sendmail/vacation/vacation.c     |  141 ++++++++++++++++++++---------
 8 files changed, 164 insertions(+), 87 deletions(-)

diffs (truncated from 626 to 300 lines):

diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/libmilter/listener.c
--- a/gnu/dist/sendmail/libmilter/listener.c    Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/libmilter/listener.c    Wed Feb 20 23:12:29 2002 +0000
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: listener.c,v 8.38.2.1.2.21 2001/02/14 02:20:40 gshapiro Exp";
+static char id[] = "@(#)Id: listener.c,v 8.38.2.1.2.22 2001/05/16 17:15:58 ca Exp";
 #endif /* ! lint */
 
 #if _FFR_MILTER
@@ -515,6 +515,8 @@
        int ret = MI_SUCCESS;
        int mcnt = 0;
        int tcnt = 0;
+       int acnt = 0;
+       int save_errno = 0;
        sthread_t thread_id;
        _SOCK_ADDR cliaddr;
        SOCKADDR_LEN_T socksize;
@@ -574,10 +576,9 @@
                }
                if (r < 0)
                {
-                       int err = errno;
-
+                       save_errno = errno;
                        (void) smutex_unlock(&L_Mutex);
-                       if (err == EINTR)
+                       if (save_errno == EINTR)
                                continue;
                        ret = MI_FAILURE;
                        break;
@@ -593,6 +594,7 @@
                memset(&cliaddr, '\0', sizeof cliaddr);
                connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
                                &clilen);
+               save_errno = errno;
                (void) smutex_unlock(&L_Mutex);
 
                /*
@@ -610,14 +612,23 @@
                {
                        (void) close(connfd);
                        connfd = INVALID_SOCKET;
-                       errno = EINVAL;
+                       save_errno = EINVAL;
                }
 
                if (!ValidSocket(connfd))
                {
                        smi_log(SMI_LOG_ERR,
-                               "%s: accept() returned invalid socket",
-                               smfi->xxfi_name);
+                               "%s: accept() returned invalid socket (%s)",
+                               smfi->xxfi_name, strerror(save_errno));
+                       if (save_errno == EINTR)
+                               continue;
+                       acnt++;
+                       MI_SLEEP(acnt);
+                       if (acnt >= MAX_FAILS_A)
+                       {
+                               ret = MI_FAILURE;
+                               break;
+                       }
                        continue;
                }
 
@@ -643,6 +654,7 @@
                        continue;
                }
                mcnt = 0;
+               acnt = 0;
                memset(ctx, '\0', sizeof *ctx);
                ctx->ctx_sd = connfd;
                ctx->ctx_dbg = dbg;
diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/mail.local/mail.local.c
--- a/gnu/dist/sendmail/mail.local/mail.local.c Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/mail.local/mail.local.c Wed Feb 20 23:12:29 2002 +0000
@@ -19,7 +19,7 @@
 #endif /* ! lint */
 
 #ifndef lint
-static char id[] = "@(#)Id: mail.local.c,v 8.143.4.57 2001/02/11 20:08:20 gshapiro Exp";
+static char id[] = "@(#)Id: mail.local.c,v 8.143.4.58 2001/06/01 05:33:31 gshapiro Exp";
 #endif /* ! lint */
 
 /*
diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/rmail/rmail.c
--- a/gnu/dist/sendmail/rmail/rmail.c   Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/rmail/rmail.c   Wed Feb 20 23:12:29 2002 +0000
@@ -12,14 +12,14 @@
 
 #ifndef lint
 static char copyright[] =
-"@(#) Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.\n\
+"@(#) Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.\n\
        All rights reserved.\n\
      Copyright (c) 1988, 1993\n\
        The Regents of the University of California.  All rights reserved.\n";
 #endif /* ! lint */
 
 #ifndef lint
-static char id[] = "@(#)Id: rmail.c,v 8.39.4.11 2001/02/14 04:07:25 gshapiro Exp";
+static char id[] = "@(#)Id: rmail.c,v 8.39.4.12 2001/05/07 22:06:39 gshapiro Exp";
 #endif /* ! lint */
 
 /*
diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/sendmail/control.c
--- a/gnu/dist/sendmail/sendmail/control.c      Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/sendmail/control.c      Wed Feb 20 23:12:29 2002 +0000
@@ -9,11 +9,33 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: control.c,v 8.44.14.15 2001/01/22 19:00:22 gshapiro Exp";
+static char id[] = "@(#)Id: control.c,v 8.44.14.20 2001/05/03 17:24:03 gshapiro Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
 
+/* values for cmd_code */
+# define CMDERROR      0       /* bad command */
+# define CMDRESTART    1       /* restart daemon */
+# define CMDSHUTDOWN   2       /* end daemon */
+# define CMDHELP       3       /* help */
+# define CMDSTATUS     4       /* daemon status */
+
+struct cmd
+{
+       char    *cmd_name;      /* command name */
+       int     cmd_code;       /* internal code, see below */
+};
+
+static struct cmd      CmdTab[] =
+{
+       { "help",       CMDHELP         },
+       { "restart",    CMDRESTART      },
+       { "shutdown",   CMDSHUTDOWN     },
+       { "status",     CMDSTATUS       },
+       { NULL,         CMDERROR        }
+};
+
 
 int ControlSocket = -1;
 
@@ -208,34 +230,19 @@
 **             none.
 */
 
-struct cmd
-{
-       char    *cmd_name;      /* command name */
-       int     cmd_code;       /* internal code, see below */
-};
-
-/* values for cmd_code */
-# define CMDERROR      0       /* bad command */
-# define CMDRESTART    1       /* restart daemon */
-# define CMDSHUTDOWN   2       /* end daemon */
-# define CMDHELP       3       /* help */
-# define CMDSTATUS     4       /* daemon status */
-
-static struct cmd      CmdTab[] =
-{
-       { "help",       CMDHELP         },
-       { "restart",    CMDRESTART      },
-       { "shutdown",   CMDSHUTDOWN     },
-       { "status",     CMDSTATUS       },
-       { NULL,         CMDERROR        }
-};
-
 static jmp_buf CtxControlTimeout;
 
 static void
 controltimeout(timeout)
        time_t timeout;
 {
+       /*
+       **  NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER.  DO NOT ADD
+       **      ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE
+       **      DOING.
+       */
+
+       errno = ETIMEDOUT;
        longjmp(CtxControlTimeout, 1);
 }
 
diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/sendmail/headers.c
--- a/gnu/dist/sendmail/sendmail/headers.c      Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/sendmail/headers.c      Wed Feb 20 23:12:29 2002 +0000
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: headers.c,v 8.203.4.12 2001/01/22 19:00:22 gshapiro Exp";
+static char id[] = "@(#)Id: headers.c,v 8.203.4.13 2001/05/03 17:24:06 gshapiro Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -341,7 +341,7 @@
                        }
                        if ((sp = macvalue(macid("{currHeader}", NULL), e)) !=
                            NULL)
-                               free(sp);
+                               sm_free(sp);
                        define(macid("{currHeader}", NULL), newstr(qval), e);
                        define(macid("{hdr_name}", NULL), newstr(fname), e);
                        (void) rscheck(rs, fvalue, NULL, e, stripcom, TRUE, 4,
diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/sendmail/recipient.c
--- a/gnu/dist/sendmail/sendmail/recipient.c    Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/sendmail/recipient.c    Wed Feb 20 23:12:29 2002 +0000
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: recipient.c,v 8.231.14.10 2001/02/14 04:07:30 gshapiro Exp";
+static char id[] = "@(#)Id: recipient.c,v 8.231.14.11 2001/05/03 17:24:14 gshapiro Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -185,7 +185,7 @@
 
        e->e_to = oldto;
        if (bufp != buf)
-               free(bufp);
+               sm_free(bufp);
 #if _FFR_ADDR_TYPE
        define(macid("{addr_type}", NULL), NULL, e);
 #endif /* _FFR_ADDR_TYPE */
@@ -293,7 +293,7 @@
 
        e->e_to = oldto;
        if (bufp != buf)
-               free(bufp);
+               sm_free(bufp);
 #if _FFR_ADDR_TYPE
        define(macid("{addr_type}", NULL), NULL, e);
 #endif /* _FFR_ADDR_TYPE */
@@ -780,7 +780,7 @@
   done:
        a->q_flags |= QTHISPASS;
        if (buf != buf0)
-               free(buf);
+               sm_free(buf);
 
        /*
        **  If we are at the top level, check to see if this has
@@ -1573,6 +1573,13 @@
 static void
 includetimeout()
 {
+       /*
+       **  NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER.  DO NOT ADD
+       **      ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE
+       **      DOING.
+       */
+
+       errno = ETIMEDOUT;
        longjmp(CtxIncludeTimeout, 1);
 }
 /*
diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/sendmail/savemail.c
--- a/gnu/dist/sendmail/sendmail/savemail.c     Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/sendmail/savemail.c     Wed Feb 20 23:12:29 2002 +0000
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: savemail.c,v 8.212.4.12 2001/01/07 19:31:05 gshapiro Exp";
+static char id[] = "@(#)Id: savemail.c,v 8.212.4.13 2001/05/03 17:24:15 gshapiro Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -1413,7 +1413,7 @@
        if (l > bplen)
        {
                if (bp != NULL)
-                       free(bp);
+                       sm_free(bp);
                bp = xalloc(l);
                bplen = l;
        }
@@ -1466,7 +1466,7 @@
        if (l > bplen)
        {
                if (bp != NULL)
-                       free(bp);
+                       sm_free(bp);
                bp = xalloc(l);
                bplen = l;
        }
diff -r 449c491294dc -r cfe8f003881b gnu/dist/sendmail/vacation/vacation.c
--- a/gnu/dist/sendmail/vacation/vacation.c     Wed Feb 20 23:12:25 2002 +0000
+++ b/gnu/dist/sendmail/vacation/vacation.c     Wed Feb 20 23:12:29 2002 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.



Home | Main Index | Thread Index | Old Index