From c1a66acf9306e0dde6596c8c062512c3ba5dfbef Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Mon, 12 Mar 1984 03:40:44 -0800 Subject: [PATCH] Remember to open the alias file if the ONEX command is specified. SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 4.8 --- usr/src/usr.sbin/sendmail/src/srvrsmtp.c | 62 ++++++++++++------------ 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c index 6a1b24967c..f40b1f7304 100644 --- a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c +++ b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c @@ -3,10 +3,10 @@ # include # ifndef SMTP -SCCSID(@(#)srvrsmtp.c 4.7 %G% (no SMTP)); +SCCSID(@(#)srvrsmtp.c 4.8 %G% (no SMTP)); # else SMTP -SCCSID(@(#)srvrsmtp.c 4.7 %G%); +SCCSID(@(#)srvrsmtp.c 4.8 %G%); /* ** SMTP -- run the SMTP protocol. @@ -562,41 +562,43 @@ runinchild(label) { int childpid; - if (OneXact) - return (0); - - childpid = dofork(); - if (childpid < 0) - { - syserr("%s: cannot fork", label); - return (1); - } - if (childpid > 0) + if (!OneXact) { - auto int st; + childpid = dofork(); + if (childpid < 0) + { + syserr("%s: cannot fork", label); + return (1); + } + if (childpid > 0) + { + auto int st; - /* parent -- wait for child to complete */ - st = waitfor(childpid); - if (st == -1) - syserr("%s: lost child", label); + /* parent -- wait for child to complete */ + st = waitfor(childpid); + if (st == -1) + syserr("%s: lost child", label); - /* if we exited on a QUIT command, complete the process */ - if (st == (EX_QUIT << 8)) - finis(); + /* if we exited on a QUIT command, complete the process */ + if (st == (EX_QUIT << 8)) + finis(); - return (1); + return (1); + } + else + { + /* child */ + InChild = TRUE; + } } - else - { - /* child */ - InChild = TRUE; - clearenvelope(CurEnv); - /* open alias database */ - initaliases(AliasFile, FALSE); + /* child (or ONEX command specified) */ + clearenvelope(CurEnv); - return (0); - } + /* open alias database */ + initaliases(AliasFile, FALSE); + + return (0); } /* ** PADDRTREE -- print address tree -- 2.20.1