Assorted changes from Guy Harris <rlgvax!guy>: mostly lint & USG
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 12 Aug 1984 08:52:58 +0000 (00:52 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 12 Aug 1984 08:52:58 +0000 (00:52 -0800)
SCCS-vsn: usr.sbin/sendmail/src/arpadate.c 4.4
SCCS-vsn: usr.sbin/sendmail/src/main.c 4.12
SCCS-vsn: usr.sbin/sendmail/src/collect.c 4.4
SCCS-vsn: usr.sbin/sendmail/src/util.c 4.8
SCCS-vsn: usr.sbin/sendmail/src/alias.c 4.5
SCCS-vsn: usr.sbin/sendmail/src/version.c 4.37
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 4.8

usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/arpadate.c
usr/src/usr.sbin/sendmail/src/collect.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/util.c
usr/src/usr.sbin/sendmail/src/version.c

index e2ce709..e7d34fe 100644 (file)
@@ -5,9 +5,9 @@
 # include "sendmail.h"
 
 # ifdef DBM
 # include "sendmail.h"
 
 # ifdef DBM
-SCCSID(@(#)alias.c     4.4.1.1         %G%     (with DBM));
+SCCSID(@(#)alias.c     4.5             %G%     (with DBM));
 # else DBM
 # else DBM
-SCCSID(@(#)alias.c     4.4.1.1         %G%     (without DBM));
+SCCSID(@(#)alias.c     4.5             %G%     (without DBM));
 # endif DBM
 
 /*
 # endif DBM
 
 /*
@@ -441,8 +441,9 @@ readaliases(aliasfile, init)
                        }
                        else
                        {
                        }
                        else
                        {
-                               p = &p[strlen(p) - 1];
-                               *p = '\0';
+                               p = &p[strlen(p)];
+                               if (p[-1] == '\n')
+                                       *--p = '\0';
                        }
 
                        /* see if there should be a continuation line */
                        }
 
                        /* see if there should be a continuation line */
@@ -453,7 +454,6 @@ readaliases(aliasfile, init)
                                break;
 
                        /* read continuation line */
                                break;
 
                        /* read continuation line */
-                       p--;
                        if (fgets(p, sizeof line - (p - line), af) == NULL)
                                break;
                        LineNumber++;
                        if (fgets(p, sizeof line - (p - line), af) == NULL)
                                break;
                        LineNumber++;
index b4964cb..e81bcd6 100644 (file)
@@ -1,13 +1,24 @@
 # include "conf.h"
 # include "conf.h"
+# ifdef USG
+# include <time.h>
+# else
 # include "conf.h"
 # include <sys/time.h>
 # ifndef V6
 # include <sys/types.h>
 # include <sys/timeb.h>
 # include "conf.h"
 # include <sys/time.h>
 # ifndef V6
 # include <sys/types.h>
 # include <sys/timeb.h>
-# endif
+# endif V6
+# endif USG
 # include "useful.h"
 
 # include "useful.h"
 
-SCCSID(@(#)arpadate.c  4.3             %G%);
+SCCSID(@(#)arpadate.c  4.4             %G%);
+
+# ifdef V6
+# define OLDTIME
+# endif V6
+# ifdef USG
+# define OLDTIME
+# endif USG
 
 /*
 **  ARPADATE -- Create date in ARPANET format
 
 /*
 **  ARPADATE -- Create date in ARPANET format
@@ -46,15 +57,20 @@ arpadate(ud)
        register int i;
        extern struct tm *localtime();
        extern bool fconvert();
        register int i;
        extern struct tm *localtime();
        extern bool fconvert();
-# ifdef V6
+# ifdef OLDTIME
        long t;
        long t;
-       extern char *StdTimezone, *DstTimezone;
        extern long time();
        extern long time();
-# else
+# else OLDTIME
        struct timeb t;
        extern struct timeb *ftime();
        extern char *timezone();
        struct timeb t;
        extern struct timeb *ftime();
        extern char *timezone();
-# endif
+# endif OLDTIME
+# ifdef V6
+       extern char *StdTimezone, *DstTimezone;
+# endif V6
+# ifdef USG
+       extern char *tzname[2];
+# endif USG
 
        /*
        **  Get current time.
 
        /*
        **  Get current time.
@@ -62,7 +78,7 @@ arpadate(ud)
        **      to resolve the timezone.
        */
 
        **      to resolve the timezone.
        */
 
-# ifdef V6
+# ifdef OLDTIME
        (void) time(&t);
        if (ud == NULL)
                ud = ctime(&t);
        (void) time(&t);
        if (ud == NULL)
                ud = ctime(&t);
@@ -70,7 +86,7 @@ arpadate(ud)
        ftime(&t);
        if (ud == NULL)
                ud = ctime(&t.time);
        ftime(&t);
        if (ud == NULL)
                ud = ctime(&t.time);
-# endif
+# endif OLDTIME
 
        /*
        **  Crack the UNIX date line in a singularly unoriginal way.
 
        /*
        **  Crack the UNIX date line in a singularly unoriginal way.
@@ -114,8 +130,15 @@ arpadate(ud)
                p = DstTimezone;
        else
                p = StdTimezone;
                p = DstTimezone;
        else
                p = StdTimezone;
+# else
+# ifdef USG
+       if (localtime(&t)->tm_isdst)
+               p = tzname[1];
+       else
+               p = tzname[0];
 # else
        p = timezone(t.timezone, localtime(&t.time)->tm_isdst);
 # else
        p = timezone(t.timezone, localtime(&t.time)->tm_isdst);
+# endif USG
 # endif V6
        if ((strncmp(p, "GMT", 3) == 0 || strncmp(p, "gmt", 3) == 0) &&
            p[3] != '\0')
 # endif V6
        if ((strncmp(p, "GMT", 3) == 0 || strncmp(p, "gmt", 3) == 0) &&
            p[3] != '\0')
@@ -170,12 +193,12 @@ struct foreign
 
 static struct foreign Foreign[] =
 {
 
 static struct foreign Foreign[] =
 {
-       { "eet",        " -0200" },     /* eastern europe */
-       { "met",        " -0100" },     /* middle europe */
-       { "wet",        " GMT"   },     /* western europe */
-       { "eet dst",    " -0300" },     /* daylight saving times */
-       { "met dst",    " -0200" },
-       { "wet dst",    " -0100" },
+       { "EET",        " -0200" },     /* eastern europe */
+       { "MET",        " -0100" },     /* middle europe */
+       { "WET",        " GMT"   },     /* western europe */
+       { "EET DST",    " -0300" },     /* daylight saving times */
+       { "MET DST",    " -0200" },
+       { "WET DST",    " -0100" },
        { NULL,         NULL     }
 };
 
        { NULL,         NULL     }
 };
 
@@ -187,10 +210,9 @@ fconvert(a, b)
        register struct foreign *euptr;
        register char *p;
 
        register struct foreign *euptr;
        register char *p;
 
-       makelower(a);
        for (euptr = Foreign; euptr->f_from != NULL; euptr++)
        {
        for (euptr = Foreign; euptr->f_from != NULL; euptr++)
        {
-               if (strcmp(euptr->f_from, a) == 0)
+               if (sameword(euptr->f_from, a))
                {
                        p = euptr->f_to;
                        while (*p)
                {
                        p = euptr->f_to;
                        while (*p)
index 733ff17..10e78bf 100644 (file)
@@ -1,7 +1,7 @@
 # include <errno.h>
 # include "sendmail.h"
 
 # include <errno.h>
 # include "sendmail.h"
 
-SCCSID(@(#)collect.c   4.3             %G%);
+SCCSID(@(#)collect.c   4.4             %G%);
 
 /*
 **  COLLECT -- read & parse message header & make temp file.
 
 /*
 **  COLLECT -- read & parse message header & make temp file.
@@ -281,9 +281,9 @@ eatfrom(fm)
        {
                /* skip a word */
                while (*p != '\0' && *p != ' ')
        {
                /* skip a word */
                while (*p != '\0' && *p != ' ')
-                       *p++;
+                       p++;
                while (*p == ' ')
                while (*p == ' ')
-                       *p++;
+                       p++;
                if (!isupper(*p) || p[3] != ' ' || p[13] != ':' || p[16] != ':')
                        continue;
 
                if (!isupper(*p) || p[3] != ' ' || p[13] != ':' || p[16] != ':')
                        continue;
 
index 371a37f..b295342 100644 (file)
@@ -2,9 +2,8 @@
 # include <signal.h>
 # include <sgtty.h>
 # include "sendmail.h"
 # include <signal.h>
 # include <sgtty.h>
 # include "sendmail.h"
-# include <sys/file.h>
 
 
-SCCSID(@(#)main.c      4.11            %G%);
+SCCSID(@(#)main.c      4.12            %G%);
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
@@ -199,6 +198,8 @@ main(argc, argv, envp)
                OpMode = MD_INITALIAS;
        else if (strcmp(p, "mailq") == 0)
                OpMode = MD_PRINT;
                OpMode = MD_INITALIAS;
        else if (strcmp(p, "mailq") == 0)
                OpMode = MD_PRINT;
+       else if (strcmp(p, "smtpd") == 0)
+               OpMode = MD_DAEMON;
        while ((p = *++av) != NULL && p[0] == '-')
        {
                switch (p[1])
        while ((p = *++av) != NULL && p[0] == '-')
        {
                switch (p[1])
@@ -804,8 +805,8 @@ freeze(freezefile)
 
        /* write out the freeze header */
        if (write(f, (char *) &fhdr, sizeof fhdr) != sizeof fhdr ||
 
        /* write out the freeze header */
        if (write(f, (char *) &fhdr, sizeof fhdr) != sizeof fhdr ||
-           write(f, (char *) &edata, fhdr.frzinfo.frzbrk - &edata) !=
-                                       (fhdr.frzinfo.frzbrk - &edata))
+           write(f, (char *) &edata, (int) (fhdr.frzinfo.frzbrk - &edata)) !=
+                                       (int) (fhdr.frzinfo.frzbrk - &edata))
        {
                syserr("Cannot freeze");
        }
        {
                syserr("Cannot freeze");
        }
@@ -863,8 +864,8 @@ thaw(freezefile)
        }
 
        /* now read in the freeze file */
        }
 
        /* now read in the freeze file */
-       if (read(f, (char *) &edata, fhdr.frzinfo.frzbrk - &edata) !=
-                                       (fhdr.frzinfo.frzbrk - &edata))
+       if (read(f, (char *) &edata, (int) (fhdr.frzinfo.frzbrk - &edata)) !=
+                                       (int) (fhdr.frzinfo.frzbrk - &edata))
        {
                /* oops!  we have trashed memory..... */
                write(2, "Cannot read freeze file\n", 24);
        {
                /* oops!  we have trashed memory..... */
                write(2, "Cannot read freeze file\n", 24);
index 49e7800..cb8a1a9 100644 (file)
@@ -1,6 +1,6 @@
 # include "sendmail.h"
 
 # include "sendmail.h"
 
-SCCSID(@(#)parseaddr.c 4.7             %G%);
+SCCSID(@(#)parseaddr.c 4.8             %G%);
 
 /*
 **  PARSEADDR -- Parse an address
 
 /*
 **  PARSEADDR -- Parse an address
index 4003a0b..5cfdbe7 100644 (file)
@@ -8,7 +8,7 @@
 # include "sendmail.h"
 # include "conf.h"
 
 # include "sendmail.h"
 # include "conf.h"
 
-SCCSID(@(#)util.c      4.7             %G%);
+SCCSID(@(#)util.c      4.8             %G%);
 
 /*
 **  STRIPQUOTES -- Strip quotes & quote bits from a string.
 
 /*
 **  STRIPQUOTES -- Strip quotes & quote bits from a string.
@@ -175,8 +175,8 @@ copyplist(list, copycont)
 
        vp++;
 
 
        vp++;
 
-       newvp = (char **) xalloc((vp - list) * sizeof *vp);
-       bcopy((char *) list, (char *) newvp, (vp - list) * sizeof *vp);
+       newvp = (char **) xalloc((int) (vp - list) * sizeof *vp);
+       bcopy((char *) list, (char *) newvp, (int) (vp - list) * sizeof *vp);
 
        if (copycont)
        {
 
        if (copycont)
        {
index ad418c5..df0d53f 100644 (file)
@@ -1,5 +1,5 @@
 # ifndef lint
 # ifndef lint
-static char    SccsId[] = "@(#)SendMail version 4.36 of %G%";
+static char    SccsId[] = "@(#)SendMail version 4.37 of %G%";
 # endif lint
 
 # endif lint
 
-char   Version[] = "4.36";
+char   Version[] = "4.37";