from set by sendmail -- don't reset it!
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 20 Jan 1991 05:06:59 +0000 (21:06 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 20 Jan 1991 05:06:59 +0000 (21:06 -0800)
SCCS-vsn: libexec/mail.local/mail.local.c 5.1

usr/src/libexec/mail.local/mail.local.c

index bd5a271..c4ef62f 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)mail.local.c       4.38 (Berkeley) %G%";
+static char sccsid[] = "@(#)mail.local.c       5.1 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -74,8 +74,8 @@ main(argc, argv)
         * corresponding to the uid.
         */
        uid = getuid();
         * corresponding to the uid.
         */
        uid = getuid();
-       if (!from || !(from = getlogin()) ||
-           !(pw = getpwnam(from)) || pw->pw_uid != uid)
+       if (!from && (!(from = getlogin()) ||
+           !(pw = getpwnam(from)) || pw->pw_uid != uid))
                from = (pw = getpwuid(uid)) ? pw->pw_name : "???";
 
        fd = store(from);
                from = (pw = getpwuid(uid)) ? pw->pw_name : "???";
 
        fd = store(from);