change random constants to be #defines
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 21 Dec 1992 03:14:30 +0000 (19:14 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 21 Dec 1992 03:14:30 +0000 (19:14 -0800)
SCCS-vsn: usr.sbin/sendmail/src/headers.c 5.30
SCCS-vsn: usr.sbin/sendmail/src/conf.h 5.33
SCCS-vsn: usr.sbin/sendmail/src/domain.c 5.39
SCCS-vsn: usr.sbin/sendmail/src/err.c 5.17
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 5.40
SCCS-vsn: usr.sbin/sendmail/src/util.c 5.35
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 5.67
SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.49
SCCS-vsn: usr.sbin/sendmail/src/alias.c 5.43
SCCS-vsn: usr.sbin/sendmail/src/udb.c 5.21

usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/conf.h
usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/domain.c
usr/src/usr.sbin/sendmail/src/err.c
usr/src/usr.sbin/sendmail/src/headers.c
usr/src/usr.sbin/sendmail/src/srvrsmtp.c
usr/src/usr.sbin/sendmail/src/udb.c
usr/src/usr.sbin/sendmail/src/util.c

index 72a774a..37de29f 100644 (file)
@@ -30,12 +30,12 @@ ERROR: DBM is no longer supported -- use NDBM instead.
 
 #ifndef lint
 #ifdef NEWDB
 
 #ifndef lint
 #ifdef NEWDB
-static char sccsid[] = "@(#)alias.c    5.42 (Berkeley) %G% (with NEWDB)";
+static char sccsid[] = "@(#)alias.c    5.43 (Berkeley) %G% (with NEWDB)";
 #else
 #ifdef NDBM
 #else
 #ifdef NDBM
-static char sccsid[] = "@(#)alias.c    5.42 (Berkeley) %G% (with NDBM)";
+static char sccsid[] = "@(#)alias.c    5.43 (Berkeley) %G% (with NDBM)";
 #else
 #else
-static char sccsid[] = "@(#)alias.c    5.42 (Berkeley) %G% (without NDBM)";
+static char sccsid[] = "@(#)alias.c    5.43 (Berkeley) %G% (without NDBM)";
 #endif
 #endif
 #endif /* not lint */
 #endif
 #endif
 #endif /* not lint */
@@ -789,7 +789,7 @@ forward(user, sendq, e)
 
        for (pp = ForwardPath; pp != NULL; pp = ep)
        {
 
        for (pp = ForwardPath; pp != NULL; pp = ep)
        {
-               char buf[256];
+               char buf[MAXPATHLEN+1];
 
                ep = strchr(pp, ':');
                if (ep != NULL)
 
                ep = strchr(pp, ':');
                if (ep != NULL)
index 5c4dae1..b8672fe 100644 (file)
@@ -7,11 +7,10 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     5.48 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     5.49 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/ioctl.h>
 #endif /* not lint */
 
 # include <sys/ioctl.h>
-# include <sys/param.h>
 # include <pwd.h>
 # include "sendmail.h"
 # include "pathnames.h"
 # include <pwd.h>
 # include "sendmail.h"
 # include "pathnames.h"
index bfd029e..8e1d1da 100644 (file)
@@ -5,13 +5,15 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      5.32 (Berkeley) %G%
+ *     @(#)conf.h      5.33 (Berkeley) %G%
  */
 
 /*
 **  CONF.H -- All user-configurable parameters for sendmail
 */
 
  */
 
 /*
 **  CONF.H -- All user-configurable parameters for sendmail
 */
 
+# include <sys/param.h>
+
 /*
 **  Table sizes, etc....
 **     There shouldn't be much need to change these....
 /*
 **  Table sizes, etc....
 **     There shouldn't be much need to change these....
@@ -28,6 +30,8 @@
 # define MAXUSERENVIRON        40              /* max # of items in user environ */
 # define MAXMXHOSTS    20              /* max # of MX records */
 # define SMTPLINELIM   990             /* maximum SMTP line length */
 # define MAXUSERENVIRON        40              /* max # of items in user environ */
 # define MAXMXHOSTS    20              /* max # of MX records */
 # define SMTPLINELIM   990             /* maximum SMTP line length */
+# define MAXKEY                128             /* maximum size of a database key */
+# define MEMCHUNKSIZE  1024            /* chunk size for memory allocation */
 
 # ifndef QUEUESIZE
 # define QUEUESIZE     1000            /* max # of jobs per queue run */
 
 # ifndef QUEUESIZE
 # define QUEUESIZE     1000            /* max # of jobs per queue run */
index 019d94c..d97fb93 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  5.66 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  5.67 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -17,7 +17,6 @@ static char sccsid[] = "@(#)deliver.c 5.66 (Berkeley) %G%";
 #include <fcntl.h>
 #include <errno.h>
 #ifdef NAMED_BIND
 #include <fcntl.h>
 #include <errno.h>
 #ifdef NAMED_BIND
-#include <sys/param.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
 #endif
 #include <arpa/nameser.h>
 #include <resolv.h>
 #endif
index 0d7b97c..07066f4 100644 (file)
 
 #ifndef lint
 #ifdef NAMED_BIND
 
 #ifndef lint
 #ifdef NAMED_BIND
-static char sccsid[] = "@(#)domain.c   5.38 (Berkeley) %G% (with name server)";
+static char sccsid[] = "@(#)domain.c   5.39 (Berkeley) %G% (with name server)";
 #else
 #else
-static char sccsid[] = "@(#)domain.c   5.38 (Berkeley) %G% (without name server)";
+static char sccsid[] = "@(#)domain.c   5.39 (Berkeley) %G% (without name server)";
 #endif
 #endif /* not lint */
 
 #ifdef NAMED_BIND
 
 #endif
 #endif /* not lint */
 
 #ifdef NAMED_BIND
 
-#include <sys/param.h>
 #include <errno.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
 #include <errno.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
index edec937..0faa239 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      5.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      5.17 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -337,7 +337,7 @@ errstring(errno)
 {
        extern char *sys_errlist[];
        extern int sys_nerr;
 {
        extern char *sys_errlist[];
        extern int sys_nerr;
-       static char buf[100];
+       static char buf[MAXLINE];
 # ifdef SMTP
        extern char *SmtpPhase;
 # endif /* SMTP */
 # ifdef SMTP
        extern char *SmtpPhase;
 # endif /* SMTP */
index 3312836..a496018 100644 (file)
@@ -7,10 +7,9 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)headers.c  5.29 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c  5.30 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-# include <sys/param.h>
 # include <errno.h>
 # include "sendmail.h"
 
 # include <errno.h>
 # include "sendmail.h"
 
@@ -379,7 +378,7 @@ eatheader(e)
 # ifdef LOG
        if (!QueueRun && LogLevel > 1)
        {
 # ifdef LOG
        if (!QueueRun && LogLevel > 1)
        {
-               char hbuf[100];
+               char hbuf[MAXNAME];
                char *name = hbuf;
                extern char *inet_ntoa();
 
                char *name = hbuf;
                extern char *inet_ntoa();
 
index 46c63b0..7324417 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 5.39 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 5.40 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 5.39 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 5.40 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -163,8 +163,8 @@ smtp(e)
                /* break off command */
                for (p = inp; isspace(*p); p++)
                        continue;
                /* break off command */
                for (p = inp; isspace(*p); p++)
                        continue;
-               cmd = p;
-               for (cmd = cmdbuf; *p != '\0' && !isspace(*p); )
+               cmd = cmdbuf;
+               while (*p != '\0' && !isspace(*p) && cmd < &cmdbuf[sizeof cmdbuf - 2])
                        *cmd++ = *p++;
                *cmd = '\0';
 
                        *cmd++ = *p++;
                *cmd = '\0';
 
index e561a3b..1522a3c 100644 (file)
@@ -8,9 +8,9 @@
 
 #ifndef lint
 #ifdef USERDB
 
 #ifndef lint
 #ifdef USERDB
-static char sccsid [] = "@(#)udb.c     5.20 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c     5.21 (Berkeley) %G% (with USERDB)";
 #else
 #else
-static char sccsid [] = "@(#)udb.c     5.20 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c     5.21 (Berkeley) %G% (without USERDB)";
 #endif
 #endif
 
 #endif
 #endif
 
@@ -116,8 +116,8 @@ udbexpand(a, sendq, e)
        bool breakout;
        register struct udbent *up;
        int keylen;
        bool breakout;
        register struct udbent *up;
        int keylen;
-       char keybuf[128];
-       char buf[8192];
+       char keybuf[MAXKEY];
+       char buf[BUFSIZ];
 
        if (tTd(28, 1))
                printf("expand(%s)\n", a->q_paddr);
 
        if (tTd(28, 1))
                printf("expand(%s)\n", a->q_paddr);
@@ -265,7 +265,7 @@ udbsender(sender)
        int i;
        int keylen;
        DBT key, info;
        int i;
        int keylen;
        DBT key, info;
-       char keybuf[128];
+       char keybuf[MAXKEY];
 
        if (tTd(28, 1))
                printf("udbsender(%s)\n", sender);
 
        if (tTd(28, 1))
                printf("udbsender(%s)\n", sender);
@@ -407,7 +407,7 @@ _udbx_init()
        register char *p;
        int i;
        register struct udbent *up;
        register char *p;
        int i;
        register struct udbent *up;
-       char buf[8192];
+       char buf[BUFSIZ];
 
        if (UdbInitialized)
                return EX_OK;
 
        if (UdbInitialized)
                return EX_OK;
index d3a478c..595eb8e 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)util.c     5.34 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c     5.35 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <stdio.h>
 #endif /* not lint */
 
 # include <stdio.h>
@@ -702,10 +702,10 @@ fgetfolded(buf, n, f)
                        int nn;
 
                        nn = (p - bp);
                        int nn;
 
                        nn = (p - bp);
-                       if (nn < 1024)
+                       if (nn < MEMCHUNKSIZE)
                                nn *= 2;
                        else
                                nn *= 2;
                        else
-                               nn += 1024;
+                               nn += MEMCHUNKSIZE;
                        nbp = xalloc(nn);
                        bcopy(bp, nbp, p - bp);
                        p = &nbp[p - bp];
                        nbp = xalloc(nn);
                        bcopy(bp, nbp, p - bp);
                        p = &nbp[p - bp];