throw in some "errno = 0;"'s to make syserr's more accurate;
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 13 Oct 1981 02:04:22 +0000 (18:04 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 13 Oct 1981 02:04:22 +0000 (18:04 -0800)
take any -f flag if debug mode and uid==euid.

SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.47
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.49
SCCS-vsn: usr.sbin/sendmail/src/main.c 3.41

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

index aabe99b..9563b67 100644 (file)
@@ -7,7 +7,7 @@
 # include <syslog.h>
 # endif LOG
 
 # include <syslog.h>
 # endif LOG
 
-static char SccsId[] = "@(#)deliver.c  3.46    %G%";
+static char SccsId[] = "@(#)deliver.c  3.47    %G%";
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
@@ -54,6 +54,7 @@ deliver(to, editfcn)
        char tfrombuf[MAXNAME];         /* translated from person */
        extern char **prescan();
 
        char tfrombuf[MAXNAME];         /* translated from person */
        extern char **prescan();
 
+       errno = 0;
        if (!ForceMail && bitset(QDONTSEND, to->q_flags))
                return (0);
 
        if (!ForceMail && bitset(QDONTSEND, to->q_flags))
                return (0);
 
@@ -89,7 +90,6 @@ deliver(to, editfcn)
        define('g', tfrombuf);          /* translated sender address */
        define('h', host);              /* to host */
        Errors = 0;
        define('g', tfrombuf);          /* translated sender address */
        define('h', host);              /* to host */
        Errors = 0;
-       errno = 0;
        pvp = pv;
        *pvp++ = m->m_argv[0];
 
        pvp = pv;
        *pvp++ = m->m_argv[0];
 
@@ -282,6 +282,7 @@ deliver(to, editfcn)
                ctladdr = &From;
        i = sendoff(m, pv, editfcn, ctladdr);
 
                ctladdr = &From;
        i = sendoff(m, pv, editfcn, ctladdr);
 
+       errno = 0;
        return (i);
 }
 \f/*
        return (i);
 }
 \f/*
@@ -363,6 +364,7 @@ sendoff(m, pvp, editfcn, ctladdr)
                printav(pvp);
        }
 # endif DEBUG
                printav(pvp);
        }
 # endif DEBUG
+       errno = 0;
 
        /* create a pipe to shove the mail through */
        if (pipe(pvect) < 0)
 
        /* create a pipe to shove the mail through */
        if (pipe(pvect) < 0)
index 373a8eb..6e13e04 100644 (file)
@@ -6,7 +6,7 @@
 # include <syslog.h>
 # endif LOG
 
 # include <syslog.h>
 # endif LOG
 
-static char    SccsId[] = "@(#)main.c  3.40    %G%";
+static char    SccsId[] = "@(#)main.c  3.41    %G%";
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
@@ -502,9 +502,9 @@ main(argc, argv)
 
        DontSend = FALSE;
        To = NULL;
 
        DontSend = FALSE;
        To = NULL;
-       errno = 0;
        if (!verifyonly || GrabTo)
                collect();
        if (!verifyonly || GrabTo)
                collect();
+       errno = 0;
 
        /* collect statistics */
        Stat.stat_nf[From.q_mailer]++;
 
        /* collect statistics */
        Stat.stat_nf[From.q_mailer]++;
@@ -627,6 +627,9 @@ setfrom(from, realname)
        if (from != NULL)
        {
                if (strcmp(realname, "network") != 0 && strcmp(realname, "uucp") != 0 &&
        if (from != NULL)
        {
                if (strcmp(realname, "network") != 0 && strcmp(realname, "uucp") != 0 &&
+# ifdef DEBUG
+                   (Debug == 0 || getuid() != geteuid()) &&
+# endif DEBUG
                    index(from, '!') == NULL && getuid() != 0)
                {
                        /* network sends -r regardless (why why why?) */
                    index(from, '!') == NULL && getuid() != 0)
                {
                        /* network sends -r regardless (why why why?) */
index 25ea47b..7cf4007 100644 (file)
@@ -1,3 +1,3 @@
-static char    SccsId[] = "@(#)SendMail version 3.48 of %G%";
+static char    SccsId[] = "@(#)SendMail version 3.49 of %G%";
 
 
-char   Version[] = "3.48 [%G%]";
+char   Version[] = "3.49 [%G%]";