diff -c -r sendmail-8.8.3/RELEASE_NOTES sendmail-8.8.4/RELEASE_NOTES *** sendmail-8.8.3/RELEASE_NOTES Sat Nov 16 18:35:59 1996 --- sendmail-8.8.4/RELEASE_NOTES Mon Dec 2 08:05:13 1996 *************** *** 1,11 **** SENDMAIL RELEASE NOTES ! @(#)RELEASE_NOTES 8.8.3.2 (Berkeley) 11/16/96 This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. 8.8.3/8.8.3 96/11/17 SECURITY: it was possible to get a root shell by lying to sendmail about argv[0] and then sending it a signal. Problem noted --- 1,110 ---- SENDMAIL RELEASE NOTES ! @(#)RELEASE_NOTES 8.8.4.4 (Berkeley) 12/2/96 This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. + 8.8.4/8.8.4 96/12/02 + SECURITY: under some circumstances, an attacker could get additional + permissions by hard linking to files that were group + writable by the attacker. The solution is to disallow any + files that have hard links -- this will affect .forward, + :include:, and output files. Problem noted by Terry + Kyriacopoulos of Interlog Internet Services. As a + workaround, set UnsafeGroupWrites -- always a good idea. + SECURITY: the TryNullMXList (w) option should not be safe -- if it + is, it is possible to do a denial-of-service attack on + MX hosts that rely on the use of the null MX list. There + is no danger if you have this option turned off (the default). + Problem noted by Dan Bernstein. Also, make the DontInitGroups + unsafe. I know of no specific attack against this, although + a denial-of-service attack is probably possible, but in theory + you should not be able to safely tweak anything that affects + the permissions that are used when mail is delivered. + Purgestat could go into an infinite loop if one of the host status + directories somehow became empty. Problem noted by Roy + Mongiovi of Georgia Tech. + Processes got "lost" when counting children due to a race condition. + This caused "proc_list_probe: lost pid" messages to be logged. + Problem noted by several people. + On systems with System V SIGCLD child signal semantics (notably AIX + and HP-UX), mail transactions would print the message "451 + SMTP-MAIL: lost child: No child processes". Problem noted + by several people. + Miscellaneous compiler warnings on picky compilers (or when setting + gcc to high warning levels). From Tom Moore of NCR Corp. + SMTP protocol errors, and most errors on MAIL FROM: lines should + not be persistent between runs, since they are based on the + message rather than the host. Problem noted by Matt Dillon + of Best Internet Communications. + The F=7 flag was ignored on SMTP mailers. Problem noted by Tom Moore + of NCR (a.k.a., AT&T Global Information Solutions). + Avoid the possibility of having a child daemon run to completion + (including closing the SMTP socket) before the parent has + had a chance to close the socket; this can cause the parent + to hang for a long time waiting for the socket to drain. + Patch from Don Lewis of TDK Semiconductor. + If the fork() failed in a queue run, the queue runners would not be + rescheduled (so queue runs would stop). Patch from Don Lewis. + Some error conditions in ETRN could cause output without an SMTP + status code. Problem noted by Don Lewis. + Multiple :maildrop addresses in the user database didn't work properly. + Patch from Roy Mongiovi of Georgia Tech. + Add ".db" automatically onto any user database spec that does not + already have it; this is for consistency with makemap, the + K line, and the documentation. Inconsistency pointed out + by Roy Mongiovi. + Allow sendmail to be properly called in nohup mode. Patch from + Kyle Jones of UUNET. + Change ETRN to ignore but still update host status files; previously + it would ignore them and not save the updated status, which + caused stale information to be maintained. Based on a patch + from Christopher Davis of Kapor Enterprises Inc. Also, have + ETRN ignore the MinQueueAge option. + Patch long term host status to recover more gracefully from an empty + host status file condition. Patch from NAKAMURA Motonori + of Kyoto University. + Several patches to signal handling code to fix potential race + conditions from Don Lewis. + Make it possible to compile with -DDAEMON=0 (previously it had some + compile errors). This turns DAEMON, QUEUE, and SMTP into + 0/1 compilation flags. Note that DAEMON is an obsolete + compile flag; use NETINET instead. Solution based on a + patch from Bryan Costales. + PORTABILITY FIXES: + AIX4: getpwnam() and getpwuid() do a sequential scan of the + /etc/security/passwd file when called as root. This + is very slow on some systems. To speed it up, use the + (undocumented) _getpw{nam,uid}_shadow() routines. + Patch from Chris Thomas of UCLA/OAC Systems Group. + SCO 5.x: include -lprot in the Makefile. Patch from Bill + Glicker of Burrelle's Information Service. + NEWS-OS 4.x: need a definition for MODE_T to compile. Patch + from Makoto MATSUSHITA of Osaka University. + SunOS 4.0.3: compile problems. Patches from Andrew Cole of + Leeds University and SASABE Tetsuro of the University + of Tokyo. + DG/UX 5.4.4.11 from Brian J. Murrell of InterLinx Support + Services, Inc. + Domain/OS from Don (Truck) Lewis of TDK Semiconductor Corp. + I believe this to have only been a problem if you + compiled with -DUSE_VENDOR_CF_PATH -- another reason + to stick with /etc/sendmail.cf as your One True Path. + Digital UNIX (OSF/1 on Alpha) load average computation from + Martin Laubach of the Technischen Universität Wien. + CONFIG: change default Received: line to be multiple lines rather + than one long one. By popular demand. + MAIL.LOCAL: warnings weren't being logged on some systems. Patch + from Jerome Berkman of U.C. Berkeley. + MAKEMAP: be sure to zero hinfo to avoid cruft that can cause runs + to take a very long time. Problem noted by Yoshiro YONEYA + of NTT Software Corporation. + CONTRIB: add etrn.pl, contributed by John Beck. + NEW FILES: + contrib/etrn.pl + 8.8.3/8.8.3 96/11/17 SECURITY: it was possible to get a root shell by lying to sendmail about argv[0] and then sending it a signal. Problem noted *************** *** 83,89 **** AIX4: use tzname[] vector to determine time zone name. Patch from NAKAMURA Motonori of Kyoto University. MkLinux: add Makefile.Linux.ppc and OSTYPE(mklinux) support. ! Contributed by Paul DeBois . Solaris: kstat(3k) support for retrieving the load average. This adds the LA_KSTAT definition for LA_TYPE. The outline of the implementation was contributed --- 182,188 ---- AIX4: use tzname[] vector to determine time zone name. Patch from NAKAMURA Motonori of Kyoto University. MkLinux: add Makefile.Linux.ppc and OSTYPE(mklinux) support. ! Contributed by Paul DuBois . Solaris: kstat(3k) support for retrieving the load average. This adds the LA_KSTAT definition for LA_TYPE. The outline of the implementation was contributed Only in sendmail-8.8.3/cf/cf: obj diff -c -r sendmail-8.8.3/cf/m4/cfhead.m4 sendmail-8.8.4/cf/m4/cfhead.m4 *** sendmail-8.8.3/cf/m4/cfhead.m4 Fri Aug 30 11:04:39 1996 --- sendmail-8.8.4/cf/m4/cfhead.m4 Wed Nov 20 07:54:50 1996 *************** *** 128,134 **** define(`confFROM_LINE', `From $g $d') define(`confOPERATORS', `.:%@!^/[]+') define(`confSMTP_LOGIN_MSG', `$j Sendmail $v/$Z; $b') ! define(`confRECEIVED_HEADER', `$?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b') define(`confSEVEN_BIT_INPUT', `False') define(`confEIGHT_BIT_HANDLING', `pass8') define(`confALIAS_WAIT', `10') --- 128,136 ---- define(`confFROM_LINE', `From $g $d') define(`confOPERATORS', `.:%@!^/[]+') define(`confSMTP_LOGIN_MSG', `$j Sendmail $v/$Z; $b') ! define(`confRECEIVED_HEADER', `$?sfrom $s $.$?_($?s$|from $.$_) ! $.by $j ($v/$Z)$?r with $r$. ! id $i$?u for $u$.; $b') define(`confSEVEN_BIT_INPUT', `False') define(`confEIGHT_BIT_HANDLING', `pass8') define(`confALIAS_WAIT', `10') *************** *** 154,157 **** define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward') divert(0)dnl ! VERSIONID(`@(#)cfhead.m4 8.6 (Berkeley) 6/19/96') --- 156,159 ---- define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward') divert(0)dnl ! VERSIONID(`@(#)cfhead.m4 8.7 (Berkeley) 11/20/96') diff -c -r sendmail-8.8.3/cf/m4/proto.m4 sendmail-8.8.4/cf/m4/proto.m4 *** sendmail-8.8.3/cf/m4/proto.m4 Sat Oct 26 09:12:17 1996 --- sendmail-8.8.4/cf/m4/proto.m4 Sun Nov 24 09:33:40 1996 *************** *** 34,40 **** # divert(0) ! VERSIONID(`@(#)proto.m4 8.135 (Berkeley) 10/26/96') MAILER(local)dnl --- 34,40 ---- # divert(0) ! VERSIONID(`@(#)proto.m4 8.136 (Berkeley) 11/24/96') MAILER(local)dnl *************** *** 428,434 **** # shall I avoid calling initgroups(3) because of high NIS costs? _OPTION(DontInitGroups, `confDONT_INIT_GROUPS') ! # are group-writable :include: and .forward files (un)trustworthy? _OPTION(UnsafeGroupWrites, `confUNSAFE_GROUP_WRITES') # where do errors that occur when sending errors get sent? --- 428,434 ---- # shall I avoid calling initgroups(3) because of high NIS costs? _OPTION(DontInitGroups, `confDONT_INIT_GROUPS') ! # are group-writable `:include:' and .forward files (un)trustworthy? _OPTION(UnsafeGroupWrites, `confUNSAFE_GROUP_WRITES') # where do errors that occur when sending errors get sent? *************** *** 635,641 **** R$+ @ $+ . DECNET $2 :: $1 u@h.DECNET => h::u', `dnl') # delete duplicate local names ! R$+ % $=w @ $=w $1 @ $j u%host@host => u@host --- 635,641 ---- R$+ @ $+ . DECNET $2 :: $1 u@h.DECNET => h::u', `dnl') # delete duplicate local names ! R$+ % $=w @ $=w $1 @ $2 u%host@host => u@host diff -c -r sendmail-8.8.3/cf/m4/version.m4 sendmail-8.8.4/cf/m4/version.m4 *** sendmail-8.8.3/cf/m4/version.m4 Sat Nov 16 15:01:50 1996 --- sendmail-8.8.4/cf/m4/version.m4 Tue Nov 26 08:14:24 1996 *************** *** 32,39 **** # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! VERSIONID(`@(#)version.m4 8.8.3.1 (Berkeley) 11/16/96') # divert(0) # Configuration version number ! DZ8.8.3`'ifdef(`confCF_VERSION', `/confCF_VERSION') --- 32,39 ---- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! VERSIONID(`@(#)version.m4 8.8.4.2 (Berkeley) 11/26/96') # divert(0) # Configuration version number ! DZ8.8.4`'ifdef(`confCF_VERSION', `/confCF_VERSION') diff -c -r sendmail-8.8.3/cf/ostype/mklinux.m4 sendmail-8.8.4/cf/ostype/mklinux.m4 *** sendmail-8.8.3/cf/ostype/mklinux.m4 Wed Oct 30 08:13:40 1996 --- sendmail-8.8.4/cf/ostype/mklinux.m4 Sun Nov 17 15:07:19 1996 *************** *** 32,42 **** # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! # MkLinux support contributed by Paul DeBois # divert(0) ! VERSIONID(`@(#)mklinux.m4 8.1 (Berkeley) 10/30/96') ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/log/sendmail.st)') ifdef(`PROCMAIL_MAILER_PATH',, --- 32,42 ---- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! # MkLinux support contributed by Paul DuBois # divert(0) ! VERSIONID(`@(#)mklinux.m4 8.2 (Berkeley) 11/17/96') ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /var/log/sendmail.st)') ifdef(`PROCMAIL_MAILER_PATH',, Only in sendmail-8.8.4/contrib: etrn.pl diff -c -r sendmail-8.8.3/doc/op/op.me sendmail-8.8.4/doc/op/op.me *** sendmail-8.8.3/doc/op/op.me Sat Nov 16 08:08:23 1996 --- sendmail-8.8.4/doc/op/op.me Sun Dec 1 12:48:29 1996 *************** *** 30,36 **** .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" ! .\" @(#)op.me 8.98 (Berkeley) 11/16/96 .\" .\" eqn op.me | pic | troff -me .eh 'SMM:08-%''Sendmail Installation and Operation Guide' --- 30,36 ---- .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" ! .\" @(#)op.me 8.100 (Berkeley) 12/1/96 .\" .\" eqn op.me | pic | troff -me .eh 'SMM:08-%''Sendmail Installation and Operation Guide' *************** *** 68,74 **** InReference, Inc. eric@Sendmail.ORG .sp ! Version 8.98 .sp For Sendmail Version 8.8 .)l --- 68,74 ---- InReference, Inc. eric@Sendmail.ORG .sp ! Version 8.100 .sp For Sendmail Version 8.8 .)l *************** *** 5845,5851 **** .i setvendor in .i conf.c . ! Please send e-mail to sendmail@CS.Berkeley.EDU to register your vendor dialect. .)f You may use --- 5845,5851 ---- .i setvendor in .i conf.c . ! Please send e-mail to sendmail@Sendmail.ORG to register your vendor dialect. .)f You may use *************** *** 6619,6630 **** of UNIX-style .q "From " lines. ! .ip QUEUE This flag should be set to compile in the queueing code. If this is not set, mailers must accept the mail immediately or it will be returned to the sender. ! .ip SMTP If set, the code to handle user and server SMTP will be compiled in. This is only necessary if your machine has some mailer --- 6619,6630 ---- of UNIX-style .q "From " lines. ! .ip QUEUE\(dg This flag should be set to compile in the queueing code. If this is not set, mailers must accept the mail immediately or it will be returned to the sender. ! .ip SMTP\(dg If set, the code to handle user and server SMTP will be compiled in. This is only necessary if your machine has some mailer *************** *** 7156,7162 **** you may need to add some new tweaks.\** .(f \**If you do, please send updates to ! sendmail@CS.Berkeley.EDU. .)f .sh 2 "Configuration in src/daemon.c" .pp --- 7156,7162 ---- you may need to add some new tweaks.\** .(f \**If you do, please send updates to ! sendmail@Sendmail.ORG. .)f .sh 2 "Configuration in src/daemon.c" .pp *************** *** 7686,7692 **** .pp Special thanks are reserved for Michael Corrigan and Christophe Wolfhugel, who besides being wonderful guinea pigs and contributors ! have also consented to be added to the ``sendmail@CS.Berkeley.EDU'' list and, by answering the bulk of the questions sent to that list, have freed me up to do other work. .++ A --- 7686,7692 ---- .pp Special thanks are reserved for Michael Corrigan and Christophe Wolfhugel, who besides being wonderful guinea pigs and contributors ! have also consented to be added to the ``sendmail@Sendmail.ORG'' list and, by answering the bulk of the questions sent to that list, have freed me up to do other work. .++ A *************** *** 8150,8156 **** .\"Eric Allman .\"InReference, Inc. .\".sp ! .\"Version 8.98 .\".ce 0 .bp 2 .rs --- 8150,8156 ---- .\"Eric Allman .\"InReference, Inc. .\".sp ! .\"Version 8.100 .\".ce 0 .bp 2 .rs Only in sendmail-8.8.3/mail.local: mail.local.0 diff -c -r sendmail-8.8.3/mail.local/mail.local.c sendmail-8.8.4/mail.local/mail.local.c *** sendmail-8.8.3/mail.local/mail.local.c Wed Nov 13 16:17:43 1996 --- sendmail-8.8.4/mail.local/mail.local.c Sun Nov 24 14:15:27 1996 *************** *** 38,44 **** #endif /* not lint */ #ifndef lint ! static char sccsid[] = "@(#)mail.local.c 8.33 (Berkeley) 11/13/96"; #endif /* not lint */ /* --- 38,44 ---- #endif /* not lint */ #ifndef lint ! static char sccsid[] = "@(#)mail.local.c 8.34 (Berkeley) 11/24/96"; #endif /* not lint */ /* *************** *** 646,652 **** { char fmtbuf[10240]; ! (void) sprintf(fmtbuf, fmt, ap); syslog(LOG_ERR, "%s", fmtbuf); } #endif --- 646,652 ---- { char fmtbuf[10240]; ! (void) vsprintf(fmtbuf, fmt, ap); syslog(LOG_ERR, "%s", fmtbuf); } #endif Only in sendmail-8.8.3/mailstats: mailstats.0 Only in sendmail-8.8.3/makemap: makemap.0 diff -c -r sendmail-8.8.3/makemap/makemap.c sendmail-8.8.4/makemap/makemap.c *** sendmail-8.8.3/makemap/makemap.c Wed Nov 13 10:04:03 1996 --- sendmail-8.8.4/makemap/makemap.c Mon Nov 18 07:41:59 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)makemap.c 8.18 (Berkeley) 11/13/96"; #endif /* not lint */ #include --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)makemap.c 8.19 (Berkeley) 11/18/96"; #endif /* not lint */ #include *************** *** 237,242 **** --- 237,243 ---- break; case T_HASH: + bzero(&hinfo, sizeof hinfo); if (allowreplace) putflags = 0; else Only in sendmail-8.8.3/praliases: praliases.0 Only in sendmail-8.8.3/smrsh: smrsh.0 diff -c -r sendmail-8.8.3/src/Makefiles/Makefile.SCO.5.x sendmail-8.8.4/src/Makefiles/Makefile.SCO.5.x *** sendmail-8.8.3/src/Makefiles/Makefile.SCO.5.x Sun Nov 10 11:15:56 1996 --- sendmail-8.8.4/src/Makefiles/Makefile.SCO.5.x Fri Nov 22 07:25:56 1996 *************** *** 7,13 **** # # Tested on SCO OpenServer 5 by Keith Reynolds . # ! # @(#)Makefile.SCO.5.x 8.3 (Berkeley) 11/10/96 # # use O=-O (usual) or O=-g (debugging) --- 7,13 ---- # # Tested on SCO OpenServer 5 by Keith Reynolds . # ! # @(#)Makefile.SCO.5.x 8.4 (Berkeley) 11/22/96 # # use O=-O (usual) or O=-g (debugging) *************** *** 34,40 **** LIBDIRS= # libraries required on your system ! LIBS= -lsocket -lndbm -lcurses -lm -lx # location of sendmail binary (usually /usr/sbin or /usr/lib) BINDIR= ${DESTDIR}/usr/lib --- 34,40 ---- LIBDIRS= # libraries required on your system ! LIBS= -lsocket -lndbm -lprot -lcurses -lm -lx # location of sendmail binary (usually /usr/sbin or /usr/lib) BINDIR= ${DESTDIR}/usr/lib diff -c -r sendmail-8.8.3/src/Makefiles/Makefile.SunOS.4.0 sendmail-8.8.4/src/Makefiles/Makefile.SunOS.4.0 *** sendmail-8.8.3/src/Makefiles/Makefile.SunOS.4.0 Fri Sep 20 07:35:45 1996 --- sendmail-8.8.4/src/Makefiles/Makefile.SunOS.4.0 Wed Nov 27 09:27:51 1996 *************** *** 8,14 **** # You may find you need to find versions of some routines # such as strcasecmp in order to link this on SunOS 4.0.3. # ! # @(#)Makefile.SunOS.4.0 8.11 (Berkeley) 9/20/96 # # use O=-O (usual) or O=-g (debugging) --- 8,14 ---- # You may find you need to find versions of some routines # such as strcasecmp in order to link this on SunOS 4.0.3. # ! # @(#)Makefile.SunOS.4.0 8.12 (Berkeley) 11/27/96 # # use O=-O (usual) or O=-g (debugging) *************** *** 52,58 **** # additional .o files needed OBJADD= ! BEFORE= stdlib.h stddef.h ################### end of user configuration flags ###################### --- 52,58 ---- # additional .o files needed OBJADD= ! BEFORE= stdlib.h stddef.h limits.h ################### end of user configuration flags ###################### *************** *** 78,84 **** sendmail: ${BEFORE} ${OBJS} ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS} ! stddef.h stdlib.h: cp /dev/null $@ #NROFF= nroff -h --- 78,84 ---- sendmail: ${BEFORE} ${OBJS} ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS} ! stddef.h stdlib.h limits.h: cp /dev/null $@ #NROFF= nroff -h diff -c -r sendmail-8.8.3/src/READ_ME sendmail-8.8.4/src/READ_ME *** sendmail-8.8.3/src/READ_ME Sun Nov 10 11:15:33 1996 --- sendmail-8.8.4/src/READ_ME Sun Dec 1 09:34:38 1996 *************** *** 30,36 **** # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! # @(#)READ_ME 8.130 (Berkeley) 11/10/96 # This directory contains the source files for sendmail. --- 30,36 ---- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! # @(#)READ_ME 8.132 (Berkeley) 12/1/96 # This directory contains the source files for sendmail. *************** *** 175,180 **** --- 175,184 ---- >>> OVERRIDE calls to ndbm routines -- in particular, if you leave ndbm.h >>> in, you can find yourself using the new db package even if you don't >>> define NEWDB. + >>> + >>> Further note: DO NOT remove your existing /usr/include/ndbm.h -- + >>> you need that one. But do not install an updated ndbm.h in + >>> /usr/include, /usr/local/include, or anywhere else. If NEWDB and NDBM are defined (but not NIS), then sendmail will read NDBM format alias files, but the next time a newaliases is run the *************** *** 790,795 **** --- 794,816 ---- IDENT on in the configuration file by setting the "ident" timeout to 30 seconds. + Solaris 2.5.1 (SunOS 5.5.1) + Apparently patch 103663-01 installs a new /usr/include/resolv.h + file that defines the __P macro without checking to see if it is + already defined. This causes compile warnings such as: + + In file included from daemon.c:51: + /usr/include/resolv.h:208: warning: `__P' redefined + cdefs.h:58: warning: this is the location of the previous definition + + If you are running with this patch, create a file in the + obj.SunOS.5.5.1.* directory that reads: + + #undef __P + #include "/usr/include/resolv.h" + + ... And then file a bug report with Sun. + OSF/1 If you are compiling on OSF/1 (DEC Alpha), you must use -L/usr/shlib (otherwise it core dumps on startup). You may also *************** *** 1377,1380 **** Eric Allman ! (Version 8.130, last update 11/10/96 11:15:30) --- 1398,1401 ---- Eric Allman ! (Version 8.132, last update 12/1/96 09:34:37) Only in sendmail-8.8.3/src: aliases.0 diff -c -r sendmail-8.8.3/src/clock.c sendmail-8.8.4/src/clock.c *** sendmail-8.8.3/src/clock.c Wed Feb 21 17:01:29 1996 --- sendmail-8.8.4/src/clock.c Wed Nov 27 09:29:06 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)clock.c 8.13 (Berkeley) 2/21/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)clock.c 8.16 (Berkeley) 11/27/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 98,105 **** *evp = ev; if (tTd(5, 5)) ! printf("setevent: intvl=%ld, for=%ld, func=%x, arg=%d, ev=%x\n", ! intvl, now + intvl, func, arg, ev); tick(0); return (ev); --- 98,105 ---- *evp = ev; if (tTd(5, 5)) ! printf("setevent: intvl=%ld, for=%ld, func=%lx, arg=%d, ev=%lx\n", ! intvl, now + intvl, (u_long) func, arg, (u_long) ev); tick(0); return (ev); *************** *** 124,130 **** register EVENT **evp; if (tTd(5, 5)) ! printf("clrevent: ev=%x\n", ev); if (ev == NULL) return; --- 124,130 ---- register EVENT **evp; if (tTd(5, 5)) ! printf("clrevent: ev=%lx\n", (u_long) ev); if (ev == NULL) return; *************** *** 191,198 **** ev = EventQueue; EventQueue = EventQueue->ev_link; if (tTd(5, 6)) ! printf("tick: ev=%x, func=%x, arg=%d, pid=%d\n", ev, ! ev->ev_func, ev->ev_arg, ev->ev_pid); /* we must be careful in here because ev_func may not return */ f = ev->ev_func; --- 191,199 ---- ev = EventQueue; EventQueue = EventQueue->ev_link; if (tTd(5, 6)) ! printf("tick: ev=%lx, func=%lx, arg=%d, pid=%d\n", ! (u_long) ev, (u_long) ev->ev_func, ! ev->ev_arg, ev->ev_pid); /* we must be careful in here because ev_func may not return */ f = ev->ev_func; *************** *** 211,227 **** /* restore signals so that we can take ticks while in ev_func */ (void) setsignal(SIGALRM, tick); ! #ifdef SIG_UNBLOCK ! /* unblock SIGALRM signal */ ! sigemptyset(&ss); ! sigaddset(&ss, SIGALRM); ! sigprocmask(SIG_UNBLOCK, &ss, NULL); ! #else ! #if HASSIGSETMASK ! /* reset 4.2bsd signal mask to allow future alarms */ ! (void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM)); ! #endif /* HASSIGSETMASK */ ! #endif /* SIG_UNBLOCK */ /* call ev_func */ errno = olderrno; --- 212,218 ---- /* restore signals so that we can take ticks while in ev_func */ (void) setsignal(SIGALRM, tick); ! (void) releasesignal(SIGALRM); /* call ev_func */ errno = olderrno; *************** *** 262,273 **** --- 253,269 ---- sleep(intvl) unsigned int intvl; { + int was_held; + if (intvl == 0) return (SLEEP_T) 0; SleepDone = FALSE; (void) setevent((time_t) intvl, endsleep, 0); + was_held = releasesignal(SIGALRM); while (!SleepDone) pause(); + if (was_held > 0) + blocksignal(SIGALRM); return (SLEEP_T) 0; } diff -c -r sendmail-8.8.3/src/collect.c sendmail-8.8.4/src/collect.c *** sendmail-8.8.3/src/collect.c Fri Nov 15 07:23:02 1996 --- sendmail-8.8.4/src/collect.c Sun Nov 24 07:27:19 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)collect.c 8.60 (Berkeley) 11/15/96"; #endif /* not lint */ # include --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)collect.c 8.61 (Berkeley) 11/24/96"; #endif /* not lint */ # include *************** *** 90,107 **** HDR **hdrp; register ENVELOPE *e; { ! register FILE *tf; ! bool ignrdot = smtpmode ? FALSE : IgnrDot; ! time_t dbto = smtpmode ? TimeOuts.to_datablock : 0; ! register char *bp; ! int c = '\0'; ! bool inputerr = FALSE; bool headeronly; ! char *buf; ! int buflen; ! int istate; ! int mstate; ! u_char *pbp; u_char peekbuf[8]; char dfname[20]; char bufbuf[MAXLINE]; --- 90,107 ---- HDR **hdrp; register ENVELOPE *e; { ! register FILE *volatile tf; ! volatile bool ignrdot = smtpmode ? FALSE : IgnrDot; ! volatile time_t dbto = smtpmode ? TimeOuts.to_datablock : 0; ! register char *volatile bp; ! volatile int c = '\0'; ! volatile bool inputerr = FALSE; bool headeronly; ! char *volatile buf; ! volatile int buflen; ! volatile int istate; ! volatile int mstate; ! u_char *volatile pbp; u_char peekbuf[8]; char dfname[20]; char bufbuf[MAXLINE]; *************** *** 205,211 **** { if (istate == IS_BOL) fprintf(TrafficLogFile, "%05d <<< ", ! getpid()); if (c == EOF) fprintf(TrafficLogFile, "[EOF]\n"); else --- 205,211 ---- { if (istate == IS_BOL) fprintf(TrafficLogFile, "%05d <<< ", ! (int) getpid()); if (c == EOF) fprintf(TrafficLogFile, "[EOF]\n"); else *************** *** 647,653 **** st.st_size); else fprintf(tf, "\n*** Mail of at least %ld bytes could not be accepted\n", ! st.st_size); fprintf(tf, "*** at %s due to lack of disk space for temp file.\n", MyHostName); avail = freediskspace(QueueDir, &bsize); --- 647,653 ---- st.st_size); else fprintf(tf, "\n*** Mail of at least %ld bytes could not be accepted\n", ! (long) st.st_size); fprintf(tf, "*** at %s due to lack of disk space for temp file.\n", MyHostName); avail = freediskspace(QueueDir, &bsize); diff -c -r sendmail-8.8.3/src/conf.c sendmail-8.8.4/src/conf.c *** sendmail-8.8.3/src/conf.c Sun Nov 10 11:15:35 1996 --- sendmail-8.8.4/src/conf.c Sun Dec 1 10:57:09 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)conf.c 8.315 (Berkeley) 11/10/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)conf.c 8.325 (Berkeley) 12/1/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 1089,1122 **** #endif } /* ! ** RELEASESIGNAL -- release a held signal ** ** Parameters: ! ** sig -- the signal to release. ** ** Returns: ! ** 0 on success. ** -1 on failure. */ int ! releasesignal(sig) int sig; { #ifdef BSD4_3 # ifndef sigmask # define sigmask(s) (1 << ((s) - 1)) # endif ! return sigsetmask(sigblock(0) & ~sigmask(sig)); #else # ifdef ALTOS_SYSTEM_V ! sigrelse(sig) ; # else ! sigset_t sset; sigemptyset(&sset); sigaddset(&sset, sig); ! return sigprocmask(SIG_UNBLOCK, &sset, NULL); # endif #endif } --- 1089,1171 ---- #endif } /* ! ** BLOCKSIGNAL -- hold a signal to prevent delivery ** ** Parameters: ! ** sig -- the signal to block. ** ** Returns: ! ** 1 signal was previously blocked ! ** 0 signal was not previously blocked ** -1 on failure. */ int ! blocksignal(sig) int sig; { #ifdef BSD4_3 # ifndef sigmask # define sigmask(s) (1 << ((s) - 1)) # endif ! return (sigblock(sigmask(sig)) & sigmask(sig)) != 0; #else # ifdef ALTOS_SYSTEM_V ! sigfunc_t handler; ! ! handler = sigset(sig, SIG_HOLD); ! if (handler == SIG_ERR) ! return -1; ! else ! return handler == SIG_HOLD; # else ! sigset_t sset, oset; sigemptyset(&sset); sigaddset(&sset, sig); ! if (sigprocmask(SIG_BLOCK, &sset, &oset) < 0) ! return -1; ! else ! return sigismember(&oset, sig); ! # endif ! #endif ! } ! /* ! ** RELEASESIGNAL -- release a held signal ! ** ! ** Parameters: ! ** sig -- the signal to release. ! ** ! ** Returns: ! ** 1 signal was previously blocked ! ** 0 signal was not previously blocked ! ** -1 on failure. ! */ ! ! int ! releasesignal(sig) ! int sig; ! { ! #ifdef BSD4_3 ! return (sigsetmask(sigblock(0) & ~sigmask(sig)) & sigmask(sig)) != 0; ! #else ! # ifdef ALTOS_SYSTEM_V ! sigfunc_t handler; ! ! handler = sigset(sig, SIG_HOLD); ! if (sigrelse(sig) < 0) ! return -1; ! else ! return handler == SIG_HOLD; ! # else ! sigset_t sset, oset; ! ! sigemptyset(&sset); ! sigaddset(&sset, sig); ! if (sigprocmask(SIG_UNBLOCK, &sset, &oset) < 0) ! return -1; ! else ! return sigismember(&oset, sig); # endif #endif } *************** *** 1258,1263 **** --- 1307,1313 ---- #define LA_IRIX6 11 /* special IRIX 6.2 implementation */ #define LA_KSTAT 12 /* special Solaris kstat(3k) implementation */ #define LA_DEVSHORT 13 /* read short from a device */ + #define LA_ALPHAOSF 14 /* Digital UNIX (OSF/1 on Alpha) table() call */ /* do guesses based on general OS type */ #ifndef LA_TYPE *************** *** 1380,1386 **** (void) fcntl(kmem, F_SETFD, 1); } if (tTd(3, 20)) ! printf("getla: symbol address = %#x\n", Nl[X_AVENRUN].n_value); if (lseek(kmem, (off_t) Nl[X_AVENRUN].n_value, SEEK_SET) == -1 || read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun)) { --- 1430,1437 ---- (void) fcntl(kmem, F_SETFD, 1); } if (tTd(3, 20)) ! printf("getla: symbol address = %#lx\n", ! (u_long) Nl[X_AVENRUN].n_value); if (lseek(kmem, (off_t) Nl[X_AVENRUN].n_value, SEEK_SET) == -1 || read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun)) { *************** *** 1884,1889 **** --- 1935,1971 ---- #endif /* LA_TYPE == LA_DEVSHORT */ + #if LA_TYPE == LA_ALPHAOSF + # include + + int getla() + { + int ave = 0; + struct tbl_loadavg tab; + + if (table(TBL_LOADAVG, 0, &tab, 1, sizeof(tab)) == -1) + { + if (tTd(3, 1)) + printf("getla: table %s\n", errstring(errno)); + return (-1); + } + + if (tTd(3, 1)) + printf("getla: scale = %d\n", tab.tl_lscale); + + if (tab.tl_lscale) + ave = (tab.tl_avenrun.l[0] + (tab.tl_lscale/2)) / tab.tl_lscale; + else + ave = (int) (tab.tl_avenrun.d[0] + 0.5); + + if (tTd(3, 1)) + printf("getla: %d\n", ave); + + return ave; + } + + #endif + #if LA_TYPE == LA_ZERO int *************** *** 2063,2068 **** --- 2145,2152 ---- if (MaxChildren > 0 && CurChildren >= MaxChildren) { + extern void proc_list_probe __P((void)); + proc_list_probe(); if (CurChildren >= MaxChildren) { *************** *** 2876,2882 **** static void dopr( buffer, format, args ) char *buffer; ! char *format; va_list args; { int ch; --- 2960,2966 ---- static void dopr( buffer, format, args ) char *buffer; ! const char *format; va_list args; { int ch; *************** *** 3848,3853 **** --- 3932,3942 ---- #ifdef SUN_EXTENSIONS sun_pre_defaults(e); #endif + #ifdef apollo + /* stupid domain/os can't even open /etc/sendmail.cf without this */ + setuserenv("ISP", NULL); + setuserenv("SYSTYPE", NULL); + #endif } *************** *** 3926,3931 **** --- 4015,4021 ---- int deny_severity = LOG_WARNING; #endif + #if DAEMON bool validate_connection(sap, hostname, e) SOCKADDR *sap; *************** *** 3941,3946 **** --- 4031,4038 ---- #endif return TRUE; } + + #endif /* ** STRTOL -- convert string to long integer ** *************** *** 4190,4203 **** --- 4282,4307 ---- sm_getpwnam(user) char *user; { + #ifdef _AIX4 + extern struct passwd *_getpwnam_shadow(const char *, const int); + + return _getpwnam_shadow(user, 0); + #else return getpwnam(user); + #endif } struct passwd * sm_getpwuid(uid) UID_T uid; { + #if defined(_AIX4) && 0 + extern struct passwd *_getpwuid_shadow(const int, const int); + + return _getpwuid_shadow(uid,0); + #else return getpwuid(uid); + #endif } /* ** SECUREWARE_SETUP_SECURE -- Convex SecureWare setup *************** *** 4616,4624 **** #endif #if HASSETVBUF "HASSETVBUF", - #endif - #if HASSIGSETMASK - "HASSIGSETMASK", #endif #if HASSNPRINTF "HASSNPRINTF", --- 4720,4725 ---- diff -c -r sendmail-8.8.3/src/conf.h sendmail-8.8.4/src/conf.h *** sendmail-8.8.3/src/conf.h Sat Nov 16 18:32:10 1996 --- sendmail-8.8.4/src/conf.h Sun Dec 1 15:56:07 1996 *************** *** 31,37 **** * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)conf.h 8.272 (Berkeley) 11/16/96 */ /* --- 31,37 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)conf.h 8.279 (Berkeley) 12/1/96 */ /* *************** *** 443,448 **** --- 443,449 ---- # undef WEXITSTATUS # undef HASUNAME # define setpgid setpgrp + # define MODE_T int typedef int pid_t; extern char *getenv(); *************** *** 476,481 **** --- 477,483 ---- # define HASINITGROUPS 1 /* has initgroups(3) call */ # define IP_SRCROUTE 0 /* does not have */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ + # define HASSNPRINTF 1 /* has snprintf(3) */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif *************** *** 574,580 **** # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif ! # define LA_TYPE LA_INT # define SFS_TYPE SFS_MOUNT /* use statfs() impl */ # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf" # ifndef _PATH_SENDMAILPID --- 576,582 ---- # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif ! # define LA_TYPE LA_ALPHAOSF # define SFS_TYPE SFS_MOUNT /* use statfs() impl */ # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf" # ifndef _PATH_SENDMAILPID *************** *** 1435,1441 **** # define HASUNAME 1 /* use System V uname(2) system call */ # define HASINITGROUPS 1 /* has initgroups(3) function */ # define HASSETVBUF 1 /* has setvbuf(3) function */ - # define HASSIGSETMASK 0 /* does not have sigsetmask(2) function */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ # endif --- 1437,1442 ---- *************** *** 1489,1494 **** --- 1490,1496 ---- # define setpgid setpgrp # undef WIFEXITED # undef WEXITSTATUS + # define MODE_T int /* system include files have no mode_t */ typedef int pid_t; typedef int (*sigfunc_t)(); # define SIGFUNC_DEFINED *************** *** 1842,1856 **** # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */ #endif - /* heuristic setting of HASSETSIGMASK; can override above */ - #ifndef HASSIGSETMASK - # ifdef SIGVTALRM - # define HASSETSIGMASK 1 - # else - # define HASSETSIGMASK 0 - # endif - #endif - /* ** If no type for argument two of getgroups call is defined, assume ** it's an integer -- unfortunately, there seem to be several choices --- 1844,1849 ---- *************** *** 1918,1923 **** --- 1911,1919 ---- /* pseudo-code used in server SMTP */ # define EX_QUIT 22 /* drop out of server immediately */ + /* pseudo-code used for mci_setstat */ + # define EX_NOTSTICKY -5 /* don't save persistent status */ + /* ** These are used in a few cases where we need some special *************** *** 1980,1988 **** */ #if NETINET || NETISO ! # define SMTP 1 /* enable user and server SMTP */ ! # define QUEUE 1 /* enable queueing */ ! # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ #endif --- 1976,1990 ---- */ #if NETINET || NETISO ! # ifndef SMTP ! # define SMTP 1 /* enable user and server SMTP */ ! # endif ! # ifndef QUEUE ! # define QUEUE 1 /* enable queueing */ ! # endif ! # ifndef DAEMON ! # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ ! # endif #endif diff -c -r sendmail-8.8.3/src/convtime.c sendmail-8.8.4/src/convtime.c *** sendmail-8.8.3/src/convtime.c Sun Sep 15 11:46:25 1996 --- sendmail-8.8.4/src/convtime.c Sun Nov 24 07:27:16 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)convtime.c 8.7 (Berkeley) 9/15/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)convtime.c 8.8 (Berkeley) 11/24/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 149,155 **** --- 149,158 ---- hr = intvl % 24; intvl /= 24; if (brief) + { dy = intvl; + wk = 0; + } else { dy = intvl % 7; diff -c -r sendmail-8.8.3/src/daemon.c sendmail-8.8.4/src/daemon.c *** sendmail-8.8.3/src/daemon.c Fri Nov 8 09:09:27 1996 --- sendmail-8.8.4/src/daemon.c Sun Dec 1 10:24:45 1996 *************** *** 37,64 **** #ifndef lint #ifdef DAEMON ! static char sccsid[] = "@(#)daemon.c 8.148 (Berkeley) 11/8/96 (with daemon mode)"; #else ! static char sccsid[] = "@(#)daemon.c 8.148 (Berkeley) 11/8/96 (without daemon mode)"; #endif #endif /* not lint */ ! #ifdef DAEMON ! # include ! ! #if NAMED_BIND ! # include ! # ifndef NO_DATA ! # define NO_DATA NO_ADDRESS # endif #endif ! #if IP_SRCROUTE ! # include ! # include ! # include ! #endif /* ** DAEMON.C -- routines to use when running as a daemon. --- 37,65 ---- #ifndef lint #ifdef DAEMON ! static char sccsid[] = "@(#)daemon.c 8.156 (Berkeley) 12/1/96 (with daemon mode)"; #else ! static char sccsid[] = "@(#)daemon.c 8.156 (Berkeley) 12/1/96 (without daemon mode)"; #endif #endif /* not lint */ ! #if DAEMON || defined(SOCK_STREAM) # include ! # if NAMED_BIND ! # include ! # ifndef NO_DATA ! # define NO_DATA NO_ADDRESS ! # endif # endif #endif ! #if DAEMON ! ! # if IP_SRCROUTE ! # include ! # include ! # include ! # endif /* ** DAEMON.C -- routines to use when running as a daemon. *************** *** 195,204 **** --- 196,208 ---- { register pid_t pid; auto int lotherend; + int savederrno; + int pipefd[2]; extern bool refuseconnections(); extern int getla(); /* see if we are rejecting connections */ + (void) blocksignal(SIGALRM); if (refuseconnections(ntohs(DaemonAddr.sin.sin_port))) { if (DaemonSocket >= 0) *************** *** 254,259 **** --- 258,264 ---- if (SetNonBlocking(DaemonSocket, FALSE) < 0) log an error here; #endif + (void) releasesignal(SIGALRM); do { errno = 0; *************** *** 261,268 **** --- 266,276 ---- t = accept(DaemonSocket, (struct sockaddr *)&RealHostAddr, &lotherend); } while (t < 0 && errno == EINTR); + savederrno = errno; + (void) blocksignal(SIGALRM); if (t < 0) { + errno = savederrno; syserr("getrequests: accept"); /* arrange to re-open the socket next time around */ *************** *** 280,289 **** --- 288,313 ---- if (tTd(15, 2)) printf("getrequests: forking (fd = %d)\n", t); + /* + ** Create a pipe to keep the child from writing to the + ** socket until after the parent has closed it. Otherwise + ** the parent may hang if the child has closed it first. + */ + + if (pipe(pipefd) < 0) + pipefd[0] = pipefd[1] = -1; + + blocksignal(SIGCHLD); pid = fork(); if (pid < 0) { syserr("daemon: cannot fork"); + if (pipefd[0] != -1) + { + (void) close(pipefd[0]); + (void) close(pipefd[1]); + } + (void) releasesignal(SIGCHLD); sleep(10); (void) close(t); continue; *************** *** 302,314 **** --- 326,366 ---- ** Verify calling user id if possible here. */ + (void) releasesignal(SIGALRM); + (void) releasesignal(SIGCHLD); (void) setsignal(SIGCHLD, SIG_DFL); (void) setsignal(SIGHUP, intsig); (void) close(DaemonSocket); + proc_list_clear(); + + /* don't schedule queue runs if we are told to ETRN */ + QueueIntvl = 0; setproctitle("startup with %s", anynet_ntoa(&RealHostAddr)); + if (pipefd[0] != -1) + { + auto char c; + + /* + ** Wait for the parent to close the write end + ** of the pipe, which we will see as an EOF. + ** This guarantees that we won't write to the + ** socket until after the parent has closed + ** the pipe. + */ + + /* close the write end of the pipe */ + (void) close(pipefd[1]); + + /* we shouldn't be interrupted, but ... */ + while (read(pipefd[0], &c, 1) < 0 && + errno == EINTR) + continue; + (void) close(pipefd[0]); + } + /* determine host name */ p = hostnamebyanyaddr(&RealHostAddr); if (strlen(p) > (SIZE_T) MAXNAME) *************** *** 350,358 **** --- 402,419 ---- /* parent -- keep track of children */ proc_list_add(pid); + (void) releasesignal(SIGCHLD); + + /* close the read end of the synchronization pipe */ + if (pipefd[0] != -1) + (void) close(pipefd[0]); /* close the port so that others will hang (for a while) */ (void) close(t); + + /* release the child by closing the read end of the sync pipe */ + if (pipefd[1] != -1) + (void) close(pipefd[1]); } if (tTd(15, 2)) printf("getreq: returning (null server)\n"); *************** *** 585,591 **** --- 646,654 ---- case 'P': /* port */ switch (DaemonAddr.sa.sa_family) { + #if NETISO short port; + #endif #if NETINET case AF_INET: *************** *** 683,696 **** register MCI *mci; ENVELOPE *e; { ! register int i = 0; ! register int s; ! register struct hostent *hp = (struct hostent *)NULL; SOCKADDR addr; int sav_errno; ! int addrlen; ! bool firstconnect; ! EVENT *ev; /* ** Set up the address for the mailer. --- 746,759 ---- register MCI *mci; ENVELOPE *e; { ! register volatile int i = 0; ! register volatile int s; ! register struct hostent *volatile hp = (struct hostent *)NULL; SOCKADDR addr; int sav_errno; ! volatile int addrlen; ! volatile bool firstconnect; ! EVENT *volatile ev = NULL; /* ** Set up the address for the mailer. *************** *** 1109,1115 **** int fd; { int falen; ! register char *p; SOCKADDR la; int lalen; register struct servent *sp; --- 1172,1178 ---- int fd; { int falen; ! register char *volatile p = NULL; SOCKADDR la; int lalen; register struct servent *sp; *************** *** 1545,1550 **** --- 1608,1701 ---- s->s_namecanon.nc_cname = newstr(cp); return cp; } + + # else /* DAEMON */ + /* code for systems without sophisticated networking */ + + /* + ** MYHOSTNAME -- stub version for case of no daemon code. + ** + ** Can't convert to upper case here because might be a UUCP name. + ** + ** Mark, you can change this to be anything you want...... + */ + + char ** + myhostname(hostbuf, size) + char hostbuf[]; + int size; + { + register FILE *f; + + hostbuf[0] = '\0'; + f = fopen("/usr/include/whoami", "r"); + if (f != NULL) + { + (void) fgets(hostbuf, size, f); + fixcrlf(hostbuf, TRUE); + (void) fclose(f); + } + return (NULL); + } + /* + ** GETAUTHINFO -- get the real host name asociated with a file descriptor + ** + ** Parameters: + ** fd -- the descriptor + ** + ** Returns: + ** The host name associated with this descriptor, if it can + ** be determined. + ** NULL otherwise. + ** + ** Side Effects: + ** none + */ + + char * + getauthinfo(fd) + int fd; + { + return NULL; + } + /* + ** MAPHOSTNAME -- turn a hostname into canonical form + ** + ** Parameters: + ** map -- a pointer to the database map. + ** name -- a buffer containing a hostname. + ** avp -- a pointer to a (cf file defined) argument vector. + ** statp -- an exit status (out parameter). + ** + ** Returns: + ** mapped host name + ** FALSE otherwise. + ** + ** Side Effects: + ** Looks up the host specified in name. If it is not + ** the canonical name for that host, replace it with + ** the canonical name. If the name is unknown, or it + ** is already the canonical name, leave it unchanged. + */ + + /*ARGSUSED*/ + char * + host_map_lookup(map, name, avp, statp) + MAP *map; + char *name; + char **avp; + char *statp; + { + register struct hostent *hp; + + hp = sm_gethostbyname(name); + if (hp != NULL) + return hp->h_name; + *statp = EX_NOHOST; + return NULL; + } + + #endif /* DAEMON */ /* ** ANYNET_NTOA -- convert a network address to printable form. ** *************** *** 1555,1560 **** --- 1706,1713 ---- ** A printable version of that sockaddr. */ + #ifdef SOCK_STREAM + #if NETLINK # include #endif *************** *** 1659,1667 **** --- 1812,1822 ---- break; #endif + #if NETUNIX case AF_UNIX: hp = NULL; break; + #endif default: hp = sm_gethostbyaddr(sap->sa.sa_data, *************** *** 1686,1775 **** } } ! # else /* DAEMON */ ! /* code for systems without sophisticated networking */ ! ! /* ! ** MYHOSTNAME -- stub version for case of no daemon code. ! ** ! ** Can't convert to upper case here because might be a UUCP name. ! ** ! ** Mark, you can change this to be anything you want...... ! */ ! ! char ** ! myhostname(hostbuf, size) ! char hostbuf[]; ! int size; ! { ! register FILE *f; ! ! hostbuf[0] = '\0'; ! f = fopen("/usr/include/whoami", "r"); ! if (f != NULL) ! { ! (void) fgets(hostbuf, size, f); ! fixcrlf(hostbuf, TRUE); ! (void) fclose(f); ! } ! return (NULL); ! } ! /* ! ** GETAUTHINFO -- get the real host name asociated with a file descriptor ! ** ! ** Parameters: ! ** fd -- the descriptor ! ** ! ** Returns: ! ** The host name associated with this descriptor, if it can ! ** be determined. ! ** NULL otherwise. ! ** ! ** Side Effects: ! ** none ! */ ! ! char * ! getauthinfo(fd) ! int fd; ! { ! return NULL; ! } ! /* ! ** MAPHOSTNAME -- turn a hostname into canonical form ! ** ! ** Parameters: ! ** map -- a pointer to the database map. ! ** name -- a buffer containing a hostname. ! ** avp -- a pointer to a (cf file defined) argument vector. ! ** statp -- an exit status (out parameter). ! ** ! ** Returns: ! ** mapped host name ! ** FALSE otherwise. ! ** ! ** Side Effects: ! ** Looks up the host specified in name. If it is not ! ** the canonical name for that host, replace it with ! ** the canonical name. If the name is unknown, or it ! ** is already the canonical name, leave it unchanged. ! */ ! ! /*ARGSUSED*/ ! char * ! host_map_lookup(map, name, avp, statp) ! MAP *map; ! char *name; ! char **avp; ! char *statp; ! { ! register struct hostent *hp; ! ! hp = sm_gethostbyname(name); ! if (hp != NULL) ! return hp->h_name; ! *statp = EX_NOHOST; ! return NULL; ! } ! ! #endif /* DAEMON */ --- 1841,1844 ---- } } ! #endif /* SOCK_STREAM */ diff -c -r sendmail-8.8.3/src/deliver.c sendmail-8.8.4/src/deliver.c *** sendmail-8.8.3/src/deliver.c Sat Nov 16 07:40:26 1996 --- sendmail-8.8.4/src/deliver.c Sun Dec 1 15:51:03 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)deliver.c 8.251 (Berkeley) 11/11/96"; #endif /* not lint */ #include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)deliver.c 8.260 (Berkeley) 12/1/96"; #endif /* not lint */ #include "sendmail.h" *************** *** 44,50 **** extern int h_errno; #endif ! #ifdef SMTP extern char SmtpError[]; #endif --- 44,50 ---- extern int h_errno; #endif ! #if SMTP extern char SmtpError[]; #endif *************** *** 131,137 **** if (e->e_hopcount > MaxHopCount) { errno = 0; ! #ifdef QUEUE queueup(e, mode == SM_QUEUE || mode == SM_DEFER); #endif e->e_flags |= EF_FATALERRS|EF_PM_NOTIFY|EF_CLRQUEUE; --- 131,137 ---- if (e->e_hopcount > MaxHopCount) { errno = 0; ! #if QUEUE queueup(e, mode == SM_QUEUE || mode == SM_DEFER); #endif e->e_flags |= EF_FATALERRS|EF_PM_NOTIFY|EF_CLRQUEUE; *************** *** 422,428 **** mode = SM_QUEUE; } ! # ifdef QUEUE if ((mode == SM_QUEUE || mode == SM_DEFER || mode == SM_FORK || (mode != SM_VERIFY && SuperSafe)) && (!bitset(EF_INQUEUE, e->e_flags) || splitenv != NULL)) --- 422,428 ---- mode = SM_QUEUE; } ! # if QUEUE if ((mode == SM_QUEUE || mode == SM_DEFER || mode == SM_FORK || (mode != SM_VERIFY && SuperSafe)) && (!bitset(EF_INQUEUE, e->e_flags) || splitenv != NULL)) *************** *** 609,615 **** bool didany; if (tTd(13, 10)) ! printf("sendenvelope(%s) e_flags=0x%x\n", e->e_id == NULL ? "[NOQUEUE]" : e->e_id, e->e_flags); #ifdef LOG --- 609,615 ---- bool didany; if (tTd(13, 10)) ! printf("sendenvelope(%s) e_flags=0x%lx\n", e->e_id == NULL ? "[NOQUEUE]" : e->e_id, e->e_flags); #ifdef LOG *************** *** 676,682 **** { extern int deliver __P((ENVELOPE *, ADDRESS *)); ! # ifdef QUEUE /* ** Checkpoint the send list every few addresses */ --- 676,682 ---- { extern int deliver __P((ENVELOPE *, ADDRESS *)); ! # if QUEUE /* ** Checkpoint the send list every few addresses */ *************** *** 847,853 **** host = to->q_host; CurEnv = e; /* just in case */ e->e_statmsg = NULL; ! #ifdef SMTP SmtpError[0] = '\0'; #endif xstart = curtime(); --- 847,853 ---- host = to->q_host; CurEnv = e; /* just in case */ e->e_statmsg = NULL; ! #if SMTP SmtpError[0] = '\0'; #endif xstart = curtime(); *************** *** 939,945 **** if (*mvp == NULL) { /* running SMTP */ ! # ifdef SMTP clever = TRUE; *pvp = NULL; # else /* SMTP */ --- 939,945 ---- if (*mvp == NULL) { /* running SMTP */ ! # if SMTP clever = TRUE; *pvp = NULL; # else /* SMTP */ *************** *** 1231,1237 **** else if (strcmp(m->m_mailer, "[IPC]") == 0 || strcmp(m->m_mailer, "[TCP]") == 0) { ! #ifdef DAEMON register int i; if (pv[0] == NULL || pv[1] == NULL || pv[1][0] == '\0') --- 1231,1237 ---- else if (strcmp(m->m_mailer, "[IPC]") == 0 || strcmp(m->m_mailer, "[TCP]") == 0) { ! #if DAEMON register int i; if (pv[0] == NULL || pv[1] == NULL || pv[1][0] == '\0') *************** *** 1340,1346 **** mci_cache(mci); if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%05d === CONNECT %s\n", ! getpid(), hostbuf); break; } else --- 1340,1346 ---- mci_cache(mci); if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%05d === CONNECT %s\n", ! (int) getpid(), hostbuf); break; } else *************** *** 1385,1391 **** { char **av; ! fprintf(TrafficLogFile, "%05d === EXEC", getpid()); for (av = pv; *av != NULL; av++) fprintf(TrafficLogFile, " %s", *av); fprintf(TrafficLogFile, "\n"); --- 1385,1391 ---- { char **av; ! fprintf(TrafficLogFile, "%05d === EXEC", (int) getpid()); for (av = pv; *av != NULL; av++) fprintf(TrafficLogFile, " %s", *av); fprintf(TrafficLogFile, "\n"); *************** *** 1440,1446 **** #endif /* if this mailer speaks smtp, create a return pipe */ ! #ifdef SMTP if (clever) { if (pipe(rpvect) < 0) --- 1440,1446 ---- #endif /* if this mailer speaks smtp, create a return pipe */ ! #if SMTP if (clever) { if (pipe(rpvect) < 0) *************** *** 1484,1490 **** shortenstring(e->e_to, 203), m->m_name); (void) close(mpvect[0]); (void) close(mpvect[1]); ! #ifdef SMTP if (clever) { (void) close(rpvect[0]); --- 1484,1490 ---- shortenstring(e->e_to, 203), m->m_name); (void) close(mpvect[0]); (void) close(mpvect[1]); ! #if SMTP if (clever) { (void) close(rpvect[0]); *************** *** 1575,1587 **** new_ruid = stb.st_uid; else if (ctladdr != NULL && ctladdr->q_uid != 0) new_ruid = ctladdr->q_uid; ! else ! { ! if (m->m_uid == 0) ! new_ruid = DefUid; ! else ! new_ruid = m->m_uid; ! } if (new_euid != NO_UID) { vendor_set_uid(new_euid); --- 1575,1584 ---- new_ruid = stb.st_uid; else if (ctladdr != NULL && ctladdr->q_uid != 0) new_ruid = ctladdr->q_uid; ! else if (m->m_uid != 0) ! new_ruid = m->m_uid; ! else if (!bitnset(M_SPECIFIC_UID, m->m_flags)) ! new_ruid = DefUid; if (new_euid != NO_UID) { vendor_set_uid(new_euid); *************** *** 1611,1617 **** if (tTd(11, 2)) printf("openmailer: running as r/euid=%d/%d\n", ! getuid(), geteuid()); /* move into some "safe" directory */ if (m->m_execdir != NULL) --- 1608,1614 ---- if (tTd(11, 2)) printf("openmailer: running as r/euid=%d/%d\n", ! (int) getuid(), (int) geteuid()); /* move into some "safe" directory */ if (m->m_execdir != NULL) *************** *** 1636,1642 **** } /* arrange to filter std & diag output of command */ ! #ifdef SMTP if (clever) { (void) close(rpvect[0]); --- 1633,1639 ---- } /* arrange to filter std & diag output of command */ ! #if SMTP if (clever) { (void) close(rpvect[0]); *************** *** 1718,1724 **** syserr("deliver: cannot create mailer output channel, fd=%d", mpvect[1]); (void) close(mpvect[1]); ! #ifdef SMTP if (clever) { (void) close(rpvect[0]); --- 1715,1721 ---- syserr("deliver: cannot create mailer output channel, fd=%d", mpvect[1]); (void) close(mpvect[1]); ! #if SMTP if (clever) { (void) close(rpvect[0]); *************** *** 1728,1734 **** rcode = EX_OSERR; goto give_up; } ! #ifdef SMTP if (clever) { (void) close(rpvect[1]); --- 1725,1731 ---- rcode = EX_OSERR; goto give_up; } ! #if SMTP if (clever) { (void) close(rpvect[1]); *************** *** 1757,1765 **** */ if (bitnset(M_7BITS, m->m_flags) && ! (!clever || mci->mci_state == MCIS_CLOSED)) mci->mci_flags |= MCIF_7BIT; ! #ifdef SMTP if (clever && mci->mci_state != MCIS_CLOSED) { extern void smtpinit __P((MAILER *, MCI *, ENVELOPE *)); --- 1754,1762 ---- */ if (bitnset(M_7BITS, m->m_flags) && ! (!clever || mci->mci_state == MCIS_OPENING)) mci->mci_flags |= MCIF_7BIT; ! #if SMTP if (clever && mci->mci_state != MCIS_CLOSED) { extern void smtpinit __P((MAILER *, MCI *, ENVELOPE *)); *************** *** 1814,1820 **** mci_dump_all(TRUE); rcode = EX_SOFTWARE; } ! #ifdef DAEMON else if (curhost != NULL && *curhost != '\0') { /* try next MX site */ --- 1811,1817 ---- mci_dump_all(TRUE); rcode = EX_SOFTWARE; } ! #if DAEMON else if (curhost != NULL && *curhost != '\0') { /* try next MX site */ *************** *** 1836,1842 **** rcode = endmailer(mci, e, pv); } else ! #ifdef SMTP { extern int smtpmailfrom __P((MAILER *, MCI *, ENVELOPE *)); extern int smtprcpt __P((ADDRESS *, MAILER *, MCI *, ENVELOPE *)); --- 1833,1839 ---- rcode = endmailer(mci, e, pv); } else ! #if SMTP { extern int smtpmailfrom __P((MAILER *, MCI *, ENVELOPE *)); extern int smtprcpt __P((ADDRESS *, MAILER *, MCI *, ENVELOPE *)); *************** *** 1886,1896 **** --- 1883,1895 ---- rcode = smtpdata(m, mci, e); } } + # if DAEMON if (rcode == EX_TEMPFAIL && curhost != NULL && *curhost != '\0') { /* try next MX site */ goto tryhost; } + # endif } #else /* not SMTP */ { *************** *** 1915,1922 **** */ give_up: ! #ifdef SMTP ! # if FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) { tobuf[0] = '\0'; --- 1914,1921 ---- */ give_up: ! #if SMTP ! # if _FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) { tobuf[0] = '\0'; *************** *** 1933,1940 **** if (bitset(QBADADDR|QQUEUEUP, to->q_flags)) continue; ! #ifdef SMTP ! # if FFR_LMTP /* if running LMTP, get the status for each address */ if (bitnset(M_LMTP, m->m_flags)) { --- 1932,1939 ---- if (bitset(QBADADDR|QQUEUEUP, to->q_flags)) continue; ! #if SMTP ! # if _FFR_LMTP /* if running LMTP, get the status for each address */ if (bitnset(M_LMTP, m->m_flags)) { *************** *** 1988,1995 **** } } ! #ifdef SMTP ! # if FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) { /* --- 1987,1994 ---- } } ! #if SMTP ! # if _FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) { /* *************** *** 2013,2019 **** markstats(e, tochain); mci_store_persistent(mci); ! #ifdef SMTP /* now close the connection */ if (clever && mci->mci_state != MCIS_CLOSED && !bitset(MCIF_CACHED, mci->mci_flags)) --- 2012,2018 ---- markstats(e, tochain); mci_store_persistent(mci); ! #if SMTP /* now close the connection */ if (clever && mci->mci_state != MCIS_CLOSED && !bitset(MCIF_CACHED, mci->mci_flags)) *************** *** 2196,2202 **** if (mci->mci_pid == 0) return (EX_OK); ! #ifdef FFR_TIMEOUT_WAIT put a timeout around the wait #endif --- 2195,2201 ---- if (mci->mci_pid == 0) return (EX_OK); ! #ifdef _FFR_TIMEOUT_WAIT put a timeout around the wait #endif *************** *** 2309,2315 **** statmsg = errstring(errno); else { ! #ifdef SMTP statmsg = SmtpError; #else /* SMTP */ statmsg = NULL; --- 2308,2314 ---- statmsg = errstring(errno); else { ! #if SMTP statmsg = SmtpError; #else /* SMTP */ statmsg = NULL; *************** *** 2465,2471 **** /* relay: max 66 bytes for IPv4 addresses */ if (mci != NULL && mci->mci_host != NULL) { ! # ifdef DAEMON extern SOCKADDR CurHostAddr; # endif --- 2464,2470 ---- /* relay: max 66 bytes for IPv4 addresses */ if (mci != NULL && mci->mci_host != NULL) { ! # if DAEMON extern SOCKADDR CurHostAddr; # endif *************** *** 2473,2479 **** shortenstring(mci->mci_host, 40)); bp += strlen(bp); ! # ifdef DAEMON if (CurHostAddr.sa.sa_family != 0) { snprintf(bp, SPACELEFT(buf, bp), " [%s]", --- 2472,2478 ---- shortenstring(mci->mci_host, 40)); bp += strlen(bp); ! # if DAEMON if (CurHostAddr.sa.sa_family != 0) { snprintf(bp, SPACELEFT(buf, bp), " [%s]", *************** *** 2584,2597 **** bp = buf; if (mci != NULL && mci->mci_host != NULL) { ! # ifdef DAEMON extern SOCKADDR CurHostAddr; # endif snprintf(bp, SPACELEFT(buf, bp), "relay=%.100s", mci->mci_host); bp += strlen(bp); ! # ifdef DAEMON if (CurHostAddr.sa.sa_family != 0) snprintf(bp, SPACELEFT(buf, bp), " [%.100s]", anynet_ntoa(&CurHostAddr)); --- 2583,2596 ---- bp = buf; if (mci != NULL && mci->mci_host != NULL) { ! # if DAEMON extern SOCKADDR CurHostAddr; # endif snprintf(bp, SPACELEFT(buf, bp), "relay=%.100s", mci->mci_host); bp += strlen(bp); ! # if DAEMON if (CurHostAddr.sa.sa_family != 0) snprintf(bp, SPACELEFT(buf, bp), " [%.100s]", anynet_ntoa(&CurHostAddr)); *************** *** 2787,2792 **** --- 2786,2792 ---- register char *bp; register char *pbp; register int c; + register char *xp; int padc; char *buflim; int pos = 0; *************** *** 2811,2818 **** pbp = peekbuf; while (!ferror(mci->mci_out)) { - register char *xp; - if (pbp > peekbuf) c = *--pbp; else if ((c = getc(e->e_dfp)) == EOF) --- 2811,2816 ---- *************** *** 2822,2827 **** --- 2820,2830 ---- switch (ostate) { case OS_HEAD: + #ifdef _FFR_NONULLS + if (c == '\0' && + bitnset(M_NONULLS, mci->mci_mailer->m_flags)) + break; + #endif if (c != '\r' && c != '\n' && bp < buflim) { *bp++ = c; *************** *** 2856,2862 **** /* now copy out saved line */ if (TrafficLogFile != NULL) { ! fprintf(TrafficLogFile, "%05d >>> ", getpid()); if (padc != EOF) putc(padc, TrafficLogFile); for (xp = buf; xp < bp; xp++) --- 2859,2866 ---- /* now copy out saved line */ if (TrafficLogFile != NULL) { ! fprintf(TrafficLogFile, "%05d >>> ", ! (int) getpid()); if (padc != EOF) putc(padc, TrafficLogFile); for (xp = buf; xp < bp; xp++) *************** *** 2921,2926 **** --- 2925,2935 ---- ostate = OS_CR; continue; } + #ifdef _FFR_NONULLS + if (c == '\0' && + bitnset(M_NONULLS, mci->mci_mailer->m_flags)) + break; + #endif putch: if (mci->mci_mailer->m_linelimit > 0 && pos > mci->mci_mailer->m_linelimit && *************** *** 2937,2947 **** *pbp++ = c; continue; } ! if (TrafficLogFile != NULL) ! putc(c, TrafficLogFile); ! putc(c, mci->mci_out); ! pos++; ! ostate = c == '\n' ? OS_HEAD : OS_INLINE; break; } } --- 2946,2968 ---- *pbp++ = c; continue; } ! if (c == '\n') ! { ! if (TrafficLogFile != NULL) ! fputs(mci->mci_mailer->m_eol, ! TrafficLogFile); ! fputs(mci->mci_mailer->m_eol, mci->mci_out); ! pos = 0; ! ostate = OS_HEAD; ! } ! else ! { ! if (TrafficLogFile != NULL) ! putc(c, TrafficLogFile); ! putc(c, mci->mci_out); ! pos++; ! ostate = OS_INLINE; ! } break; } } *************** *** 2949,2960 **** /* make sure we are at the beginning of a line */ if (bp > buf) { ! *bp = '\0'; ! fputs(buf, mci->mci_out); pos += bp - buf; } if (pos > 0) fputs(mci->mci_mailer->m_eol, mci->mci_out); } if (ferror(e->e_dfp)) --- 2970,2990 ---- /* make sure we are at the beginning of a line */ if (bp > buf) { ! if (TrafficLogFile != NULL) ! { ! for (xp = buf; xp < bp; xp++) ! putc(*xp, TrafficLogFile); ! } ! for (xp = buf; xp < bp; xp++) ! putc(*xp, mci->mci_out); pos += bp - buf; } if (pos > 0) + { + if (TrafficLogFile != NULL) + fputs(mci->mci_mailer->m_eol, TrafficLogFile); fputs(mci->mci_mailer->m_eol, mci->mci_out); + } } if (ferror(e->e_dfp)) diff -c -r sendmail-8.8.3/src/envelope.c sendmail-8.8.4/src/envelope.c *** sendmail-8.8.3/src/envelope.c Mon Nov 11 09:34:08 1996 --- sendmail-8.8.4/src/envelope.c Sun Dec 1 10:47:02 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)envelope.c 8.96 (Berkeley) 11/11/96"; #endif /* not lint */ #include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)envelope.c 8.99 (Berkeley) 12/1/96"; #endif /* not lint */ #include "sendmail.h" *************** *** 110,116 **** { extern void printenvflags(); ! printf("dropenvelope %x: id=", e); xputs(e->e_id); printf(", flags="); printenvflags(e); --- 110,116 ---- { extern void printenvflags(); ! printf("dropenvelope %lx: id=", (u_long) e); xputs(e->e_id); printf(", flags="); printenvflags(e); *************** *** 168,175 **** queueit = TRUE; #if XDEBUG else if (bitset(QQUEUEUP, q->q_flags)) ! syslog(LOG_DEBUG, "%s: q_flags = %x", ! e->e_id, q->q_flags); #endif /* see if a notification is needed */ --- 168,175 ---- queueit = TRUE; #if XDEBUG else if (bitset(QQUEUEUP, q->q_flags)) ! syslog(LOG_DEBUG, "dropenvelope: %s: q_flags = %x, paddr = %s", ! e->e_id, q->q_flags, q->q_paddr); #endif /* see if a notification is needed */ *************** *** 349,355 **** } else if (queueit || !bitset(EF_INQUEUE, e->e_flags)) { ! #ifdef QUEUE queueup(e, FALSE); #else /* QUEUE */ syserr("554 dropenvelope: queueup"); --- 349,355 ---- } else if (queueit || !bitset(EF_INQUEUE, e->e_flags)) { ! #if QUEUE queueup(e, FALSE); #else /* QUEUE */ syserr("554 dropenvelope: queueup"); diff -c -r sendmail-8.8.3/src/err.c sendmail-8.8.4/src/err.c *** sendmail-8.8.3/src/err.c Wed Oct 9 12:35:51 1996 --- sendmail-8.8.4/src/err.c Sun Dec 1 10:47:02 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)err.c 8.50 (Berkeley) 9/20/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)err.c 8.52 (Berkeley) 12/1/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 432,438 **** else fprintf(OutChannel, "%s\n", &msg[4]); if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(), (OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]); if (msg[3] == ' ') (void) fflush(OutChannel); --- 432,438 ---- else fprintf(OutChannel, "%s\n", &msg[4]); if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> %s\n", (int) getpid(), (OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]); if (msg[3] == ' ') (void) fflush(OutChannel); *************** *** 631,637 **** extern char *sys_errlist[]; extern int sys_nerr; # endif ! # ifdef SMTP extern char *SmtpPhase; # endif /* SMTP */ --- 631,637 ---- extern char *sys_errlist[]; extern int sys_nerr; # endif ! # if SMTP extern char *SmtpPhase; # endif /* SMTP */ diff -c -r sendmail-8.8.3/src/headers.c sendmail-8.8.4/src/headers.c *** sendmail-8.8.3/src/headers.c Sat Sep 21 17:24:09 1996 --- sendmail-8.8.4/src/headers.c Sun Nov 24 14:06:56 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)headers.c 8.100 (Berkeley) 9/15/96"; #endif /* not lint */ # include --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)headers.c 8.101 (Berkeley) 11/23/96"; #endif /* not lint */ # include *************** *** 1267,1274 **** --- 1267,1280 ---- { register char *nlp; register char *obp; + int putflags; char obuf[MAXLINE]; + putflags = 0; + #ifdef _FFR_7BITHDRS + if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags)) + putflags |= PXLF_STRIP8BIT; + #endif (void) snprintf(obuf, sizeof obuf, "%.200s: ", h->h_field); obp = obuf + strlen(obuf); while ((nlp = strchr(v, '\n')) != NULL) *************** *** 1280,1286 **** l = sizeof obuf - (obp - obuf); snprintf(obp, SPACELEFT(obuf, obp), "%.*s", l, v); ! putline(obuf, mci); v += l + 1; obp = obuf; if (*v != ' ' && *v != '\t') --- 1286,1292 ---- l = sizeof obuf - (obp - obuf); snprintf(obp, SPACELEFT(obuf, obp), "%.*s", l, v); ! putxline(obuf, mci, putflags); v += l + 1; obp = obuf; if (*v != ' ' && *v != '\t') *************** *** 1288,1294 **** } snprintf(obp, SPACELEFT(obuf, obp), "%.*s", sizeof obuf - (obp - obuf) - 1, v); ! putline(obuf, mci); } /* ** COMMAIZE -- output a header field, making a comma-translated list. --- 1294,1300 ---- } snprintf(obp, SPACELEFT(obuf, obp), "%.*s", sizeof obuf - (obp - obuf) - 1, v); ! putxline(obuf, mci, putflags); } /* ** COMMAIZE -- output a header field, making a comma-translated list. *************** *** 1319,1324 **** --- 1325,1331 ---- int opos; int omax; bool firstone = TRUE; + int putflags = 0; char obuf[MAXLINE + 3]; /* *************** *** 1329,1334 **** --- 1336,1346 ---- if (tTd(14, 2)) printf("commaize(%s: %s)\n", h->h_field, p); + #ifdef _FFR_7BITHDRS + if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags)) + putflags |= PXLF_STRIP8BIT; + #endif + obp = obuf; (void) snprintf(obp, SPACELEFT(obuf, obp), "%.200s: ", h->h_field); opos = strlen(h->h_field) + 2; *************** *** 1425,1431 **** if (opos > omax && !firstone) { snprintf(obp, SPACELEFT(obuf, obp), ",\n"); ! putline(obuf, mci); obp = obuf; (void) strcpy(obp, " "); opos = strlen(obp); --- 1437,1443 ---- if (opos > omax && !firstone) { snprintf(obp, SPACELEFT(obuf, obp), ",\n"); ! putxline(obuf, mci, putflags); obp = obuf; (void) strcpy(obp, " "); opos = strlen(obp); *************** *** 1444,1450 **** *p = savechar; } *obp = '\0'; ! putline(obuf, mci); } /* ** COPYHEADER -- copy header list --- 1456,1462 ---- *p = savechar; } *obp = '\0'; ! putxline(obuf, mci, putflags); } /* ** COPYHEADER -- copy header list Only in sendmail-8.8.3/src: mailq.0 diff -c -r sendmail-8.8.3/src/main.c sendmail-8.8.4/src/main.c *** sendmail-8.8.3/src/main.c Sat Nov 16 10:34:25 1996 --- sendmail-8.8.4/src/main.c Sun Dec 1 10:47:01 1996 *************** *** 39,45 **** #endif /* not lint */ #ifndef lint ! static char sccsid[] = "@(#)main.c 8.215 (Berkeley) 11/16/96"; #endif /* not lint */ #define _DEFINE --- 39,45 ---- #endif /* not lint */ #ifndef lint ! static char sccsid[] = "@(#)main.c 8.223 (Berkeley) 12/1/96"; #endif /* not lint */ #define _DEFINE *************** *** 103,113 **** extern void printmailer __P((MAILER *)); extern void tTflag __P((char *)); ! #ifdef DAEMON ! #ifndef SMTP ! ERROR %%%% Cannot have daemon mode without SMTP %%%% ERROR ! #endif /* SMTP */ ! #endif /* DAEMON */ #define MAXCONFIGLEVEL 7 /* highest config version level known */ --- 103,114 ---- extern void printmailer __P((MAILER *)); extern void tTflag __P((char *)); ! #if DAEMON && !SMTP ! ERROR %%%% Cannot have DAEMON mode without SMTP %%%% ERROR ! #endif /* DAEMON && !SMTP */ ! #if SMTP && !QUEUE ! ERROR %%%% Cannot have SMTP mode without QUEUE %%%% ERROR ! #endif /* DAEMON && !SMTP */ #define MAXCONFIGLEVEL 7 /* highest config version level known */ *************** *** 134,140 **** struct passwd *pw; struct stat stb; struct hostent *hp; ! bool nullserver; char jbuf[MAXHOSTNAMELEN]; /* holds MyHostName */ static char rnamebuf[MAXNAME]; /* holds RealUserName */ char *emptyenviron[1]; --- 135,141 ---- struct passwd *pw; struct stat stb; struct hostent *hp; ! bool nullserver = FALSE; char jbuf[MAXHOSTNAMELEN]; /* holds MyHostName */ static char rnamebuf[MAXNAME]; /* holds RealUserName */ char *emptyenviron[1]; *************** *** 519,531 **** { case MD_DAEMON: case MD_FGDAEMON: ! # ifndef DAEMON usrerr("Daemon mode not implemented"); ExitStat = EX_USAGE; break; # endif /* DAEMON */ case MD_SMTP: ! # ifndef SMTP usrerr("I don't speak SMTP"); ExitStat = EX_USAGE; break; --- 520,532 ---- { case MD_DAEMON: case MD_FGDAEMON: ! # if !DAEMON usrerr("Daemon mode not implemented"); ExitStat = EX_USAGE; break; # endif /* DAEMON */ case MD_SMTP: ! # if !SMTP usrerr("I don't speak SMTP"); ExitStat = EX_USAGE; break; *************** *** 653,659 **** break; case 'q': /* run queue files at intervals */ ! # ifdef QUEUE FullName = NULL; queuemode = TRUE; switch (optarg[0]) --- 654,660 ---- break; case 'q': /* run queue files at intervals */ ! # if QUEUE FullName = NULL; queuemode = TRUE; switch (optarg[0]) *************** *** 949,955 **** default: /* arrange to exit cleanly on hangup signal */ ! setsignal(SIGHUP, intsig); break; } --- 950,957 ---- default: /* arrange to exit cleanly on hangup signal */ ! if (setsignal(SIGHUP, SIG_IGN) == (sigfunc_t) SIG_DFL) ! setsignal(SIGHUP, intsig); break; } *************** *** 1046,1055 **** setbitn(M_RUNASRCPT, ProgMailer->m_flags); if (FileMailer != NULL) setbitn(M_RUNASRCPT, FileMailer->m_flags); - - /* propogate some envariables into children */ - setuserenv("ISP", NULL); - setuserenv("SYSTYPE", NULL); } if (ConfigLevel < 7) { --- 1048,1053 ---- *************** *** 1104,1110 **** HostStatDir = NULL; } ! # ifdef QUEUE if (queuemode && RealUid != 0 && bitset(PRIV_RESTRICTQRUN, PrivacyFlags)) { struct stat stbuf; --- 1102,1108 ---- HostStatDir = NULL; } ! # if QUEUE if (queuemode && RealUid != 0 && bitset(PRIV_RESTRICTQRUN, PrivacyFlags)) { struct stat stbuf; *************** *** 1141,1147 **** { case MD_PRINT: /* print the queue */ ! #ifdef QUEUE dropenvelope(CurEnv, TRUE); printqueue(); endpwent(); --- 1139,1145 ---- { case MD_PRINT: /* print the queue */ ! #if QUEUE dropenvelope(CurEnv, TRUE); printqueue(); endpwent(); *************** *** 1247,1253 **** } } ! # ifdef QUEUE /* ** If collecting stuff from the queue, go start doing that. */ --- 1245,1251 ---- } } ! # if QUEUE /* ** If collecting stuff from the queue, go start doing that. */ *************** *** 1255,1261 **** if (queuemode && OpMode != MD_DAEMON && QueueIntvl == 0) { (void) unsetenv("HOSTALIASES"); ! runqueue(FALSE); finis(); } # endif /* QUEUE */ --- 1253,1259 ---- if (queuemode && OpMode != MD_DAEMON && QueueIntvl == 0) { (void) unsetenv("HOSTALIASES"); ! (void) runqueue(FALSE, Verbose); finis(); } # endif /* QUEUE */ *************** *** 1305,1314 **** xla_create_file(); #endif ! # ifdef QUEUE if (queuemode) { ! runqueue(TRUE); if (OpMode != MD_DAEMON) for (;;) pause(); --- 1303,1312 ---- xla_create_file(); #endif ! # if QUEUE if (queuemode) { ! (void) runqueue(TRUE, FALSE); if (OpMode != MD_DAEMON) for (;;) pause(); *************** *** 1316,1322 **** # endif /* QUEUE */ dropenvelope(CurEnv, TRUE); ! #ifdef DAEMON nullserver = getrequests(CurEnv); /* drop privileges */ --- 1314,1320 ---- # endif /* QUEUE */ dropenvelope(CurEnv, TRUE); ! #if DAEMON nullserver = getrequests(CurEnv); /* drop privileges */ *************** *** 1337,1343 **** #endif /* DAEMON */ } ! # ifdef SMTP /* ** If running SMTP protocol, start collecting and executing ** commands. This will never return. --- 1335,1341 ---- #endif /* DAEMON */ } ! # if SMTP /* ** If running SMTP protocol, start collecting and executing ** commands. This will never return. *************** *** 1651,1658 **** int fd; if (tTd(52, 1)) ! printf("disconnect: In %d Out %d, e=%x\n", ! fileno(InChannel), fileno(OutChannel), e); if (tTd(52, 100)) { printf("don't\n"); --- 1649,1656 ---- int fd; if (tTd(52, 1)) ! printf("disconnect: In %d Out %d, e=%lx\n", ! fileno(InChannel), fileno(OutChannel), (u_long) e); if (tTd(52, 100)) { printf("don't\n"); *************** *** 1956,1961 **** --- 1954,1967 ---- void sighup() { + if (SaveArgv[0][0] != '/') + { + #ifdef LOG + if (LogLevel > 3) + syslog(LOG_INFO, "could not restart: need full path"); + #endif + exit(EX_OSFILE); + } #ifdef LOG if (LogLevel > 3) syslog(LOG_INFO, "restarting %s on signal", SaveArgv[0]); diff -c -r sendmail-8.8.3/src/map.c sendmail-8.8.4/src/map.c *** sendmail-8.8.3/src/map.c Sat Nov 16 18:32:45 1996 --- sendmail-8.8.4/src/map.c Sun Nov 24 07:27:26 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)map.c 8.144 (Berkeley) 11/16/96"; #endif /* not lint */ #include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)map.c 8.146 (Berkeley) 11/24/96"; #endif /* not lint */ #include "sendmail.h" *************** *** 1323,1329 **** data.size = data.size + old.size + 1; data.data = buf; if (tTd(38, 9)) ! printf("db_map_store append=%s\n", data.data); } } stat = db->put(db, &key, &data, 0); --- 1323,1330 ---- data.size = data.size + old.size + 1; data.data = buf; if (tTd(38, 9)) ! printf("db_map_store append=%s\n", ! (char *) data.data); } } stat = db->put(db, &key, &data, 0); *************** *** 1344,1350 **** register DB *db = map->map_db2; if (tTd(38, 9)) ! printf("db_map_close(%s, %s, %x)\n", map->map_mname, map->map_file, map->map_mflags); if (bitset(MF_WRITABLE, map->map_mflags)) --- 1345,1351 ---- register DB *db = map->map_db2; if (tTd(38, 9)) ! printf("db_map_close(%s, %s, %lx)\n", map->map_mname, map->map_file, map->map_mflags); if (bitset(MF_WRITABLE, map->map_mflags)) *************** *** 3406,3412 **** MAP *map; { if (tTd(38, 9)) ! printf("impl_map_close(%s, %s, %x)\n", map->map_mname, map->map_file, map->map_mflags); #ifdef NEWDB if (bitset(MF_IMPL_HASH, map->map_mflags)) --- 3407,3413 ---- MAP *map; { if (tTd(38, 9)) ! printf("impl_map_close(%s, %s, %lx)\n", map->map_mname, map->map_file, map->map_mflags); #ifdef NEWDB if (bitset(MF_IMPL_HASH, map->map_mflags)) *************** *** 3598,3603 **** --- 3599,3605 ---- printf(" %s", argv[i]); printf("\n"); } + (void) blocksignal(SIGCHLD); pid = prog_open(argv, &fd, CurEnv); if (pid < 0) { *************** *** 3646,3651 **** --- 3648,3654 ---- /* wait for the process to terminate */ close(fd); stat = waitfor(pid); + (void) releasesignal(SIGCHLD); if (stat == -1) { diff -c -r sendmail-8.8.3/src/mci.c sendmail-8.8.4/src/mci.c *** sendmail-8.8.3/src/mci.c Sun Nov 3 15:23:30 1996 --- sendmail-8.8.4/src/mci.c Sun Dec 1 10:47:05 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)mci.c 8.46 (Berkeley) 11/3/96"; #endif /* not lint */ #include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)mci.c 8.54 (Berkeley) 12/1/96"; #endif /* not lint */ #include "sendmail.h" *************** *** 114,121 **** mci_uncache(mcislot, TRUE); if (tTd(42, 5)) ! printf("mci_cache: caching %x (%s) in slot %d\n", ! mci, mci->mci_host, mcislot - MciCache); #ifdef LOG if (tTd(91, 100)) syslog(LOG_DEBUG, "%s: mci_cache: caching %x (%.100s) in slot %d", --- 114,121 ---- mci_uncache(mcislot, TRUE); if (tTd(42, 5)) ! printf("mci_cache: caching %lx (%s) in slot %d\n", ! (u_long) mci, mci->mci_host, mcislot - MciCache); #ifdef LOG if (tTd(91, 100)) syslog(LOG_DEBUG, "%s: mci_cache: caching %x (%.100s) in slot %d", *************** *** 214,221 **** mci_unlock_host(mci); if (tTd(42, 5)) ! printf("mci_uncache: uncaching %x (%s) from slot %d (%d)\n", ! mci, mci->mci_host, mcislot - MciCache, doquit); #ifdef LOG if (tTd(91, 100)) syslog(LOG_DEBUG, "%s: mci_uncache: uncaching %x (%.100s) from slot %d (%d)", --- 214,221 ---- mci_unlock_host(mci); if (tTd(42, 5)) ! printf("mci_uncache: uncaching %lx (%s) from slot %d (%d)\n", ! (u_long) mci, mci->mci_host, mcislot - MciCache, doquit); #ifdef LOG if (tTd(91, 100)) syslog(LOG_DEBUG, "%s: mci_uncache: uncaching %x (%.100s) from slot %d (%d)", *************** *** 223,229 **** mci, mci->mci_host, mcislot - MciCache, doquit); #endif ! #ifdef SMTP if (doquit) { message("Closing connection to %s", mci->mci_host); --- 223,229 ---- mci, mci->mci_host, mcislot - MciCache, doquit); #endif ! #if SMTP if (doquit) { message("Closing connection to %s", mci->mci_host); *************** *** 289,295 **** register MCI *mci; register STAB *s; ! #ifdef DAEMON extern SOCKADDR CurHostAddr; /* clear CurHostAddr so we don't get a bogus address with this name */ --- 289,295 ---- register MCI *mci; register STAB *s; ! #if DAEMON extern SOCKADDR CurHostAddr; /* clear CurHostAddr so we don't get a bogus address with this name */ *************** *** 314,320 **** mci->mci_exitstat, mci->mci_errno); } ! #ifdef SMTP if (mci->mci_state == MCIS_OPEN) { extern int smtpprobe __P((MCI *)); --- 314,320 ---- mci->mci_exitstat, mci->mci_errno); } ! #if SMTP if (mci->mci_state == MCIS_OPEN) { extern int smtpprobe __P((MCI *)); *************** *** 329,335 **** mci->mci_exitstat = EX_OK; mci->mci_state = MCIS_CLOSED; } ! # ifdef DAEMON else { /* get peer host address for logging reasons only */ --- 329,335 ---- mci->mci_exitstat = EX_OK; mci->mci_state = MCIS_CLOSED; } ! # if DAEMON else { /* get peer host address for logging reasons only */ *************** *** 377,383 **** char *dstat; char *rstat; { ! mci->mci_exitstat = xstat; mci->mci_status = dstat; if (mci->mci_rstatus != NULL) free(mci->mci_rstatus); --- 377,386 ---- char *dstat; char *rstat; { ! /* protocol errors should never be interpreted as sticky */ ! if (xstat != EX_NOTSTICKY && xstat != EX_PROTOCOL) ! mci->mci_exitstat = xstat; ! mci->mci_status = dstat; if (mci->mci_rstatus != NULL) free(mci->mci_rstatus); *************** *** 672,678 **** { int saveErrno = errno; FILE *fp; - int status; char fname[MAXPATHLEN+1]; if (mci == NULL) --- 675,680 ---- *************** *** 682,688 **** return; } ! if (HostStatDir == NULL || mci->mci_host == NULL) return; if (tTd(56, 1)) --- 684,690 ---- return; } ! if (IgnoreHostStatus || HostStatDir == NULL || mci->mci_host == NULL) return; if (tTd(56, 1)) *************** *** 750,756 **** syserr("mci_read_persistent: NULL mci"); if (tTd(56, 93)) { ! printf("mci_read_persistent: fp=%x, mci=", fp); mci_dump(mci, FALSE); } --- 752,758 ---- syserr("mci_read_persistent: NULL mci"); if (tTd(56, 93)) { ! printf("mci_read_persistent: fp=%lx, mci=", (u_long) fp); mci_dump(mci, FALSE); } *************** *** 760,765 **** --- 762,768 ---- mci->mci_rstatus = NULL; rewind(fp); + ver = -1; while (fgets(buf, sizeof buf, fp) != NULL) { p = strchr(buf, '\n'); *************** *** 806,811 **** --- 809,816 ---- return -1; } } + if (ver < 0) + return -1; return 0; } /* *************** *** 868,874 **** fflush(mci->mci_statfile); - cleanup: errno = saveErrno; return; } --- 873,878 ---- *************** *** 903,909 **** { struct stat statbuf; DIR *d; ! int ret = 0; if (pathname == NULL) pathname = HostStatDir; --- 907,913 ---- { struct stat statbuf; DIR *d; ! int ret; if (pathname == NULL) pathname = HostStatDir; *************** *** 961,973 **** /* ** The following appears to be ! ** necessary during purgest, since ** we modify the directory structure */ if (action == mci_purge_persistent) rewinddir(d); } closedir(d); } else if (S_ISREG(statbuf.st_mode)) --- 965,981 ---- /* ** The following appears to be ! ** necessary during purges, since ** we modify the directory structure */ if (action == mci_purge_persistent) rewinddir(d); } + + /* purge (or whatever) the directory proper */ + *--newptr = '\0'; + ret = (*action)(newpath, NULL); closedir(d); } else if (S_ISREG(statbuf.st_mode)) *************** *** 1031,1042 **** { static int initflag = FALSE; FILE *fp; - int status; int width = Verbose ? 78 : 25; bool locked; - char *p; MCI mcib; if (!initflag) { initflag = TRUE; --- 1039,1052 ---- { static int initflag = FALSE; FILE *fp; int width = Verbose ? 78 : 25; bool locked; MCI mcib; + /* skip directories */ + if (hostname == NULL) + return 0; + if (!initflag) { initflag = TRUE; *************** *** 1101,1106 **** --- 1111,1117 ---- ** Parameters: ** pathname -- path to the status file. ** hostname -- name of host corresponding to that file. + ** NULL if this is a directory (domain). ** ** Returns: ** 0 *************** *** 1116,1158 **** if (tTd(56, 1)) printf("mci_purge_persistent: purging %s\n", pathname); ! /* remove the file */ ! if (unlink(pathname) < 0) { ! if (tTd(56, 2)) ! printf("mci_purge_persistent: failed to unlink %s: %s\n", ! pathname, errstring(errno)); ! return -1; } ! ! /* ! ** remove empty parent directories. ! */ ! ! for (;;) { ! while (*end != '/') ! end--; ! *(end--) = '\0'; ! if (*end != '.') ! break; if (tTd(56, 1)) printf("mci_purge_persistent: dpurge %s\n", pathname); if (rmdir(pathname) < 0) { - if (errno == ENOENT || errno == EEXIST) - break; /* directory is not empty */ - #ifdef ENOTEMTPY - if (errno == ENOTEMPTY) - break; /* BSDism */ - #endif if (tTd(56, 2)) printf("mci_purge_persistent: rmdir %s: %s\n", pathname, errstring(errno)); - break; } } --- 1127,1156 ---- if (tTd(56, 1)) printf("mci_purge_persistent: purging %s\n", pathname); ! if (hostname != NULL) { ! /* remove the file */ ! if (unlink(pathname) < 0) ! { ! if (tTd(56, 2)) ! printf("mci_purge_persistent: failed to unlink %s: %s\n", ! pathname, errstring(errno)); ! } } ! else { ! /* remove the directory */ if (*end != '.') ! return 0; if (tTd(56, 1)) printf("mci_purge_persistent: dpurge %s\n", pathname); if (rmdir(pathname) < 0) { if (tTd(56, 2)) printf("mci_purge_persistent: rmdir %s: %s\n", pathname, errstring(errno)); } } diff -c -r sendmail-8.8.3/src/mime.c sendmail-8.8.4/src/mime.c *** sendmail-8.8.3/src/mime.c Wed Oct 30 09:20:43 1996 --- sendmail-8.8.4/src/mime.c Sun Nov 24 07:27:26 1996 *************** *** 36,42 **** # include #ifndef lint ! static char sccsid[] = "@(#)mime.c 8.49 (Berkeley) 10/30/96"; #endif /* not lint */ /* --- 36,42 ---- # include #ifndef lint ! static char sccsid[] = "@(#)mime.c 8.51 (Berkeley) 11/24/96"; #endif /* not lint */ /* *************** *** 450,456 **** if (tTd(43, 8)) { printf("mime8to7: %ld high bit(s) in %ld byte(s), cte=%s, type=%s/%s\n", ! sectionhighbits, sectionsize, cte == NULL ? "[none]" : cte, type == NULL ? "[none]" : type, subtype == NULL ? "[none]" : subtype); --- 450,456 ---- if (tTd(43, 8)) { printf("mime8to7: %ld high bit(s) in %ld byte(s), cte=%s, type=%s/%s\n", ! (long) sectionhighbits, (long) sectionsize, cte == NULL ? "[none]" : cte, type == NULL ? "[none]" : type, subtype == NULL ? "[none]" : subtype); *************** *** 959,965 **** char *cte; char **pvp; u_char *obp; ! u_char ch, *fbufp, *obufp; char buf[MAXLINE]; u_char obuf[MAXLINE + 1]; u_char fbuf[MAXLINE + 1]; --- 959,965 ---- char *cte; char **pvp; u_char *obp; ! u_char *fbufp; char buf[MAXLINE]; u_char obuf[MAXLINE + 1]; u_char fbuf[MAXLINE + 1]; *************** *** 1010,1016 **** if (strcasecmp(cte, "base64") == 0) { - int nchar = 0; int c1, c2, c3, c4; fbufp = fbuf; --- 1010,1015 ---- Only in sendmail-8.8.3/src: newaliases.0 diff -c -r sendmail-8.8.3/src/parseaddr.c sendmail-8.8.4/src/parseaddr.c *** sendmail-8.8.3/src/parseaddr.c Sat Nov 16 11:41:53 1996 --- sendmail-8.8.4/src/parseaddr.c Sun Nov 24 07:27:19 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)parseaddr.c 8.114 (Berkeley) 9/20/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)parseaddr.c 8.115 (Berkeley) 11/24/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 1045,1051 **** pp = m->first; while (pp <= m->last) { ! printf(" %x=\"", *pp); (void) fflush(stdout); printf("%s\"", *pp++); } --- 1045,1051 ---- pp = m->first; while (pp <= m->last) { ! printf(" %lx=\"", (u_long) *pp); (void) fflush(stdout); printf("%s\"", *pp++); } *************** *** 1873,1879 **** while (a != NULL) { ! printf("%x=", a); (void) fflush(stdout); /* find the mailer -- carefully */ --- 1873,1879 ---- while (a != NULL) { ! printf("%lx=", (u_long) a); (void) fflush(stdout); /* find the mailer -- carefully */ *************** *** 1892,1899 **** printf("\tuser `%s', ruser `%s'\n", a->q_user, a->q_ruser == NULL ? "" : a->q_ruser); ! printf("\tnext=%x, alias %x, uid %d, gid %d\n", ! a->q_next, a->q_alias, a->q_uid, a->q_gid); printf("\tflags=%lx<", a->q_flags); firstone = TRUE; for (qfp = AddressFlags; qfp->qf_name != NULL; qfp++) --- 1892,1900 ---- printf("\tuser `%s', ruser `%s'\n", a->q_user, a->q_ruser == NULL ? "" : a->q_ruser); ! printf("\tnext=%lx, alias %lx, uid %d, gid %d\n", ! (u_long) a->q_next, (u_long) a->q_alias, ! (int) a->q_uid, (int) a->q_gid); printf("\tflags=%lx<", a->q_flags); firstone = TRUE; for (qfp = AddressFlags; qfp->qf_name != NULL; qfp++) diff -c -r sendmail-8.8.3/src/queue.c sendmail-8.8.4/src/queue.c *** sendmail-8.8.3/src/queue.c Sun Nov 10 14:04:48 1996 --- sendmail-8.8.4/src/queue.c Mon Dec 2 08:01:27 1996 *************** *** 35,51 **** # include "sendmail.h" #ifndef lint ! #ifdef QUEUE ! static char sccsid[] = "@(#)queue.c 8.131 (Berkeley) 11/8/96 (with queueing)"; #else ! static char sccsid[] = "@(#)queue.c 8.131 (Berkeley) 11/8/96 (without queueing)"; #endif #endif /* not lint */ # include # include ! # ifdef QUEUE /* ** Work queue. --- 35,51 ---- # include "sendmail.h" #ifndef lint ! #if QUEUE ! static char sccsid[] = "@(#)queue.c 8.145 (Berkeley) 12/2/96 (with queueing)"; #else ! static char sccsid[] = "@(#)queue.c 8.145 (Berkeley) 12/2/96 (without queueing)"; #endif #endif /* not lint */ # include # include ! # if QUEUE /* ** Work queue. *************** *** 195,201 **** if (!bitset(EF_HAS_DF, e->e_flags)) { ! register FILE *dfp; char dfname[20]; struct stat stbuf; --- 195,201 ---- if (!bitset(EF_HAS_DF, e->e_flags)) { ! register FILE *dfp = NULL; char dfname[20]; struct stat stbuf; *************** *** 300,307 **** { #if XDEBUG if (bitset(QQUEUEUP, q->q_flags)) ! syslog(LOG_DEBUG, "%s: q_flags = %x", ! e->e_id, q->q_flags); #endif continue; } --- 300,308 ---- { #if XDEBUG if (bitset(QQUEUEUP, q->q_flags)) ! syslog(LOG_DEBUG, ! "dropenvelope: %s: q_flags = %x, paddr = %s", ! e->e_id, q->q_flags, q->q_paddr); #endif continue; } *************** *** 474,480 **** { char *uname; char *paddr; - register struct passwd *pw; register ADDRESS *q; uid_t uid; gid_t gid; --- 475,480 ---- *************** *** 531,539 **** ** forkflag -- TRUE if the queue scanning should be done in ** a child process. We double-fork so it is not our ** child and we don't have to clean up after it. ** ** Returns: ! ** none. ** ** Side Effects: ** runs things in the mail queue. --- 531,540 ---- ** forkflag -- TRUE if the queue scanning should be done in ** a child process. We double-fork so it is not our ** child and we don't have to clean up after it. + ** verbose -- if TRUE, print out status information. ** ** Returns: ! ** TRUE if the queue run successfully began. ** ** Side Effects: ** runs things in the mail queue. *************** *** 541,555 **** ENVELOPE QueueEnvelope; /* the queue run envelope */ ! void ! runqueue(forkflag) bool forkflag; { register ENVELOPE *e; int njobs; int sequenceno = 0; extern ENVELOPE BlankEnvelope; extern void clrdaemon __P((void)); /* ** If no work will ever be selected, don't even bother reading --- 542,558 ---- ENVELOPE QueueEnvelope; /* the queue run envelope */ ! bool ! runqueue(forkflag, verbose) bool forkflag; + bool verbose; { register ENVELOPE *e; int njobs; int sequenceno = 0; extern ENVELOPE BlankEnvelope; extern void clrdaemon __P((void)); + extern void runqueueevent __P((bool)); /* ** If no work will ever be selected, don't even bother reading *************** *** 562,576 **** { char *msg = "Skipping queue run -- load average too high"; ! if (Verbose) ! printf("%s\n", msg); #ifdef LOG if (LogLevel > 8) syslog(LOG_INFO, "runqueue: %s", msg); #endif if (forkflag && QueueIntvl != 0) ! (void) setevent(QueueIntvl, runqueue, TRUE); ! return; } /* --- 565,579 ---- { char *msg = "Skipping queue run -- load average too high"; ! if (verbose) ! message("458 %s\n", msg); #ifdef LOG if (LogLevel > 8) syslog(LOG_INFO, "runqueue: %s", msg); #endif if (forkflag && QueueIntvl != 0) ! (void) setevent(QueueIntvl, runqueueevent, TRUE); ! return FALSE; } /* *************** *** 584,610 **** #ifdef SIGCHLD extern void reapchild(); (void) setsignal(SIGCHLD, reapchild); #endif pid = dofork(); if (pid != 0) { /* parent -- pick up intermediate zombie */ #ifndef SIGCHLD (void) waitfor(pid); #else proc_list_add(pid); #endif /* SIGCHLD */ if (QueueIntvl != 0) ! (void) setevent(QueueIntvl, runqueue, TRUE); ! return; } /* child -- double fork and clean up signals */ #ifndef SIGCHLD if (fork() != 0) exit(EX_OK); #else /* SIGCHLD */ (void) setsignal(SIGCHLD, SIG_DFL); #endif /* SIGCHLD */ (void) setsignal(SIGHUP, intsig); --- 587,635 ---- #ifdef SIGCHLD extern void reapchild(); + blocksignal(SIGCHLD); (void) setsignal(SIGCHLD, reapchild); #endif pid = dofork(); + if (pid == -1) + { + const char *msg = "Skipping queue run -- fork() failed"; + const char *err = errstring(errno); + + if (verbose) + message("458 %s: %s\n", msg, err); + #ifdef LOG + if (LogLevel > 8) + syslog(LOG_INFO, "runqueue: %s: %s", msg, err); + #endif + if (QueueIntvl != 0) + (void) setevent(QueueIntvl, runqueueevent, TRUE); + (void) releasesignal(SIGCHLD); + return FALSE; + } if (pid != 0) { /* parent -- pick up intermediate zombie */ #ifndef SIGCHLD (void) waitfor(pid); #else + (void) blocksignal(SIGALRM); proc_list_add(pid); + (void) releasesignal(SIGALRM); + releasesignal(SIGCHLD); #endif /* SIGCHLD */ if (QueueIntvl != 0) ! (void) setevent(QueueIntvl, runqueueevent, TRUE); ! return TRUE; } /* child -- double fork and clean up signals */ + proc_list_clear(); #ifndef SIGCHLD if (fork() != 0) exit(EX_OK); #else /* SIGCHLD */ + releasesignal(SIGCHLD); (void) setsignal(SIGCHLD, SIG_DFL); #endif /* SIGCHLD */ (void) setsignal(SIGHUP, intsig); *************** *** 623,629 **** ** Release any resources used by the daemon code. */ ! # ifdef DAEMON clrdaemon(); # endif /* DAEMON */ --- 648,654 ---- ** Release any resources used by the daemon code. */ ! # if DAEMON clrdaemon(); # endif /* DAEMON */ *************** *** 660,666 **** if (QueueLimitId != NULL || QueueLimitSender != NULL || QueueLimitRecipient != NULL) ! HostStatDir = NULL; /* ** Start making passes through the queue. --- 685,694 ---- if (QueueLimitId != NULL || QueueLimitSender != NULL || QueueLimitRecipient != NULL) ! { ! IgnoreHostStatus = TRUE; ! MinQueueAge = 0; ! } /* ** Start making passes through the queue. *************** *** 719,724 **** --- 747,766 ---- /* exit without the usual cleanup */ e->e_id = NULL; finis(); + /*NOTREACHED*/ + return TRUE; + } + + + /* + ** RUNQUEUEEVENT -- stub for use in setevent + */ + + void + runqueueevent(forkflag) + bool forkflag; + { + (void) runqueue(forkflag, FALSE); } /* ** ORDERQ -- order the work queue. *************** *** 1257,1263 **** if (a->w_ctime > b->w_ctime) return 1; else if (a->w_ctime < b->w_ctime) ! return 1; else return 0; } --- 1299,1305 ---- if (a->w_ctime > b->w_ctime) return 1; else if (a->w_ctime < b->w_ctime) ! return -1; else return 0; } *************** *** 1340,1345 **** --- 1382,1388 ---- disconnect(1, e); OpMode = MD_DELIVER; } + setproctitle("%s: from queue", id); # ifdef LOG if (LogLevel > 76) syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id, *************** *** 2054,2060 **** e->e_id = newstr(&qf[2]); define('i', e->e_id, e); if (tTd(7, 1)) ! printf("queuename: assigned id %s, env=%x\n", e->e_id, e); if (tTd(7, 9)) { printf(" lockfd="); --- 2097,2104 ---- e->e_id = newstr(&qf[2]); define('i', e->e_id, e); if (tTd(7, 1)) ! printf("queuename: assigned id %s, env=%lx\n", ! e->e_id, (u_long) e); if (tTd(7, 9)) { printf(" lockfd="); diff -c -r sendmail-8.8.3/src/readcf.c sendmail-8.8.4/src/readcf.c *** sendmail-8.8.3/src/readcf.c Sun Nov 10 10:25:26 1996 --- sendmail-8.8.4/src/readcf.c Sun Dec 1 10:47:03 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)readcf.c 8.176 (Berkeley) 11/10/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)readcf.c 8.181 (Berkeley) 12/1/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 1298,1304 **** m->m_mno, m->m_name, m->m_mailer, m->m_se_rwset, m->m_sh_rwset, m->m_re_rwset, m->m_rh_rwset, m->m_maxsize, ! m->m_uid, m->m_gid); for (j = '\0'; j <= '\177'; j++) if (bitnset(j, m->m_flags)) (void) putchar(j); --- 1298,1304 ---- m->m_mno, m->m_name, m->m_mailer, m->m_se_rwset, m->m_sh_rwset, m->m_re_rwset, m->m_rh_rwset, m->m_maxsize, ! (int) m->m_uid, (int) m->m_gid); for (j = '\0'; j <= '\177'; j++) if (bitnset(j, m->m_flags)) (void) putchar(j); *************** *** 1423,1429 **** { "DefaultUser", 'u', FALSE }, { "FallbackMXhost", 'V', FALSE }, { "Verbose", 'v', TRUE }, ! { "TryNullMXList", 'w', TRUE }, { "QueueLA", 'x', FALSE }, { "RefuseLA", 'X', FALSE }, { "RecipientFactor", 'y', FALSE }, --- 1423,1429 ---- { "DefaultUser", 'u', FALSE }, { "FallbackMXhost", 'V', FALSE }, { "Verbose", 'v', TRUE }, ! { "TryNullMXList", 'w', FALSE }, { "QueueLA", 'x', FALSE }, { "RefuseLA", 'X', FALSE }, { "RecipientFactor", 'y', FALSE }, *************** *** 1465,1471 **** #define O_OPCHARS 0x92 { "OperatorChars", O_OPCHARS, FALSE }, #define O_DONTINITGRPS 0x93 ! { "DontInitGroups", O_DONTINITGRPS, TRUE }, #define O_SLFH 0x94 { "SingleLineFromHeader", O_SLFH, TRUE }, #define O_ABH 0x95 --- 1465,1471 ---- #define O_OPCHARS 0x92 { "OperatorChars", O_OPCHARS, FALSE }, #define O_DONTINITGRPS 0x93 ! { "DontInitGroups", O_DONTINITGRPS, FALSE }, #define O_SLFH 0x94 { "SingleLineFromHeader", O_SLFH, TRUE }, #define O_ABH 0x95 *************** *** 1728,1734 **** case SM_QUEUE: /* queue only */ case SM_DEFER: /* queue only and defer map lookups */ ! #ifndef QUEUE syserr("need QUEUE to set -odqueue or -oddefer"); #endif /* QUEUE */ /* fall through..... */ --- 1728,1734 ---- case SM_QUEUE: /* queue only */ case SM_DEFER: /* queue only and defer map lookups */ ! #if !QUEUE syserr("need QUEUE to set -odqueue or -oddefer"); #endif /* QUEUE */ /* fall through..... */ *************** *** 1849,1855 **** } if (tTd(8, 2)) printf("_res.options = %x, HasWildcardMX = %d\n", ! _res.options, HasWildcardMX); #else usrerr("name server (I option) specified but BIND not compiled in"); #endif --- 1849,1855 ---- } if (tTd(8, 2)) printf("_res.options = %x, HasWildcardMX = %d\n", ! (u_int) _res.options, HasWildcardMX); #else usrerr("name server (I option) specified but BIND not compiled in"); #endif *************** *** 1906,1912 **** /* 'N' available -- was "net name" */ case 'O': /* daemon options */ ! #ifdef DAEMON setdaemonoptions(val); #else syserr("DaemonPortOptions (O option) set but DAEMON not compiled in"); --- 1906,1912 ---- /* 'N' available -- was "net name" */ case 'O': /* daemon options */ ! #if DAEMON setdaemonoptions(val); #else syserr("DaemonPortOptions (O option) set but DAEMON not compiled in"); diff -c -r sendmail-8.8.3/src/recipient.c sendmail-8.8.4/src/recipient.c *** sendmail-8.8.3/src/recipient.c Sun Sep 15 11:37:45 1996 --- sendmail-8.8.4/src/recipient.c Sun Dec 1 18:16:23 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)recipient.c 8.116 (Berkeley) 8/17/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)recipient.c 8.118 (Berkeley) 12/1/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 474,481 **** if (tTd(29, 5)) { ! printf("recipient: testing local? cl=%d, rr5=%x\n\t", ! ConfigLevel, RewriteRules[5]); printaddr(a, FALSE); } if (!bitset(QNOTREMOTE|QDONTSEND|QQUEUEUP|QVERIFIED, a->q_flags) && --- 474,481 ---- if (tTd(29, 5)) { ! printf("recipient: testing local? cl=%d, rr5=%lx\n\t", ! ConfigLevel, (u_long) RewriteRules[5]); printaddr(a, FALSE); } if (!bitset(QNOTREMOTE|QDONTSEND|QQUEUEUP|QVERIFIED, a->q_flags) && *************** *** 601,607 **** if (aliaslevel == 0) { int nrcpts = 0; ! ADDRESS *only; for (q = *sendq; q != NULL; q = q->q_next) { --- 601,607 ---- if (aliaslevel == 0) { int nrcpts = 0; ! ADDRESS *only = NULL; for (q = *sendq; q != NULL; q = q->q_next) { *************** *** 907,913 **** volatile gid_t savedgid, gid; char *volatile uname; int rval = 0; ! int sfflags = SFF_REGONLY; struct stat st; char buf[MAXLINE]; #ifdef _POSIX_CHOWN_RESTRICTED --- 907,913 ---- volatile gid_t savedgid, gid; char *volatile uname; int rval = 0; ! volatile int sfflags = SFF_REGONLY; struct stat st; char buf[MAXLINE]; #ifdef _POSIX_CHOWN_RESTRICTED *************** *** 932,938 **** if (tTd(27, 2)) printf("include(%s)\n", fname); if (tTd(27, 4)) ! printf(" ruid=%d euid=%d\n", getuid(), geteuid()); if (tTd(27, 14)) { printf("ctladdr "); --- 932,938 ---- if (tTd(27, 2)) printf("include(%s)\n", fname); if (tTd(27, 4)) ! printf(" ruid=%d euid=%d\n", (int) getuid(), (int) geteuid()); if (tTd(27, 14)) { printf("ctladdr "); *************** *** 940,946 **** } if (tTd(27, 9)) ! printf("include: old uid = %d/%d\n", getuid(), geteuid()); if (forwarding) sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOSLINK; --- 940,947 ---- } if (tTd(27, 9)) ! printf("include: old uid = %d/%d\n", ! (int) getuid(), (int) geteuid()); if (forwarding) sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOSLINK; *************** *** 985,991 **** #endif if (tTd(27, 9)) ! printf("include: new uid = %d/%d\n", getuid(), geteuid()); /* ** If home directory is remote mounted but server is down, --- 986,993 ---- #endif if (tTd(27, 9)) ! printf("include: new uid = %d/%d\n", ! (int) getuid(), (int) geteuid()); /* ** If home directory is remote mounted but server is down, *************** *** 1013,1019 **** /* don't use this :include: file */ if (tTd(27, 4)) printf("include: not safe (uid=%d): %s\n", ! uid, errstring(rval)); } else { --- 1015,1021 ---- /* don't use this :include: file */ if (tTd(27, 4)) printf("include: not safe (uid=%d): %s\n", ! (int) uid, errstring(rval)); } else { *************** *** 1053,1059 **** #endif if (tTd(27, 9)) ! printf("include: reset uid = %d/%d\n", getuid(), geteuid()); if (rval == EOPENTIMEOUT) usrerr("451 open timeout on %s", fname); --- 1055,1062 ---- #endif if (tTd(27, 9)) ! printf("include: reset uid = %d/%d\n", ! (int) getuid(), (int) geteuid()); if (rval == EOPENTIMEOUT) usrerr("451 open timeout on %s", fname); *************** *** 1083,1089 **** ctladdr->q_flags |= ca->q_flags & QBOGUSSHELL; ctladdr->q_ruser = ca->q_ruser; } ! else { register struct passwd *pw; --- 1086,1092 ---- ctladdr->q_flags |= ca->q_flags & QBOGUSSHELL; ctladdr->q_ruser = ca->q_ruser; } ! else if (!forwarding) { register struct passwd *pw; diff -c -r sendmail-8.8.3/src/savemail.c sendmail-8.8.4/src/savemail.c *** sendmail-8.8.3/src/savemail.c Fri Sep 27 13:17:09 1996 --- sendmail-8.8.4/src/savemail.c Sun Nov 24 07:27:20 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)savemail.c 8.100 (Berkeley) 9/27/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)savemail.c 8.101 (Berkeley) 11/24/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 481,488 **** if (tTd(6, 1)) { ! printf("\n*** Return To Sender: msg=\"%s\", depth=%d, e=%x, returnq=", ! msg, returndepth, e); printaddr(returnq, TRUE); if (tTd(6, 20)) { --- 481,488 ---- if (tTd(6, 1)) { ! printf("\n*** Return To Sender: msg=\"%s\", depth=%d, e=%lx, returnq=", ! msg, returndepth, (u_long) e); printaddr(returnq, TRUE); if (tTd(6, 20)) { Only in sendmail-8.8.3/src: sendmail.0 diff -c -r sendmail-8.8.3/src/sendmail.h sendmail-8.8.4/src/sendmail.h *** sendmail-8.8.3/src/sendmail.h Fri Nov 8 09:09:26 1996 --- sendmail-8.8.4/src/sendmail.h Sun Dec 1 10:44:48 1996 *************** *** 31,37 **** * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)sendmail.h 8.209 (Berkeley) 11/8/96 */ /* --- 31,37 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)sendmail.h 8.216 (Berkeley) 12/1/96 */ /* *************** *** 41,47 **** # ifdef _DEFINE # define EXTERN # ifndef lint ! static char SmailSccsId[] = "@(#)sendmail.h 8.209 11/8/96"; # endif # else /* _DEFINE */ # define EXTERN extern --- 41,47 ---- # ifdef _DEFINE # define EXTERN # ifndef lint ! static char SmailSccsId[] = "@(#)sendmail.h 8.216 12/1/96"; # endif # else /* _DEFINE */ # define EXTERN extern *************** *** 68,74 **** # include # endif /* LOG */ ! # ifdef DAEMON # include # endif # if NETUNIX --- 68,74 ---- # include # endif /* LOG */ ! # if NETINET || NETUNIX || NETISO || NETNS || NETX25 # include # endif # if NETUNIX *************** *** 277,284 **** --- 277,286 ---- # define M_XDOT 'X' /* use hidden-dot algorithm */ # define M_LMTP 'z' /* run Local Mail Transport Protocol */ # define M_NOMX '0' /* turn off MX lookups */ + # define M_NONULLS '1' /* don't send null bytes */ # define M_EBCDIC '3' /* extend Q-P encoding for EBCDIC */ # define M_TRYRULESET5 '5' /* use ruleset 5 after local aliasing */ + # define M_7BITHDRS '6' /* strip headers to 7 bits even in 8 bit path */ # define M_7BITS '7' /* use 7-bit path */ # define M_8BITS '8' /* force "just send 8" behaviour */ # define M_MAKE8BIT '9' /* convert 7 -> 8 bit if appropriate */ *************** *** 984,990 **** ** we are forced to declare a supertype here. */ ! #ifdef DAEMON union bigsockaddr { struct sockaddr sa; /* general version */ --- 986,992 ---- ** we are forced to declare a supertype here. */ ! # if NETINET || NETUNIX || NETISO || NETNS || NETX25 union bigsockaddr { struct sockaddr sa; /* general version */ *************** *** 1011,1016 **** --- 1013,1021 ---- extern char *hostnamebyanyaddr __P((SOCKADDR *)); extern char *anynet_ntoa __P((SOCKADDR *)); + # if DAEMON + extern bool validate_connection __P((SOCKADDR *, char *, ENVELOPE *)); + # endif #endif *************** *** 1160,1165 **** --- 1165,1171 ---- EXTERN bool UserSubmission; /* initial (user) mail submission */ EXTERN uid_t RunAsUid; /* UID to become for bulk of run */ EXTERN gid_t RunAsGid; /* GID to become for bulk of run */ + EXTERN bool IgnoreHostStatus; /* ignore long term host status files */ EXTERN bool SingleThreadDelivery; /* single thread hosts on delivery */ EXTERN bool UnsafeGroupWrites; /* group-writable files are unsafe */ EXTERN bool SingleLineFromHeader; /* force From: header to be one line */ *************** *** 1315,1320 **** --- 1321,1327 ---- extern int waitfor __P((pid_t)); extern void proc_list_add __P((pid_t)); extern void proc_list_drop __P((pid_t)); + extern void proc_list_clear __P((void)); extern void buffer_errors __P((void)); extern void flush_errors __P((bool)); extern void putline __P((char *, MCI *)); *************** *** 1336,1342 **** extern int include __P((char *, bool, ADDRESS *, ADDRESS **, int, ENVELOPE *)); extern void unlockqueue __P((ENVELOPE *)); extern void xunlink __P((char *)); ! extern void runqueue __P((bool)); extern int getla __P((void)); extern void sendall __P((ENVELOPE *, int)); extern void queueup __P((ENVELOPE *, bool)); --- 1343,1349 ---- extern int include __P((char *, bool, ADDRESS *, ADDRESS **, int, ENVELOPE *)); extern void unlockqueue __P((ENVELOPE *)); extern void xunlink __P((char *)); ! extern bool runqueue __P((bool, bool)); extern int getla __P((void)); extern void sendall __P((ENVELOPE *, int)); extern void queueup __P((ENVELOPE *, bool)); *************** *** 1349,1360 **** extern void loseqfile __P((ENVELOPE *, char *)); extern int prog_open __P((char **, int *, ENVELOPE *)); extern bool getcanonname __P((char *, int, bool)); - extern bool validate_connection __P((SOCKADDR *, char *, ENVELOPE *)); extern bool path_is_dir __P((char *, bool)); extern pid_t dowork __P((char *, bool, bool, ENVELOPE *)); extern const char *errstring __P((int)); extern sigfunc_t setsignal __P((int, sigfunc_t)); extern int releasesignal __P((int)); extern struct hostent *sm_gethostbyname __P((char *)); extern struct hostent *sm_gethostbyaddr __P((char *, int, int)); --- 1356,1367 ---- extern void loseqfile __P((ENVELOPE *, char *)); extern int prog_open __P((char **, int *, ENVELOPE *)); extern bool getcanonname __P((char *, int, bool)); extern bool path_is_dir __P((char *, bool)); extern pid_t dowork __P((char *, bool, bool, ENVELOPE *)); extern const char *errstring __P((int)); extern sigfunc_t setsignal __P((int, sigfunc_t)); + extern int blocksignal __P((int)); extern int releasesignal __P((int)); extern struct hostent *sm_gethostbyname __P((char *)); extern struct hostent *sm_gethostbyaddr __P((char *, int, int)); diff -c -r sendmail-8.8.3/src/srvrsmtp.c sendmail-8.8.4/src/srvrsmtp.c *** sendmail-8.8.3/src/srvrsmtp.c Sun Nov 10 13:55:16 1996 --- sendmail-8.8.4/src/srvrsmtp.c Sun Dec 1 10:47:02 1996 *************** *** 35,50 **** # include "sendmail.h" #ifndef lint ! #ifdef SMTP ! static char sccsid[] = "@(#)srvrsmtp.c 8.125 (Berkeley) 11/8/96 (with SMTP)"; #else ! static char sccsid[] = "@(#)srvrsmtp.c 8.125 (Berkeley) 11/8/96 (without SMTP)"; #endif #endif /* not lint */ # include ! # ifdef SMTP /* ** SMTP -- run the SMTP protocol. --- 35,50 ---- # include "sendmail.h" #ifndef lint ! #if SMTP ! static char sccsid[] = "@(#)srvrsmtp.c 8.131 (Berkeley) 12/1/96 (with SMTP)"; #else ! static char sccsid[] = "@(#)srvrsmtp.c 8.131 (Berkeley) 12/1/96 (without SMTP)"; #endif #endif /* not lint */ # include ! # if SMTP /* ** SMTP -- run the SMTP protocol. *************** *** 128,134 **** bool nullserver; register ENVELOPE *volatile e; { ! register char *p; register struct cmd *c; char *cmd; auto ADDRESS *vrfyqueue; --- 128,134 ---- bool nullserver; register ENVELOPE *volatile e; { ! register char *volatile p; register struct cmd *c; char *cmd; auto ADDRESS *vrfyqueue; *************** *** 146,151 **** --- 146,152 ---- volatile int badcommands = 0; /* count of bad commands */ volatile int nverifies = 0; /* count of VRFY/EXPN commands */ volatile int n_etrn = 0; /* count of ETRN commands */ + bool ok; char inp[MAXLINE]; char cmdbuf[MAXLINE]; extern ENVELOPE BlankEnvelope; *************** *** 169,175 **** CurSmtpClient = CurHostName; setproctitle("server %s startup", CurSmtpClient); ! #ifdef LOG if (LogLevel > 11) { /* log connection information */ --- 170,176 ---- CurSmtpClient = CurHostName; setproctitle("server %s startup", CurSmtpClient); ! #if defined(LOG) && DAEMON if (LogLevel > 11) { /* log connection information */ *************** *** 880,888 **** shortenstring(id, 203)); #endif QueueLimitRecipient = id; ! runqueue(TRUE); QueueLimitRecipient = NULL; ! message("250 Queuing for node %s started", p); break; case CMDHELP: /* help -- give user info */ --- 881,890 ---- shortenstring(id, 203)); #endif QueueLimitRecipient = id; ! ok = runqueue(TRUE, TRUE); QueueLimitRecipient = NULL; ! if (ok) ! message("250 Queuing for node %s started", p); break; case CMDHELP: /* help -- give user info */ *************** *** 929,935 **** message("250 Initial submission"); break; ! # ifdef SMTPDEBUG case CMDDBGQSHOW: /* show queues */ printf("Send Queue="); printaddr(e->e_sendqueue, TRUE); --- 931,937 ---- message("250 Initial submission"); break; ! # if SMTPDEBUG case CMDDBGQSHOW: /* show queues */ printf("Send Queue="); printaddr(e->e_sendqueue, TRUE); *************** *** 1271,1293 **** register ENVELOPE *e; { pid_t childpid; - sigfunc_t chldsig; if (!OneXact) { /* ** Disable child process reaping, in case ETRN has preceeded ! ** MAIL command. */ ! #ifdef SIGCHLD ! chldsig = setsignal(SIGCHLD, SIG_IGN); ! #endif childpid = dofork(); if (childpid < 0) { syserr("451 %s: cannot fork", label); return (1); } if (childpid > 0) --- 1273,1293 ---- register ENVELOPE *e; { pid_t childpid; if (!OneXact) { /* ** Disable child process reaping, in case ETRN has preceeded ! ** MAIL command, and then fork. */ ! (void) blocksignal(SIGCHLD); childpid = dofork(); if (childpid < 0) { syserr("451 %s: cannot fork", label); + (void) releasesignal(SIGCHLD); return (1); } if (childpid > 0) *************** *** 1310,1319 **** finis(); } - #ifdef SIGCHLD /* restore the child signal */ ! (void) setsignal(SIGCHLD, chldsig); ! #endif return (1); } --- 1310,1317 ---- finis(); } /* restore the child signal */ ! (void) releasesignal(SIGCHLD); return (1); } *************** *** 1323,1328 **** --- 1321,1328 ---- InChild = TRUE; QuickAbort = FALSE; clearenvelope(e, FALSE); + (void) setsignal(SIGCHLD, SIG_DFL); + (void) releasesignal(SIGCHLD); } } diff -c -r sendmail-8.8.3/src/stab.c sendmail-8.8.4/src/stab.c *** sendmail-8.8.3/src/stab.c Thu Oct 17 07:53:18 1996 --- sendmail-8.8.4/src/stab.c Sat Nov 23 09:54:29 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)stab.c 8.9 (Berkeley) 10/17/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)stab.c 8.10 (Berkeley) 11/23/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 131,137 **** printf("entered\n"); /* determine size of new entry */ ! #ifdef FFR_MEMORY_MISER if (type >= ST_MCI) len = sizeof s->s_mci; else --- 131,137 ---- printf("entered\n"); /* determine size of new entry */ ! #ifdef _FFR_MEMORY_MISER if (type >= ST_MCI) len = sizeof s->s_mci; else diff -c -r sendmail-8.8.3/src/udb.c sendmail-8.8.4/src/udb.c *** sendmail-8.8.3/src/udb.c Wed Sep 18 15:04:40 1996 --- sendmail-8.8.4/src/udb.c Sun Dec 1 10:24:49 1996 *************** *** 36,44 **** #ifndef lint #if USERDB ! static char sccsid [] = "@(#)udb.c 8.42 (Berkeley) 9/18/96 (with USERDB)"; #else ! static char sccsid [] = "@(#)udb.c 8.42 (Berkeley) 9/18/96 (without USERDB)"; #endif #endif --- 36,44 ---- #ifndef lint #if USERDB ! static char sccsid [] = "@(#)udb.c 8.46 (Berkeley) 12/1/96 (with USERDB)"; #else ! static char sccsid [] = "@(#)udb.c 8.46 (Berkeley) 12/1/96 (without USERDB)"; #endif #endif *************** *** 210,215 **** --- 210,216 ---- #endif user = userbuf; + userbuf[0] = '\0'; usersize = sizeof userbuf; userleft = sizeof userbuf - 1; *************** *** 240,246 **** } if (tTd(28, 80)) printf("udbexpand: match %.*s: %.*s\n", ! key.size, key.data, info.size, info.data); a->q_flags &= ~QSELFREF; while (i == 0 && key.size == keylen && --- 241,248 ---- } if (tTd(28, 80)) printf("udbexpand: match %.*s: %.*s\n", ! (int) key.size, (char *) key.data, ! (int) info.size, (char *) info.data); a->q_flags &= ~QSELFREF; while (i == 0 && key.size == keylen && *************** *** 272,278 **** *p++ = ','; userleft--; } ! bcopy(info.data, user, info.size); user[info.size] = '\0'; userleft -= info.size; --- 274,280 ---- *p++ = ','; userleft--; } ! bcopy(info.data, p, info.size); user[info.size] = '\0'; userleft -= info.size; *************** *** 817,822 **** --- 819,825 ---- { char *spec; int nopts; + int l; # if 0 auto int rcode; int nmx; *************** *** 934,942 **** #ifdef NEWDB case '/': /* look up remote name */ ! up->udb_dbname = spec; errno = 0; ! up->udb_dbp = dbopen(spec, O_RDONLY, 0644, DB_BTREE, NULL); if (up->udb_dbp == NULL) { if (tTd(28, 1)) --- 937,956 ---- #ifdef NEWDB case '/': /* look up remote name */ ! l = strlen(spec); ! if (l > 3 && strcmp(&spec[l - 3], ".db") == 0) ! { ! up->udb_dbname = spec; ! } ! else ! { ! up->udb_dbname = xalloc(l + 4); ! strcpy(up->udb_dbname, spec); ! strcat(up->udb_dbname, ".db"); ! } errno = 0; ! up->udb_dbp = dbopen(up->udb_dbname, O_RDONLY, ! 0644, DB_BTREE, NULL); if (up->udb_dbp == NULL) { if (tTd(28, 1)) *************** *** 944,950 **** int saveerrno = errno; printf("dbopen(%s): %s", ! spec, errstring(errno)); errno = saveerrno; } if (errno != ENOENT && errno != EACCES) --- 958,965 ---- int saveerrno = errno; printf("dbopen(%s): %s", ! up->udb_dbname, ! errstring(errno)); errno = saveerrno; } if (errno != ENOENT && errno != EACCES) *************** *** 952,962 **** #ifdef LOG if (LogLevel > 2) syslog(LOG_ERR, "dbopen(%s): %s", ! spec, errstring(errno)); #endif up->udb_type = UDB_EOLIST; goto tempfail; } break; } up->udb_type = UDB_DBFETCH; --- 967,982 ---- #ifdef LOG if (LogLevel > 2) syslog(LOG_ERR, "dbopen(%s): %s", ! up->udb_dbname, ! errstring(errno)); #endif up->udb_type = UDB_EOLIST; + if (up->udb_dbname != spec) + free(up->udb_dbname); goto tempfail; } + if (up->udb_dbname != spec) + free(up->udb_dbname); break; } up->udb_type = UDB_DBFETCH; *************** *** 978,984 **** { switch (up->udb_type) { ! #ifdef DAEMON case UDB_REMOTE: printf("REMOTE: addr %s, timeo %d\n", anynet_ntoa((SOCKADDR *) &up->udb_addr), --- 998,1004 ---- { switch (up->udb_type) { ! #if DAEMON case UDB_REMOTE: printf("REMOTE: addr %s, timeo %d\n", anynet_ntoa((SOCKADDR *) &up->udb_addr), diff -c -r sendmail-8.8.3/src/usersmtp.c sendmail-8.8.4/src/usersmtp.c *** sendmail-8.8.3/src/usersmtp.c Sat Nov 16 07:40:07 1996 --- sendmail-8.8.4/src/usersmtp.c Sun Dec 1 10:47:01 1996 *************** *** 35,51 **** # include "sendmail.h" #ifndef lint ! #ifdef SMTP ! static char sccsid[] = "@(#)usersmtp.c 8.75 (Berkeley) 11/6/96 (with SMTP)"; #else ! static char sccsid[] = "@(#)usersmtp.c 8.75 (Berkeley) 11/6/96 (without SMTP)"; #endif #endif /* not lint */ # include # include ! # ifdef SMTP /* ** USERSMTP -- run SMTP protocol from the user end. --- 35,51 ---- # include "sendmail.h" #ifndef lint ! #if SMTP ! static char sccsid[] = "@(#)usersmtp.c 8.79 (Berkeley) 12/1/96 (with SMTP)"; #else ! static char sccsid[] = "@(#)usersmtp.c 8.79 (Berkeley) 12/1/96 (without SMTP)"; #endif #endif /* not lint */ # include # include ! # if SMTP /* ** USERSMTP -- run SMTP protocol from the user end. *************** *** 155,161 **** ** My mother taught me to always introduce myself. */ ! #if FFR_LMTP if (bitnset(M_ESMTP, m->m_flags) || bitnset(M_LMTP, m->m_flags)) #else if (bitnset(M_ESMTP, m->m_flags)) --- 155,161 ---- ** My mother taught me to always introduce myself. */ ! #if _FFR_LMTP if (bitnset(M_ESMTP, m->m_flags) || bitnset(M_LMTP, m->m_flags)) #else if (bitnset(M_ESMTP, m->m_flags)) *************** *** 163,169 **** mci->mci_flags |= MCIF_ESMTP; tryhelo: ! #if FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) { smtpmessage("LHLO %s", m, mci, MyHostName); --- 163,169 ---- mci->mci_flags |= MCIF_ESMTP; tryhelo: ! #if _FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) { smtpmessage("LHLO %s", m, mci, MyHostName); *************** *** 188,194 **** goto tempfail1; else if (REPLYTYPE(r) == 5) { ! #if FFR_LMTP if (bitset(MCIF_ESMTP, mci->mci_flags) && !bitnset(M_LMTP, m->m_flags)) #else --- 188,194 ---- goto tempfail1; else if (REPLYTYPE(r) == 5) { ! #if _FFR_LMTP if (bitset(MCIF_ESMTP, mci->mci_flags) && !bitnset(M_LMTP, m->m_flags)) #else *************** *** 214,220 **** if (p != NULL) *p = '\0'; if (!bitnset(M_NOLOOPCHECK, m->m_flags) && ! #if FFR_LMTP !bitnset(M_LMTP, m->m_flags) && #endif strcasecmp(&SmtpReplyBuffer[4], MyHostName) == 0) --- 214,220 ---- if (p != NULL) *p = '\0'; if (!bitnset(M_NOLOOPCHECK, m->m_flags) && ! #if _FFR_LMTP !bitnset(M_LMTP, m->m_flags) && #endif strcasecmp(&SmtpReplyBuffer[4], MyHostName) == 0) *************** *** 418,424 **** extern char MsgBuf[]; usrerr("%s does not support 8BITMIME", mci->mci_host); ! mci_setstat(mci, EX_DATAERR, "5.6.3", MsgBuf); return EX_DATAERR; } --- 418,424 ---- extern char MsgBuf[]; usrerr("%s does not support 8BITMIME", mci->mci_host); ! mci_setstat(mci, EX_NOTSTICKY, "5.6.3", MsgBuf); return EX_DATAERR; } *************** *** 505,529 **** else if (r == 501) { /* syntax error in arguments */ ! mci_setstat(mci, EX_DATAERR, "5.5.2", SmtpReplyBuffer); return EX_DATAERR; } else if (r == 553) { /* mailbox name not allowed */ ! mci_setstat(mci, EX_DATAERR, "5.1.3", SmtpReplyBuffer); return EX_DATAERR; } else if (r == 552) { /* exceeded storage allocation */ ! mci_setstat(mci, EX_UNAVAILABLE, "5.2.2", SmtpReplyBuffer); return EX_UNAVAILABLE; } else if (REPLYTYPE(r) == 5) { /* unknown error */ ! mci_setstat(mci, EX_UNAVAILABLE, "5.0.0", SmtpReplyBuffer); return EX_UNAVAILABLE; } --- 505,529 ---- else if (r == 501) { /* syntax error in arguments */ ! mci_setstat(mci, EX_NOTSTICKY, "5.5.2", SmtpReplyBuffer); return EX_DATAERR; } else if (r == 553) { /* mailbox name not allowed */ ! mci_setstat(mci, EX_NOTSTICKY, "5.1.3", SmtpReplyBuffer); return EX_DATAERR; } else if (r == 552) { /* exceeded storage allocation */ ! mci_setstat(mci, EX_NOTSTICKY, "5.2.2", SmtpReplyBuffer); return EX_UNAVAILABLE; } else if (REPLYTYPE(r) == 5) { /* unknown error */ ! mci_setstat(mci, EX_NOTSTICKY, "5.0.0", SmtpReplyBuffer); return EX_UNAVAILABLE; } *************** *** 654,659 **** --- 654,660 ---- } #endif + mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer); return EX_PROTOCOL; } /* *************** *** 719,724 **** --- 720,726 ---- } #endif smtprset(m, mci, e); + mci_setstat(mci, EX_PROTOCOL, "5.5.1", SmtpReplyBuffer); return (EX_PROTOCOL); } *************** *** 770,783 **** /* terminate the message */ fprintf(mci->mci_out, ".%s", m->m_eol); if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> .\n", getpid()); if (Verbose) nmessage(">>> ."); /* check for the results of the transaction */ SmtpPhase = mci->mci_phase = "client DATA status"; setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase); ! #if FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) return EX_OK; #endif --- 772,785 ---- /* terminate the message */ fprintf(mci->mci_out, ".%s", m->m_eol); if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> .\n", (int) getpid()); if (Verbose) nmessage(">>> ."); /* check for the results of the transaction */ SmtpPhase = mci->mci_phase = "client DATA status"; setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase); ! #if _FFR_LMTP if (bitnset(M_LMTP, m->m_flags)) return EX_OK; #endif *************** *** 833,839 **** ** The exit status corresponding to the reply code. */ ! #if FFR_LMTP int smtpgetstat(m, mci, e) --- 835,841 ---- ** The exit status corresponding to the reply code. */ ! #if _FFR_LMTP int smtpgetstat(m, mci, e) *************** *** 1183,1189 **** if (tTd(18, 1) || Verbose) nmessage(">>> %s", SmtpMsgBuffer); if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(), SmtpMsgBuffer); if (mci->mci_out != NULL) { fprintf(mci->mci_out, "%s%s", SmtpMsgBuffer, --- 1185,1192 ---- if (tTd(18, 1) || Verbose) nmessage(">>> %s", SmtpMsgBuffer); if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> %s\n", ! (int) getpid(), SmtpMsgBuffer); if (mci->mci_out != NULL) { fprintf(mci->mci_out, "%s%s", SmtpMsgBuffer, diff -c -r sendmail-8.8.3/src/util.c sendmail-8.8.4/src/util.c *** sendmail-8.8.3/src/util.c Sat Nov 16 18:32:28 1996 --- sendmail-8.8.4/src/util.c Sun Dec 1 09:56:29 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)util.c 8.109 (Berkeley) 11/16/96"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)util.c 8.113 (Berkeley) 11/24/96"; #endif /* not lint */ # include "sendmail.h" *************** *** 215,221 **** while (*av != NULL) { if (tTd(0, 44)) ! printf("\n\t%08x=", *av); else (void) putchar(' '); xputs(*av++); --- 215,221 ---- while (*av != NULL) { if (tTd(0, 44)) ! printf("\n\t%08lx=", (u_long) *av); else (void) putchar(' '); xputs(*av++); *************** *** 423,429 **** { register char *p; register char *bp = buf; - int l; if (*gecos == '*') gecos++; --- 423,428 ---- *************** *** 507,513 **** if (tTd(44, 4)) printf("safefile(%s, uid=%d, gid=%d, flags=%x, mode=%o):\n", ! fn, uid, gid, flags, mode); errno = 0; if (st == NULL) st = &fstbuf; --- 506,512 ---- if (tTd(44, 4)) printf("safefile(%s, uid=%d, gid=%d, flags=%x, mode=%o):\n", ! fn, (int) uid, (int) gid, flags, mode); errno = 0; if (st == NULL) st = &fstbuf; *************** *** 635,642 **** } ret = errno; if (tTd(44, 4)) ! printf("\t[final dir %s uid %d mode %o] %s\n", ! fn, stbuf.st_uid, stbuf.st_mode, errstring(ret)); *p = '/'; st->st_mode = ST_MODE_NOFILE; --- 634,641 ---- } ret = errno; if (tTd(44, 4)) ! printf("\t[final dir %s uid %d mode %lo] %s\n", ! fn, (int) stbuf.st_uid, (u_long) stbuf.st_mode, errstring(ret)); *p = '/'; st->st_mode = ST_MODE_NOFILE; *************** *** 664,669 **** --- 663,674 ---- printf("\t[exec bits %o]\tEPERM]\n", st->st_mode); return EPERM; } + if (st->st_nlink > 1) + { + if (tTd(44, 4)) + printf("\t[link count %d]\tEPERM\n", st->st_nlink); + return EPERM; + } if (uid == 0 && !bitset(SFF_ROOTOK, flags)) mode >>= 6; *************** *** 690,697 **** mode >>= 3; } if (tTd(44, 4)) ! printf("\t[uid %d, stat %o, mode %o] ", ! st->st_uid, st->st_mode, mode); if ((st->st_uid == uid || st->st_uid == 0 || !bitset(SFF_MUSTOWN, flags)) && (st->st_mode & mode) == mode) --- 695,703 ---- mode >>= 3; } if (tTd(44, 4)) ! printf("\t[uid %d, nlink %d, stat %lo, mode %lo] ", ! (int) st->st_uid, (int) st->st_nlink, ! (u_long) st->st_mode, (u_long) mode); if ((st->st_uid == uid || st->st_uid == 0 || !bitset(SFF_MUSTOWN, flags)) && (st->st_mode & mode) == mode) *************** *** 966,972 **** p = &l[strlen(l)]; if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> ", getpid()); /* check for line overflow */ while (mci->mci_mailer->m_linelimit > 0 && --- 972,978 ---- p = &l[strlen(l)]; if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d >>> ", (int) getpid()); /* check for line overflow */ while (mci->mci_mailer->m_linelimit > 0 && *************** *** 998,1004 **** (void) putc(' ', mci->mci_out); if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%s!\n%05d >>> ", ! l, getpid()); *q = svchar; l = q; slop = 1; --- 1004,1010 ---- (void) putc(' ', mci->mci_out); if (TrafficLogFile != NULL) fprintf(TrafficLogFile, "%s!\n%05d >>> ", ! l, (int) getpid()); *q = svchar; l = q; slop = 1; *************** *** 1087,1093 **** char *a, *b; { if (tTd(53, 99)) ! printf("xfclose(%x) %s %s\n", fp, a, b); #if XDEBUG if (fileno(fp) == 1) syserr("xfclose(%s %s): fd = 1", a, b); --- 1093,1099 ---- char *a, *b; { if (tTd(53, 99)) ! printf("xfclose(%lx) %s %s\n", (u_long) fp, a, b); #if XDEBUG if (fileno(fp) == 1) syserr("xfclose(%s %s): fd = 1", a, b); *************** *** 1178,1188 **** { buf[0] = '\0'; if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d <<< [EOF]\n", getpid()); return (NULL); } if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d <<< %s", getpid(), buf); if (SevenBitInput) { for (p = buf; *p != '\0'; p++) --- 1184,1194 ---- { buf[0] = '\0'; if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d <<< [EOF]\n", (int) getpid()); return (NULL); } if (TrafficLogFile != NULL) ! fprintf(TrafficLogFile, "%05d <<< %s", (int) getpid(), buf); if (SevenBitInput) { for (p = buf; *p != '\0'; p++) *************** *** 2271,2276 **** --- 2277,2301 ---- } if (CurChildren > 0) CurChildren--; + } + /* + ** PROC_LIST_CLEAR -- clear the process list + ** + ** Parameters: + ** none. + ** + ** Returns: + ** none. + */ + + void + proc_list_clear() + { + int i; + + for (i = 0; i < ProcListSize; i++) + ProcListVec[i] = NO_PID; + CurChildren = 0; } /* ** PROC_LIST_PROBE -- probe processes in the list to see if they still exist diff -c -r sendmail-8.8.3/src/version.c sendmail-8.8.4/src/version.c *** sendmail-8.8.3/src/version.c Sat Nov 16 18:33:07 1996 --- sendmail-8.8.4/src/version.c Mon Dec 2 08:05:30 1996 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)version.c 8.8.3.2 (Berkeley) 11/16/96"; #endif /* not lint */ ! char Version[] = "8.8.3"; --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)version.c 8.8.4.4 (Berkeley) 12/2/96"; #endif /* not lint */ ! char Version[] = "8.8.4"; diff -c -r sendmail-8.8.3/test/Results sendmail-8.8.4/test/Results *** sendmail-8.8.3/test/Results Mon Oct 21 07:12:10 1996 --- sendmail-8.8.4/test/Results Fri Nov 29 13:34:21 1996 *************** *** 25,30 **** --- 25,31 ---- Solaris 2.2 FAIL 93.07.19 Bill Wisner Solaris 2.3 FAIL 95.11.22 Scott J. Kramer Solaris 2.5 OK 96.02.29 Carson Gaspar + Solaris 2.5.1 OK 96.11.29 Gregory Neil Shapiro OSF/1 T1.3-4 OK 93.07.19 eric (on DEC Alpha) OSF/1 1.3 OK 94.12.10 Jeff A. Earickson (on Intel Paragon) *************** *** 75,80 **** --- 76,82 ---- Solaris 2.3 OK 95.11.22 Scott J. Kramer Solaris 2.4 OK 95.09.22 Thomas 'Mike' Michlmayr Solaris 2.5 OK 96.02.29 Carson Gaspar + Solaris 2.5.1 OK 96.11.29 Gregory Neil Shapiro Linux 1.2.13 FAIL 95.11.02 Sven Neuhaus Linux 2.0.17 FAIL 96.09.03 Horst von Brand