environment handling simplification/bug fix; handle commas inside
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 14 Jan 1993 10:38:20 +0000 (02:38 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 14 Jan 1993 10:38:20 +0000 (02:38 -0800)
comments; properly limit large messages in -obq mode

SCCS-vsn: usr.sbin/sendmail/src/main.c 6.6
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 6.6
SCCS-vsn: usr.sbin/sendmail/src/version.c 6.9
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 6.8
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.3

usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/queue.c
usr/src/usr.sbin/sendmail/src/version.c

index 8d07e26..43c42f7 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  6.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  6.8 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -868,6 +868,7 @@ openmailer(m, pvp, ctladdr, clever, e)
                {
                        int i;
                        int saveerrno;
                {
                        int i;
                        int saveerrno;
+                       char *env[2];
                        extern int DtableSize;
 
                        /* child -- set up input & exec mailer */
                        extern int DtableSize;
 
                        /* child -- set up input & exec mailer */
@@ -929,7 +930,9 @@ openmailer(m, pvp, ctladdr, clever, e)
                        }
 
                        /* try to execute the mailer */
                        }
 
                        /* try to execute the mailer */
-                       execve(m->m_mailer, pvp, UserEnviron);
+                       env[0] = "AGENT=sendmail";
+                       env[1] = NULL;
+                       execve(m->m_mailer, pvp, env);
                        saveerrno = errno;
                        syserr("Cannot exec %s", m->m_mailer);
                        if (m == LocalMailer)
                        saveerrno = errno;
                        syserr("Cannot exec %s", m->m_mailer);
                        if (m == LocalMailer)
index 3d113ea..4b2dad8 100644 (file)
@@ -13,7 +13,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     6.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     6.6 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -137,7 +137,6 @@ main(argc, argv, envp)
        extern void intsig();
        extern char **myhostname();
        extern char *arpadate();
        extern void intsig();
        extern char **myhostname();
        extern char *arpadate();
-       extern char **environ;
        extern char *optarg;
 
        /*
        extern char *optarg;
 
        /*
@@ -244,19 +243,6 @@ main(argc, argv, envp)
        if (!nothaw)
                readconfig = !thaw(FreezeFile, argv0);
 
        if (!nothaw)
                readconfig = !thaw(FreezeFile, argv0);
 
-       /* strip out "dangerous" environment variables */
-       (void) unsetenv("FS");
-       for (i = 1; (p = envp[i++]) != NULL;)
-       {
-               if (strncmp(p, "LD_", 3) == 0)
-               {
-                       /* hack: change this name to be non-special */
-                       p[0] = '\201';
-                       continue;
-               }
-       }
-       environ = envp;
-
 # ifdef SETPROCTITLE
        /*
        **  Save start and extent of argv for setproctitle.
 # ifdef SETPROCTITLE
        /*
        **  Save start and extent of argv for setproctitle.
index 146d80c..529b02c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parseaddr.c        6.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c        6.6 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -425,7 +425,8 @@ prescan(addr, delim, pvpbuf)
 
                        /* read a new input character */
                        c = *p++;
 
                        /* read a new input character */
                        c = *p++;
-                       if (c == '\0' || (c == delim && anglecnt <= 0))
+                       if (c == '\0' ||
+                           (c == delim && anglecnt <= 0 && cmntcnt <= 0))
                        {
                                /* diagnose and patch up bad syntax */
                                if (state == QST)
                        {
                                /* diagnose and patch up bad syntax */
                                if (state == QST)
index aa82501..c99a139 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef QUEUE
 
 #ifndef lint
 #ifdef QUEUE
-static char sccsid[] = "@(#)queue.c    6.2 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c    6.3 (Berkeley) %G% (with queueing)";
 #else
 #else
-static char sccsid[] = "@(#)queue.c    6.2 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c    6.3 (Berkeley) %G% (without queueing)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -881,6 +881,8 @@ readqf(e)
        ctladdr = NULL;
        while ((bp = fgetfolded(buf, sizeof buf, qfp)) != NULL)
        {
        ctladdr = NULL;
        while ((bp = fgetfolded(buf, sizeof buf, qfp)) != NULL)
        {
+               struct stat st;
+
                if (tTd(40, 4))
                        printf("+++++ %s\n", bp);
                switch (bp[0])
                if (tTd(40, 4))
                        printf("+++++ %s\n", bp);
                switch (bp[0])
@@ -914,6 +916,8 @@ readqf(e)
                        e->e_dfp = fopen(e->e_df, "r");
                        if (e->e_dfp == NULL)
                                syserr("readqf: cannot open %s", e->e_df);
                        e->e_dfp = fopen(e->e_df, "r");
                        if (e->e_dfp == NULL)
                                syserr("readqf: cannot open %s", e->e_df);
+                       if (fstat(fileno(e->e_dfp), &st) >= 0)
+                               e->e_msgsize = st.st_size;
                        break;
 
                  case 'T':             /* init time */
                        break;
 
                  case 'T':             /* init time */
index 9aed5b6..ee11f15 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)version.c  6.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c  6.9 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-char   Version[] = "ALPHA-6.8";
+char   Version[] = "ALPHA-6.9";