don't create a queue name in syserr; permit trailing blanks and quoted
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 25 Oct 1985 02:38:28 +0000 (18:38 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 25 Oct 1985 02:38:28 +0000 (18:38 -0800)
commas in aliases.

SCCS-vsn: usr.sbin/sendmail/src/err.c 5.6
SCCS-vsn: usr.sbin/sendmail/src/alias.c 5.6
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 5.3
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.31

usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/err.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/version.c

index 15b7f36..3835c48 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 # ifdef DBM
 
 #ifndef lint
 # ifdef DBM
-static char    SccsId[] = "@(#)alias.c 5.5 (Berkeley) %G%      (with DBM)";
+static char    SccsId[] = "@(#)alias.c 5.6 (Berkeley) %G%      (with DBM)";
 # else DBM
 # else DBM
-static char    SccsId[] = "@(#)alias.c 5.5 (Berkeley) %G%      (without DBM)";
+static char    SccsId[] = "@(#)alias.c 5.6 (Berkeley) %G%      (without DBM)";
 # endif DBM
 #endif not lint
 
 # endif DBM
 #endif not lint
 
@@ -355,10 +355,12 @@ readaliases(aliasfile, init)
                int lhssize, rhssize;
 
                LineNumber++;
                int lhssize, rhssize;
 
                LineNumber++;
+               p = index(line, '\n');
+               if (p != NULL)
+                       *p = '\0';
                switch (line[0])
                {
                  case '#':
                switch (line[0])
                {
                  case '#':
-                 case '\n':
                  case '\0':
                        skipping = FALSE;
                        continue;
                  case '\0':
                        skipping = FALSE;
                        continue;
@@ -455,25 +457,17 @@ readaliases(aliasfile, init)
                        if (init)
                        {
                                /* do parsing & compression of addresses */
                        if (init)
                        {
                                /* do parsing & compression of addresses */
-                               c = *p;
-                               while (c != '\0')
+                               while (*p != '\0')
                                {
                                {
-                                       p2 = p;
-                                       while (*p != '\n' && *p != ',' && *p != '\0')
-                                               p++;
-                                       c = *p;
-                                       if (c == '\n')
-                                               c = '\0';
-                                       *p = '\0';
-                                       if (*p2 != '\0' &&
-                                           parseaddr(p2, &bl, -1, ',') == NULL)
-                                       {
-                                               usrerr("%s... bad address");
-                                       }
-                                       if (c != '\0')
-                                               *p++ = c;
-                                       while (isspace(*p))
+                                       extern char *DelimChar;
+
+                                       while (isspace(*p) || *p == ',')
                                                p++;
                                                p++;
+                                       if (*p == '\0')
+                                               break;
+                                       if (parseaddr(p, &bl, -1, ',') == NULL)
+                                               usrerr("%s... bad address", p);
+                                       p = DelimChar;
                                }
                        }
                        else
                                }
                        }
                        else
index d6fd82b..12d3566 100644 (file)
@@ -9,7 +9,7 @@
 */
 
 #ifndef lint
 */
 
 #ifndef lint
-static char    SccsId[] = "@(#)err.c   5.5 (Berkeley) %G%";
+static char    SccsId[] = "@(#)err.c   5.6 (Berkeley) %G%";
 #endif not lint
 
 # include "sendmail.h"
 #endif not lint
 
 # include "sendmail.h"
@@ -66,11 +66,11 @@ syserr(fmt, a, b, c, d, e)
                        ExitStat = EX_OSERR;
        }
 
                        ExitStat = EX_OSERR;
        }
 
-       /* insure that we have a queue id for logging */
-       (void) queuename(CurEnv, '\0');
 # ifdef LOG
        if (LogLevel > 0)
 # ifdef LOG
        if (LogLevel > 0)
-               syslog(LOG_CRIT, "%s: SYSERR: %s", CurEnv->e_id, &MsgBuf[4]);
+               syslog(LOG_CRIT, "%s: SYSERR: %s",
+                       CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
+                       &MsgBuf[4]);
 # endif LOG
        errno = 0;
        if (QuickAbort)
 # endif LOG
        errno = 0;
        if (QuickAbort)
index 792e0ff..393cc23 100644 (file)
@@ -10,7 +10,7 @@
 */
 
 #ifndef lint
 */
 
 #ifndef lint
-static char    SccsId[] = "@(#)parseaddr.c     5.2 (Berkeley) %G%";
+static char    SccsId[] = "@(#)parseaddr.c     5.3 (Berkeley) %G%";
 #endif not lint
 
 # include "sendmail.h"
 #endif not lint
 
 # include "sendmail.h"
@@ -212,7 +212,7 @@ loweraddr(a)
 **             NULL on error.
 **
 **     Side Effects:
 **             NULL on error.
 **
 **     Side Effects:
-**             none.
+**             sets DelimChar to point to the character matching 'delim'.
 */
 
 /* states and character types */
 */
 
 /* states and character types */
index ae6c05c..b4b77d8 100644 (file)
@@ -9,7 +9,7 @@
 */
 
 #ifndef lint
 */
 
 #ifndef lint
-static char    SccsId[] = "@(#)version.c       5.30 (Berkeley) %G%";
+static char    SccsId[] = "@(#)version.c       5.31 (Berkeley) %G%";
 #endif not lint
 
 #endif not lint
 
-char   Version[] = "5.30";
+char   Version[] = "5.31";