last delta was too paranoid -- this increases the number of
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 17 Sep 1981 07:24:26 +0000 (23:24 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 17 Sep 1981 07:24:26 +0000 (23:24 -0800)
cases that work (but is still safe -- I hope)

SCCS-vsn: usr.sbin/sendmail/src/alias.c 3.23
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.40
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.30
SCCS-vsn: usr.sbin/sendmail/src/headers.c 3.9
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.18

usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/headers.c
usr/src/usr.sbin/sendmail/src/recipient.c
usr/src/usr.sbin/sendmail/src/version.c

index d52ffa3..2ee29ec 100644 (file)
@@ -4,9 +4,9 @@
 # include "sendmail.h"
 
 # ifdef DBM
 # include "sendmail.h"
 
 # ifdef DBM
-static char SccsId[] = "@(#)alias.c    3.22    %G%     (with DBM)";
+static char SccsId[] = "@(#)alias.c    3.23    %G%     (with DBM)";
 # else DBM
 # else DBM
-static char SccsId[] = "@(#)alias.c    3.22    %G%     (without DBM)";
+static char SccsId[] = "@(#)alias.c    3.23    %G%     (without DBM)";
 # endif DBM
 
 /*
 # endif DBM
 
 /*
@@ -113,7 +113,7 @@ alias(a)
                message(Arpa_Info, "aliased to %s", p);
        a->q_flags |= QDONTSEND;
        AliasLevel++;
                message(Arpa_Info, "aliased to %s", p);
        a->q_flags |= QDONTSEND;
        AliasLevel++;
-       sendto(p, 1, a);
+       sendto(p, 1, (a->q_alias == NULL) ? &From : a);
        AliasLevel--;
 }
 \f/*
        AliasLevel--;
 }
 \f/*
index c48b708..5e4480e 100644 (file)
@@ -7,7 +7,7 @@
 # include <syslog.h>
 # endif LOG
 
 # include <syslog.h>
 # endif LOG
 
-static char SccsId[] = "@(#)deliver.c  3.39    %G%";
+static char SccsId[] = "@(#)deliver.c  3.40    %G%";
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
@@ -713,6 +713,8 @@ mailfile(filename, ctladdr)
                        stb.st_mode = 0;
                if (bitset(0111, stb.st_mode))
                        exit(EX_CANTCREAT);
                        stb.st_mode = 0;
                if (bitset(0111, stb.st_mode))
                        exit(EX_CANTCREAT);
+               if (ctladdr == NULL)
+                       ctladdr = &From;
                if (!bitset(S_ISGID, stb.st_mode) || setgid(stb.st_gid) < 0)
                        (void) setgid(ctladdr->q_gid);
                if (!bitset(S_ISUID, stb.st_mode) || setuid(stb.st_uid) < 0)
                if (!bitset(S_ISGID, stb.st_mode) || setgid(stb.st_gid) < 0)
                        (void) setgid(ctladdr->q_gid);
                if (!bitset(S_ISUID, stb.st_mode) || setuid(stb.st_uid) < 0)
index 17a4792..3b9569c 100644 (file)
@@ -1,7 +1,7 @@
 # include <errno.h>
 # include "sendmail.h"
 
 # include <errno.h>
 # include "sendmail.h"
 
-static char    SccsId[] = "@(#)headers.c       3.8     %G%";
+static char    SccsId[] = "@(#)headers.c       3.9     %G%";
 
 /*
 **  CHOMPHEADER -- process and save a header line.
 
 /*
 **  CHOMPHEADER -- process and save a header line.
@@ -95,7 +95,7 @@ chompheader(line, def)
                free(h->h_value);
        h->h_value = newstr(fvalue);
        if (!def && GrabTo && bitset(H_ADDR, h->h_flags))
                free(h->h_value);
        h->h_value = newstr(fvalue);
        if (!def && GrabTo && bitset(H_ADDR, h->h_flags))
-               sendto(h->h_value, 0, &From);
+               sendto(h->h_value, 0, NULL);
 
        return (h->h_flags);
 }
 
        return (h->h_flags);
 }
index 267dc1a..c553c52 100644 (file)
@@ -3,7 +3,7 @@
 # include <sys/stat.h>
 # include "sendmail.h"
 
 # include <sys/stat.h>
 # include "sendmail.h"
 
-static char SccsId[] = "@(#)recipient.c        3.17    %G%";
+static char SccsId[] = "@(#)recipient.c        3.18    %G%";
 
 /*
 **  SENDTO -- Designate a send list.
 
 /*
 **  SENDTO -- Designate a send list.
@@ -131,7 +131,7 @@ recipient(a)
                        a->q_mailer = MN_PROG;
                        m = Mailer[MN_PROG];
                        a->q_user++;
                        a->q_mailer = MN_PROG;
                        m = Mailer[MN_PROG];
                        a->q_user++;
-                       if (getctladdr(a) == &From && Debug == 0)
+                       if (getctladdr(a) == NULL && Debug == 0)
                        {
                                usrerr("Cannot mail directly to programs");
                                a->q_flags |= QDONTSEND;
                        {
                                usrerr("Cannot mail directly to programs");
                                a->q_flags |= QDONTSEND;
@@ -174,7 +174,7 @@ recipient(a)
                if (strncmp(a->q_user, ":include:", 9) == 0)
                {
                        a->q_flags |= QDONTSEND;
                if (strncmp(a->q_user, ":include:", 9) == 0)
                {
                        a->q_flags |= QDONTSEND;
-                       if (getctladdr(a) == &From && Debug == 0)
+                       if (getctladdr(a) == NULL && Debug == 0)
                                usrerr("Cannot mail directly to :include:s");
                        else
                        {
                                usrerr("Cannot mail directly to :include:s");
                        else
                        {
@@ -215,7 +215,7 @@ recipient(a)
                if ((p = rindex(buf, '/')) != NULL)
                {
                        /* check if writable or creatable */
                if ((p = rindex(buf, '/')) != NULL)
                {
                        /* check if writable or creatable */
-                       if (getctladdr(a) == &From && Debug == 0)
+                       if (getctladdr(a) == NULL && Debug == 0)
                        {
                                usrerr("Cannot mail directly to files");
                                a->q_flags |= QDONTSEND;
                        {
                                usrerr("Cannot mail directly to files");
                                a->q_flags |= QDONTSEND;
@@ -447,7 +447,7 @@ sendtoargv(argv)
                                argv += 2;
                        }
                }
                                argv += 2;
                        }
                }
-               sendto(p, 0, &From);
+               sendto(p, 0, NULL);
        }
 }
 \f/*
        }
 }
 \f/*
@@ -471,7 +471,5 @@ getctladdr(a)
 {
        while (a != NULL && a->q_home == NULL)
                a = a->q_alias;
 {
        while (a != NULL && a->q_home == NULL)
                a = a->q_alias;
-       if (a == NULL)
-               return (&From);
        return (a);
 }
        return (a);
 }
index 8725fd1..ca98ac2 100644 (file)
@@ -1,3 +1,3 @@
-static char    SccsId[] = "@(#)SendMail version 3.29 of %G%";
+static char    SccsId[] = "@(#)SendMail version 3.30 of %G%";
 
 
-char   Version[] = "3.29 [%G%]";
+char   Version[] = "3.30 [%G%]";