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/sendmail Pull up revisions 1.6-1.8 (r...



details:   https://anonhg.NetBSD.org/src/rev/75ba99b4cd18
branches:  netbsd-1-5
changeset: 490796:75ba99b4cd18
user:      he <he%NetBSD.org@localhost>
date:      Fri Mar 09 17:50:23 2001 +0000

description:
Pull up revisions 1.6-1.8 (requested by itojun):
  Upgrade to sendmail 8.11.3.

diffstat:

 gnu/dist/sendmail/sendmail/readcf.c |  118 ++++++++++++++++++++++++++++-------
 1 files changed, 92 insertions(+), 26 deletions(-)

diffs (truncated from 416 to 300 lines):

diff -r c55103cb2280 -r 75ba99b4cd18 gnu/dist/sendmail/sendmail/readcf.c
--- a/gnu/dist/sendmail/sendmail/readcf.c       Fri Mar 09 17:50:20 2001 +0000
+++ b/gnu/dist/sendmail/sendmail/readcf.c       Fri Mar 09 17:50:23 2001 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
  *     All rights reserved.
  * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
  * Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: readcf.c,v 8.382.4.14 2000/07/12 00:00:27 geir Exp";
+static char id[] = "@(#)Id: readcf.c,v 8.382.4.38 2001/02/17 00:05:12 geir Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -356,6 +356,8 @@
 
                  case 'D':             /* macro definition */
                        mid = macid(&bp[1], &ep);
+                       if (mid == 0)
+                               break;
                        p = munchstring(ep, NULL, '\0');
                        define(mid, newstr(p), e);
                        break;
@@ -369,6 +371,8 @@
                        if (bp[0] == 'C')
                        {
                                mid = macid(&bp[1], &ep);
+                               if (mid == 0)
+                                       break;
                                expand(ep, exbuf, sizeof exbuf, e);
                                p = exbuf;
                        }
@@ -397,6 +401,8 @@
 
                  case 'F':             /* word class from file */
                        mid = macid(&bp[1], &ep);
+                       if (mid == 0)
+                               break;
                        for (p = ep; isascii(*p) && isspace(*p); )
                                p++;
                        if (p[0] == '-' && p[1] == 'o')
@@ -838,6 +844,8 @@
 **                        T -- the mailer type (for DSNs)
 **                        U -- the uid to run as
 **                        W -- the time to wait at the end
+**                        m -- maximum messages per connection
+**                        / -- new root directory
 **                     The first word is the canonical name of the mailer.
 **
 **     Returns:
@@ -869,7 +877,10 @@
        if (*p != '\0')
                *p++ = '\0';
        if (line[0] == '\0')
+       {
                syserr("name required for mailer");
+               return;
+       }
        m->m_name = newstr(line);
 
        /* now scan through and assign info from the fields */
@@ -901,13 +912,14 @@
                  case 'P':             /* pathname */
                        if (*p == '\0')
                                syserr("mailer %s: empty path name", m->m_name);
-                       m->m_mailer = newstr(p);
+                       else
+                               m->m_mailer = newstr(p);
                        break;
 
                  case 'F':             /* flags */
                        for (; *p != '\0'; p++)
                                if (!(isascii(*p) && isspace(*p)))
-                                       setbitn(*p, m->m_flags);
+                                       setbitn(bitidx(*p), m->m_flags);
                        break;
 
                  case 'S':             /* sender rewriting ruleset */
@@ -937,14 +949,16 @@
                        if (*p == '\0')
                                syserr("mailer %s: null end-of-line string",
                                        m->m_name);
-                       m->m_eol = newstr(p);
+                       else
+                               m->m_eol = newstr(p);
                        break;
 
                  case 'A':             /* argument vector */
                        if (*p == '\0')
                                syserr("mailer %s: null argument vector",
                                        m->m_name);
-                       m->m_argv = makeargv(p);
+                       else
+                               m->m_argv = makeargv(p);
                        break;
 
                  case 'M':             /* maximum message size */
@@ -975,13 +989,15 @@
                        if (*p == '\0')
                                syserr("mailer %s: null working directory",
                                        m->m_name);
-                       m->m_execdir = newstr(p);
+                       else
+                               m->m_execdir = newstr(p);
                        break;
 
                  case 'C':             /* default charset */
                        if (*p == '\0')
                                syserr("mailer %s: null charset", m->m_name);
-                       m->m_defcharset = newstr(p);
+                       else
+                               m->m_defcharset = newstr(p);
                        break;
 
                  case 'T':             /* MTA-Name/Address/Diagnostic types */
@@ -1030,11 +1046,17 @@
                                if (*p != '\0')
                                        *p++ = '\0';
                                if (*q == '\0')
+                               {
                                        syserr("mailer %s: null user name",
                                                m->m_name);
+                                       break;
+                               }
                                pw = sm_getpwnam(q);
                                if (pw == NULL)
+                               {
                                        syserr("readcf: mailer U= flag: unknown user %s", q);
+                                       break;
+                               }
                                else
                                {
                                        m->m_uid = pw->pw_uid;
@@ -1065,11 +1087,17 @@
                                        p++;
                                *p++ = '\0';
                                if (*q == '\0')
+                               {
                                        syserr("mailer %s: null group name",
                                                m->m_name);
+                                       break;
+                               }
                                gr = getgrnam(q);
                                if (gr == NULL)
+                               {
                                        syserr("readcf: mailer U= flag: unknown group %s", q);
+                                       break;
+                               }
                                else
                                        m->m_gid = gr->gr_gid;
                        }
@@ -1134,18 +1162,19 @@
 
        if (strcmp(m->m_mailer, "[TCP]") == 0)
        {
-#if _FFR_REMOVE_TCP_PATH
+#if _FFR_REMOVE_TCP_MAILER_PATH
                syserr("M%s: P=[TCP] is deprecated, use P=[IPC] instead\n",
                       m->m_name);
-#else /* _FFR_REMOVE_TCP_PATH */
+               return;
+#else /* _FFR_REMOVE_TCP_MAILER_PATH */
                printf("M%s: Warning: P=[TCP] is deprecated, use P=[IPC] instead\n",
                       m->m_name);
-#endif /* _FFR_REMOVE_TCP_PATH */
+#endif /* _FFR_REMOVE_TCP_MAILER_PATH */
        }
 
-       if (strcmp(m->m_mailer, "[IPC]") == 0 ||
+       if (strcmp(m->m_mailer, "[IPC]") == 0
 #if !_FFR_REMOVE_TCP_MAILER_PATH
-           strcmp(m->m_mailer, "[TCP]") == 0
+           || strcmp(m->m_mailer, "[TCP]") == 0
 #endif /* !_FFR_REMOVE_TCP_MAILER_PATH */
            )
        {
@@ -1155,13 +1184,14 @@
                {
                        syserr("M%s: too few parameters for %s mailer",
                               m->m_name, m->m_mailer);
+                       return;
                }
-               if (strcmp(m->m_argv[0], "TCP") != 0 &&
+               if (strcmp(m->m_argv[0], "TCP") != 0
 #if NETUNIX
-                   strcmp(m->m_argv[0], "FILE") != 0 &&
+                   && strcmp(m->m_argv[0], "FILE") != 0
 #endif /* NETUNIX */
 #if !_FFR_DEPRECATE_IPC_MAILER_ARG
-                   strcmp(m->m_argv[0], "IPC") != 0
+                   && strcmp(m->m_argv[0], "IPC") != 0
 #endif /* !_FFR_DEPRECATE_IPC_MAILER_ARG */
                    )
                {
@@ -1186,11 +1216,13 @@
                               m->m_name,
                               (m->m_argv[0] == NULL ||
                                m->m_argv[1] == NULL) ? "few" : "many");
+                       return;
                }
                else if (strcmp(m->m_argv[0], "FILE") != 0)
                {
                        syserr("M%s: first argument in [FILE] mailer must be FILE",
                               m->m_name);
+                       return;
                }
        }
 
@@ -1956,6 +1988,7 @@
                  case SM_DEFER:        /* queue only and defer map lookups */
 #if !QUEUE
                        syserr("need QUEUE to set -odqueue or -oddefer");
+                       break;
 #endif /* !QUEUE */
                        /* FALLTHROUGH */
 
@@ -2028,7 +2061,9 @@
                if (val[0] == '\0')
                        HelpFile = "helpfile";
                else
+               {
                        HelpFile = newstr(val);
+               }
                break;
 
          case 'h':             /* maximum hop count */
@@ -2063,6 +2098,13 @@
                                HasWildcardMX = !clearmode;
                                continue;
                        }
+#if _FFR_WORKAROUND_BROKEN_NAMESERVERS
+                       if (sm_strcasecmp(q, "WorkAroundBrokenAAAA") == 0)
+                       {
+                               WorkAroundBrokenAAAA = !clearmode;
+                               continue;
+                       }
+#endif /* _FFR_WORKAROUND_BROKEN_NAMESERVERS */
                        for (rfp = ResolverFlags; rfp->rf_name != NULL; rfp++)
                        {
                                if (strcasecmp(q, rfp->rf_name) == 0)
@@ -2115,12 +2157,14 @@
                break;
 
          case 'M':             /* define macro */
+               sticky = FALSE;
                mid = macid(val, &ep);
+               if (mid == 0)
+                       break;
                p = newstr(ep);
                if (!safe)
                        cleanstrcpy(p, p, MAXNAME);
                define(mid, p, CurEnv);
-               sticky = FALSE;
                break;
 
          case 'm':             /* send to me too */
@@ -2136,9 +2180,7 @@
          case 'O':             /* daemon options */
 #if DAEMON
                if (!setdaemonoptions(val))
-               {
                        syserr("too many daemons defined (%d max)", MAXDAEMONS);
-               }
 #else /* DAEMON */
                syserr("DaemonPortOptions (O option) set but DAEMON not compiled in");
 #endif /* DAEMON */
@@ -2175,7 +2217,8 @@
                        }
                        if (pv->pv_name == NULL)
                                syserr("readcf: Op line: %s unrecognized", val);
-                       PrivacyFlags |= pv->pv_flag;
+                       else
+                               PrivacyFlags |= pv->pv_flag;
                }
                sticky = FALSE;
                break;
@@ -2190,9 +2233,13 @@
 
          case 'Q':             /* queue directory */
                if (val[0] == '\0')
+               {
                        QueueDir = "mqueue";
+               }
                else
+               {
                        QueueDir = newstr(val);
+               }
                if (RealUid != 0 && !safe)
                        Warn_Q_option = TRUE;
                break;
@@ -2212,7 +2259,9 @@
                if (val[0] == '\0')
                        StatFile = "statistics";
                else
+               {



Home | Main Index | Thread Index | Old Index