summaryrefslogtreecommitdiff
path: root/contrib/sendmail/src
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>1999-01-21 00:55:32 +0000
committercvs2svn <cvs2svn@FreeBSD.org>1999-01-21 00:55:32 +0000
commit76b5366091f76c9bc73570149ef5055648fc2c39 (patch)
tree590d020e0f2a5bea6e09d66d951a674443b21d67 /contrib/sendmail/src
parent4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff)
Notes
Diffstat (limited to 'contrib/sendmail/src')
-rwxr-xr-xcontrib/sendmail/src/Build513
-rw-r--r--contrib/sendmail/src/Makefile.m411
-rw-r--r--contrib/sendmail/src/README17
-rw-r--r--contrib/sendmail/src/TRACEFLAGS2
-rw-r--r--contrib/sendmail/src/alias.c5
-rw-r--r--contrib/sendmail/src/aliases.52
-rw-r--r--contrib/sendmail/src/arpadate.c2
-rw-r--r--contrib/sendmail/src/clock.c2
-rw-r--r--contrib/sendmail/src/collect.c14
-rw-r--r--contrib/sendmail/src/conf.c267
-rw-r--r--contrib/sendmail/src/conf.h90
-rw-r--r--contrib/sendmail/src/control.c356
-rw-r--r--contrib/sendmail/src/convtime.c2
-rw-r--r--contrib/sendmail/src/daemon.c177
-rw-r--r--contrib/sendmail/src/deliver.c64
-rw-r--r--contrib/sendmail/src/domain.c14
-rw-r--r--contrib/sendmail/src/envelope.c4
-rw-r--r--contrib/sendmail/src/err.c4
-rw-r--r--contrib/sendmail/src/headers.c127
-rw-r--r--contrib/sendmail/src/ldap_map.h4
-rw-r--r--contrib/sendmail/src/macro.c6
-rw-r--r--contrib/sendmail/src/mailq.12
-rw-r--r--contrib/sendmail/src/mailstats.h2
-rw-r--r--contrib/sendmail/src/main.c151
-rwxr-xr-xcontrib/sendmail/src/makesendmail513
-rw-r--r--contrib/sendmail/src/map.c189
-rw-r--r--contrib/sendmail/src/mci.c16
-rw-r--r--contrib/sendmail/src/mime.c28
-rw-r--r--contrib/sendmail/src/newaliases.12
-rw-r--r--contrib/sendmail/src/parseaddr.c18
-rw-r--r--contrib/sendmail/src/pathnames.h2
-rw-r--r--contrib/sendmail/src/queue.c47
-rw-r--r--contrib/sendmail/src/readcf.c80
-rw-r--r--contrib/sendmail/src/recipient.c18
-rw-r--r--contrib/sendmail/src/safefile.c16
-rw-r--r--contrib/sendmail/src/savemail.c11
-rw-r--r--contrib/sendmail/src/sendmail.87
-rw-r--r--contrib/sendmail/src/sendmail.h27
-rw-r--r--contrib/sendmail/src/sendmail.hf7
-rw-r--r--contrib/sendmail/src/snprintf.c10
-rw-r--r--contrib/sendmail/src/srvrsmtp.c52
-rw-r--r--contrib/sendmail/src/stab.c2
-rw-r--r--contrib/sendmail/src/stats.c2
-rw-r--r--contrib/sendmail/src/sysexits.c2
-rw-r--r--contrib/sendmail/src/trace.c2
-rw-r--r--contrib/sendmail/src/udb.c99
-rw-r--r--contrib/sendmail/src/useful.h2
-rw-r--r--contrib/sendmail/src/usersmtp.c25
-rw-r--r--contrib/sendmail/src/util.c309
-rw-r--r--contrib/sendmail/src/version.c4
50 files changed, 1454 insertions, 1874 deletions
diff --git a/contrib/sendmail/src/Build b/contrib/sendmail/src/Build
new file mode 100755
index 0000000000000..ab8a49d78cac9
--- /dev/null
+++ b/contrib/sendmail/src/Build
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/src/Makefile.m4 b/contrib/sendmail/src/Makefile.m4
index ad9e1c911a526..f4229c2ad6b49 100644
--- a/contrib/sendmail/src/Makefile.m4
+++ b/contrib/sendmail/src/Makefile.m4
@@ -2,7 +2,7 @@
# This Makefile is designed to work on any reasonably current version of
# "make" program.
#
-# @(#)Makefile.m4 8.25 (Berkeley) 10/5/1998
+# @(#)Makefile.m4 8.23 (Berkeley) 6/16/98
#
# C compiler
@@ -68,9 +68,9 @@ COPTS= -I. ${INCDIRS} ${MAPDEF} ${ENVDEF}
CFLAGS= $O ${COPTS}
BEFORE= confBEFORE
-OBJS= alias.o arpadate.o clock.o collect.o conf.o control.o convtime.o \
- daemon.o deliver.o domain.o envelope.o err.o headers.o macro.o \
- main.o map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
+OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
+ deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
+ map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
safefile.o savemail.o snprintf.o srvrsmtp.o stab.o stats.o \
sysexits.o trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
@@ -130,8 +130,7 @@ install: install-sendmail install-docs
install-sendmail: sendmail
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf \
- ${HFDIR}/sendmail.hf
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 sendmail.st \
${STDIR}/sendmail.st
diff --git a/contrib/sendmail/src/README b/contrib/sendmail/src/README
index 817b3a4f396f6..a6f7dcfd66401 100644
--- a/contrib/sendmail/src/README
+++ b/contrib/sendmail/src/README
@@ -8,7 +8,7 @@
# the sendmail distribution.
#
#
-# @(#)README 8.209 (Berkeley) 10/6/1998
+# @(#)README 8.206 (Berkeley) 6/30/98
#
This directory contains the source files for sendmail(TM).
@@ -844,12 +844,6 @@ Digital UNIX (formerly DEC OSF/1)
This warning can be ignored.
- Digital UNIX's linker checks /usr/ccs/lib/ before /usr/lib/.
- If you have installed a new version of BIND in /usr/include
- and /usr/lib, you will experience difficulties as Digital ships
- libresolv.a in /usr/ccs/lib/ as well. Be sure to replace both
- copies of libresolv.a.
-
IRIX
The header files on SGI IRIX are completely prototyped, and as
a result you can sometimes get some warning messages during
@@ -1078,13 +1072,6 @@ Linux
to LIBS. Data structures may change and you'd be asking for a
core dump.
-AIX 4.2
- The AIX m4 implements a different mechanism for ifdef which is
- inconsistent with other versions of m4. Therefore, it will not
- work properly with the sendmail Build architecture or m4
- configuration method. To work around this problem, please use
- GNU m4 from ftp://ftp.gnu.org/pub/gnu/.
-
AIX 3.x
This version of sendmail does not support MB, MG, and MR resource
records, which are supported by AIX sendmail.
@@ -1452,4 +1439,4 @@ version.c The version number and information about this
Eric Allman
-(Version 8.209, last update 10/6/1998 17:10:21)
+(Version 8.206, last update 6/30/98 22:08:36)
diff --git a/contrib/sendmail/src/TRACEFLAGS b/contrib/sendmail/src/TRACEFLAGS
index 04b9b3c584233..588714da7f237 100644
--- a/contrib/sendmail/src/TRACEFLAGS
+++ b/contrib/sendmail/src/TRACEFLAGS
@@ -1,4 +1,4 @@
-# @(#)TRACEFLAGS 8.21 (Berkeley) 4/27/1998
+# @(#)TRACEFLAGS 8.21 (Berkeley) 4/27/98
0, 1 main.c main skip background fork
0, 4 main.c main canonical name, UUCP node name, a.k.a.s
0, 15 main.c main print configuration
diff --git a/contrib/sendmail/src/alias.c b/contrib/sendmail/src/alias.c
index a7149f2f849b8..8da3317a3c1df 100644
--- a/contrib/sendmail/src/alias.c
+++ b/contrib/sendmail/src/alias.c
@@ -13,7 +13,7 @@
# include "sendmail.h"
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.96 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)alias.c 8.92 (Berkeley) 6/5/98";
#endif /* not lint */
@@ -382,7 +382,7 @@ aliaswait(map, ext, isopen)
/* database is out of date */
if (AutoRebuild && stb.st_ino != 0 &&
(stb.st_uid == geteuid() ||
- (geteuid() == 0 && stb.st_uid == TrustedUid)))
+ (geteuid() == 0 && stb.st_uid == TrustedFileUid)))
{
bool oldSuprErrs;
@@ -510,7 +510,6 @@ rebuildaliases(map, automatic)
username());
}
map->map_mflags |= MF_OPEN|MF_WRITABLE;
- map->map_pid = getpid();
readaliases(map, af, !automatic, TRUE);
success = TRUE;
}
diff --git a/contrib/sendmail/src/aliases.5 b/contrib/sendmail/src/aliases.5
index 513bf49fd9a76..3fa4d6ea2637d 100644
--- a/contrib/sendmail/src/aliases.5
+++ b/contrib/sendmail/src/aliases.5
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)aliases.5 8.8 (Berkeley) 5/19/1998
+.\" @(#)aliases.5 8.8 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt ALIASES 5
diff --git a/contrib/sendmail/src/arpadate.c b/contrib/sendmail/src/arpadate.c
index 1b539b6ce9980..7a9576bdd4d29 100644
--- a/contrib/sendmail/src/arpadate.c
+++ b/contrib/sendmail/src/arpadate.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)arpadate.c 8.12 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)arpadate.c 8.12 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/clock.c b/contrib/sendmail/src/clock.c
index aab301c2c921a..e81c9725d6e7e 100644
--- a/contrib/sendmail/src/clock.c
+++ b/contrib/sendmail/src/clock.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)clock.c 8.34 (Berkeley) 6/4/1998";
+static char sccsid[] = "@(#)clock.c 8.34 (Berkeley) 6/4/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/collect.c b/contrib/sendmail/src/collect.c
index e334e968e020f..190e6995743f8 100644
--- a/contrib/sendmail/src/collect.c
+++ b/contrib/sendmail/src/collect.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)collect.c 8.91 (Berkeley) 8/19/1998";
+static char sccsid[] = "@(#)collect.c 8.89 (Berkeley) 6/4/98";
#endif /* not lint */
# include <errno.h>
@@ -81,6 +81,7 @@ collect(fp, smtpmode, hdrp, e)
char dfname[MAXQFNAME];
char bufbuf[MAXLINE];
extern bool isheader __P((char *));
+ extern void eatheader __P((ENVELOPE *, bool));
extern void tferror __P((FILE *volatile, ENVELOPE *));
headeronly = hdrp != NULL;
@@ -100,7 +101,7 @@ collect(fp, smtpmode, hdrp, e)
{
syserr("Cannot create %s", dfname);
e->e_flags |= EF_NO_BODY_RETN;
- finis(TRUE, ExitStat);
+ finis();
}
if (fstat(fileno(tf), &stbuf) < 0)
e->e_dfino = -1;
@@ -158,6 +159,8 @@ collect(fp, smtpmode, hdrp, e)
for (;;)
{
+ extern int chompheader __P((char *, bool, HDR **, ENVELOPE *));
+
if (tTd(30, 35))
printf("top, istate=%d, mstate=%d\n", istate, mstate);
for (;;)
@@ -411,7 +414,7 @@ readerr:
{
tferror(tf, e);
flush_errors(TRUE);
- finis(TRUE, ExitStat);
+ finis();
}
/* An EOF when running SMTP is an error */
@@ -453,7 +456,7 @@ readerr:
/* and don't try to deliver the partial message either */
if (InChild)
ExitStat = EX_QUIT;
- finis(TRUE, ExitStat);
+ finis();
}
/*
@@ -501,6 +504,7 @@ readerr:
/* no valid recipient headers */
register ADDRESS *q;
char *hdr = NULL;
+ extern void addheader __P((char *, char *, HDR **));
/* create an Apparently-To: field */
/* that or reject the message.... */
@@ -573,7 +577,7 @@ readerr:
{
/* we haven't acked receipt yet, so just chuck this */
syserr("Cannot reopen %s", dfname);
- finis(TRUE, ExitStat);
+ finis();
}
}
diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c
index 82e7543f10479..838cd17d23561 100644
--- a/contrib/sendmail/src/conf.c
+++ b/contrib/sendmail/src/conf.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)conf.c 8.450 (Berkeley) 12/17/1998";
+static char sccsid[] = "@(#)conf.c 8.431 (Berkeley) 6/25/98";
#endif /* not lint */
# include "sendmail.h"
@@ -217,6 +217,7 @@ setdefaults(e)
int i;
struct passwd *pw;
char buf[MAXNAME];
+ extern void inittimeouts __P((char *));
extern void setdefuser __P((void));
extern void setupmaps __P((void));
extern void setupmailers __P((void));
@@ -246,7 +247,7 @@ setdefaults(e)
DefGid = 1; /* option g */
setdefuser();
}
- TrustedUid = 0;
+ TrustedFileUid = 0;
if (tTd(37, 4))
printf("setdefaults: DefUser=%s, DefUid=%d, DefGid=%d\n",
DefUser != NULL ? DefUser : "<1:1>",
@@ -291,7 +292,6 @@ setdefaults(e)
#ifdef HESIOD_INIT
HesiodContext = NULL;
#endif
- ControlSocketName = NULL;
setupmaps();
setupmailers();
setupheaders();
@@ -324,6 +324,7 @@ void
setupmailers()
{
char buf[100];
+ extern void makemailer __P((char *));
strcpy(buf, "prog, P=/bin/sh, F=lsoDq9, T=DNS/RFC822/X-Unix, A=sh -c \201u");
makemailer(buf);
@@ -837,14 +838,6 @@ switch_map_find(service, maptype, mapreturn)
*p++ = '\0';
if (buf[0] == '\0')
continue;
- if (p == NULL)
- {
- sm_syslog(LOG_ERR, NOQID,
- "Bad line on %.100s: %.100s",
- ServiceSwitchFile,
- buf);
- continue;
- }
while (isspace(*p))
p++;
if (*p == '\0')
@@ -1287,10 +1280,10 @@ init_md(argc, argv)
#endif
#ifdef __QNX__
/*
- ** Due to QNX's network distributed nature, you can target a tcpip
- ** stack on a different node in the qnx network; this patch lets
- ** this feature work. The __sock_locate() must be done before the
- ** environment is clear.
+ ** Due to QNX's network distributed nature, you can target a tcpip
+ ** stack on a different node in the qnx network; this patch lets
+ ** this feature work. The __sock_locate() must be done before the
+ ** environment is clear.
*/
__sock_locate();
#endif
@@ -2054,7 +2047,7 @@ refuseconnections(port)
else if (conncnt++ > ConnRateThrottle && ConnRateThrottle > 0)
{
/* sleep to flatten out connection load */
- sm_setproctitle(TRUE, "deferring connections on port %d: %d per second",
+ setproctitle("deferring connections on port %d: %d per second",
port, ConnRateThrottle);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2066,7 +2059,7 @@ refuseconnections(port)
CurrentLA = getla();
if (CurrentLA >= refusela)
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: load average: %d",
+ setproctitle("rejecting connections on port %d: load average: %d",
port, CurrentLA);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2077,7 +2070,7 @@ refuseconnections(port)
if (!enoughdiskspace(MinBlocksFree + 1))
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: min free: %d",
+ setproctitle("rejecting connections on port %d: min free: %d",
port, MinBlocksFree);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2088,10 +2081,12 @@ refuseconnections(port)
if (MaxChildren > 0 && CurChildren >= MaxChildren)
{
+ extern void proc_list_probe __P((void));
+
proc_list_probe();
if (CurChildren >= MaxChildren)
{
- sm_setproctitle(TRUE, "rejecting connections on port %d: %d children, max %d",
+ setproctitle("rejecting connections on port %d: %d children, max %d",
port, CurChildren, MaxChildren);
if (LogLevel >= 14)
sm_syslog(LOG_INFO, NOQID,
@@ -2175,12 +2170,12 @@ typedef unsigned int *pt_entry_t;
# define SPT_PADCHAR ' '
# endif
-#endif /* SPT_TYPE != SPT_NONE && SPT_TYPE != SPT_BUILTIN */
-
# ifndef SPT_BUFSIZE
# define SPT_BUFSIZE MAXLINE
# endif
+#endif /* SPT_TYPE != SPT_NONE && SPT_TYPE != SPT_BUILTIN */
+
/*
** Pointers for setproctitle.
** This allows "ps" listings to give more useful information.
@@ -2325,44 +2320,6 @@ setproctitle(fmt, va_alist)
#endif /* SPT_TYPE != SPT_BUILTIN */
/*
-** SM_SETPROCTITLE -- set process task and set process title for ps
-**
-** Possibly set process status and call setproctitle() to
-** change the ps display.
-**
-** Parameters:
-** status -- whether or not to store as process status
-** fmt -- a printf style format string.
-** a, b, c -- possible parameters to fmt.
-**
-** Returns:
-** none.
-*/
-
-/*VARARGS2*/
-void
-# ifdef __STDC__
-sm_setproctitle(bool status, const char *fmt, ...)
-# else
-sm_setproctitle(status, fmt, va_alist)
- bool status;
- const char *fmt;
- va_dcl
-#endif
-{
- char buf[SPT_BUFSIZE];
-
- VA_LOCAL_DECL
- /* print the argument string */
- VA_START(fmt);
- (void) vsnprintf(buf, SPT_BUFSIZE, fmt, ap);
- VA_END;
-
- if (status)
- proc_list_set(getpid(), buf);
- setproctitle("%s", buf);
-}
- /*
** WAITFOR -- wait for a particular process id.
**
** Parameters:
@@ -2832,8 +2789,8 @@ dgux_inet_addr(host)
/*
-** this version hacked to add `atend' flag to allow state machine
-** to reset if invoked by the program to scan args for a 2nd time
+** this version hacked to add `atend' flag to allow state machine
+** to reset if invoked by the program to scan args for a 2nd time
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -3005,7 +2962,7 @@ char *DefaultUserShells[] =
"/bin/bsh", /* Bourne shell */
"/usr/bin/bsh",
#endif
-#if defined(__svr4__) || defined(__svr5__)
+#ifdef __svr4__
"/bin/ksh", /* Korn shell */
"/usr/bin/ksh",
#endif
@@ -3708,63 +3665,9 @@ setvendor(vendor)
}
#endif
-#if defined(VENDOR_NAME) && defined(VENDOR_CODE)
- if (strcasecmp(vendor, VENDOR_NAME) == 0)
- {
- VendorCode = VENDOR_CODE;
- return TRUE;
- }
-#endif
-
return FALSE;
}
/*
-** GETVENDOR -- return vendor name based on vendor code
-**
-** Parameters:
-** vendorcode -- numeric representation of vendor.
-**
-** Returns:
-** string containing vendor name.
-*/
-
-char *
-getvendor(vendorcode)
- int vendorcode;
-{
-#if defined(VENDOR_NAME) && defined(VENDOR_CODE)
- /*
- ** Can't have the same switch case twice so need to
- ** handle VENDOR_CODE outside of switch. It might
- ** match one of the existing VENDOR_* codes.
- */
-
- if (vendorcode == VENDOR_CODE)
- return VENDOR_NAME;
-#endif
-
- switch (vendorcode)
- {
- case VENDOR_BERKELEY:
- return "Berkeley";
-
- case VENDOR_SUN:
- return "Sun";
-
- case VENDOR_HP:
- return "HP";
-
- case VENDOR_IBM:
- return "IBM";
-
- case VENDOR_SENDMAIL:
- return "Sendmail";
-
- default:
- return "Unknown";
- }
-}
- /*
** VENDOR_PRE_DEFAULTS, VENDOR_POST_DEFAULTS -- set vendor-specific defaults
**
** Vendor_pre_defaults is called before reading the configuration
@@ -3827,7 +3730,7 @@ vendor_daemon_setup(e)
if (getluid() != -1)
{
usrerr("Daemon cannot have LUID");
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
#endif /* SECUREWARE */
}
@@ -4270,88 +4173,11 @@ secureware_setup_secure(uid)
rc, uid);
break;
}
- finis(FALSE, EX_NOPERM);
+ exit(EX_NOPERM);
}
}
#endif /* SECUREWARE */
/*
-** ADD_LOCAL_HOST_NAMES -- Add a hostname to class 'w' based on IP address
-**
-** Add hostnames to class 'w' based on the IP address read from
-** the network interface.
-**
-** Parameters:
-** sa -- a pointer to a SOCKADDR containing the address
-**
-** Returns:
-** 0 if successful, -1 if host lookup fails.
-*/
-
-int
-add_hostnames(sa)
- SOCKADDR *sa;
-{
- struct hostent *hp;
-
- /* lookup name with IP address */
- switch (sa->sa.sa_family)
- {
- case AF_INET:
- hp = sm_gethostbyaddr((char *) &sa->sin.sin_addr,
- sizeof(sa->sin.sin_addr), sa->sa.sa_family);
- break;
-
- default:
-#if _FFR_LOG_UNSUPPORTED_FAMILIES
- /* XXX: Give warning about unsupported family */
- if (LogLevel > 3)
- sm_syslog(LOG_WARNING, NOQID,
- "Unsupported address family %d: %.100s",
- sa->sa.sa_family, anynet_ntoa(sa));
-#endif
- return -1;
- }
-
- if (hp == NULL)
- {
- int save_errno = errno;
-
- if (LogLevel > 3)
- sm_syslog(LOG_WARNING, NOQID,
- "gethostbyaddr(%.100s) failed: %d\n",
- anynet_ntoa(sa),
-#if NAMED_BIND
- h_errno
-#else
- -1
-#endif
- );
- errno = save_errno;
- return -1;
- }
-
- /* save its cname */
- if (!wordinclass((char *) hp->h_name, 'w'))
- {
- setclass('w', (char *) hp->h_name);
- if (tTd(0, 4))
- printf("\ta.k.a.: %s\n", hp->h_name);
- }
-
- /* save all it aliases name */
- while (*hp->h_aliases)
- {
- if (!wordinclass(*hp->h_aliases, 'w'))
- {
- setclass('w', *hp->h_aliases);
- if (tTd(0, 4))
- printf("\ta.k.a.: %s\n", *hp->h_aliases);
- }
- hp->h_aliases++;
- }
- return 0;
-}
- /*
** LOAD_IF_NAMES -- load interface-specific names into $=w
**
** Parameters:
@@ -4428,8 +4254,9 @@ load_if_names()
for (i = 0; i < ifc.ifc_len; )
{
struct ifreq *ifr = (struct ifreq *) &ifc.ifc_buf[i];
- SOCKADDR *sa = (SOCKADDR *) &ifr->ifr_addr;
+ struct sockaddr *sa = &ifr->ifr_addr;
struct in_addr ia;
+ struct hostent *hp;
#ifdef SIOCGIFFLAGS
struct ifreq ifrf;
#endif
@@ -4437,14 +4264,14 @@ load_if_names()
extern char *inet_ntoa();
#ifdef BSD4_4_SOCKADDR
- if (sa->sa.sa_len > sizeof ifr->ifr_addr)
- i += sizeof ifr->ifr_name + sa->sa.sa_len;
+ if (sa->sa_len > sizeof ifr->ifr_addr)
+ i += sizeof ifr->ifr_name + sa->sa_len;
else
#endif
i += sizeof *ifr;
if (tTd(0, 20))
- printf("%s\n", anynet_ntoa(sa));
+ printf("%s\n", anynet_ntoa((SOCKADDR *) sa));
if (ifr->ifr_addr.sa_family != AF_INET)
continue;
@@ -4463,7 +4290,7 @@ load_if_names()
continue;
/* extract IP address from the list*/
- ia = sa->sin.sin_addr;
+ ia = (((struct sockaddr_in *) sa)->sin_addr);
if (ia.s_addr == INADDR_ANY || ia.s_addr == INADDR_NONE)
{
message("WARNING: interface %s is UP with %s address",
@@ -4473,7 +4300,7 @@ load_if_names()
/* save IP address in text from */
(void) snprintf(ip_addr, sizeof ip_addr, "[%.*s]",
- (int)sizeof ip_addr - 3,
+ sizeof ip_addr - 3,
inet_ntoa(ia));
if (!wordinclass(ip_addr, 'w'))
{
@@ -4486,7 +4313,41 @@ load_if_names()
if (bitset(IFF_LOOPBACK, IFRFREF.ifr_flags))
continue;
- (void) add_hostnames(sa);
+ /* lookup name with IP address */
+ hp = sm_gethostbyaddr((char *) &ia, sizeof(ia), AF_INET);
+ if (hp == NULL)
+ {
+ if (LogLevel > 3)
+ sm_syslog(LOG_WARNING, NOQID,
+ "gethostbyaddr(%.100s) failed: %d\n",
+ inet_ntoa(ia),
+#if NAMED_BIND
+ h_errno);
+#else
+ -1);
+#endif
+ continue;
+ }
+
+ /* save its cname */
+ if (!wordinclass((char *) hp->h_name, 'w'))
+ {
+ setclass('w', (char *) hp->h_name);
+ if (tTd(0, 4))
+ printf("\ta.k.a.: %s\n", hp->h_name);
+ }
+
+ /* save all it aliases name */
+ while (*hp->h_aliases)
+ {
+ if (!wordinclass(*hp->h_aliases, 'w'))
+ {
+ setclass('w', *hp->h_aliases);
+ if (tTd(0, 4))
+ printf("\ta.k.a.: %s\n", *hp->h_aliases);
+ }
+ hp->h_aliases++;
+ }
}
free(ifc.ifc_buf);
close(s);
@@ -4551,7 +4412,7 @@ sm_syslog(level, id, fmt, va_alist)
extern int SyslogErrno;
extern char *DoprEnd;
VA_LOCAL_DECL
- extern void sm_dopr __P((char *, const char *, va_list));
+ extern void sm_dopr __P((char *, const char *, ...));
SyslogErrno = errno;
if (id == NULL)
diff --git a/contrib/sendmail/src/conf.h b/contrib/sendmail/src/conf.h
index b9cdc6862caa5..a8ad46e2706f2 100644
--- a/contrib/sendmail/src/conf.h
+++ b/contrib/sendmail/src/conf.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)conf.h 8.380 (Berkeley) 11/9/1998
+ * @(#)conf.h 8.372 (Berkeley) 6/4/98
*/
/*
@@ -64,11 +64,6 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */
# define MACBUFSIZE 4096 /* max expanded macro buffer size */
# define TOBUFSIZE 512 /* max buffer to hold address list */
# define MAXSHORTSTR 203 /* max short string length */
-# if _FFR_MAX_MIME_HEADER_LENGTH
-# define MAXMACNAMELEN 25 /* max macro name length */
-# else
-# define MAXMACNAMELEN 20 /* max macro name length */
-# endif
/**********************************************************************
** Compilation options.
@@ -349,12 +344,12 @@ typedef int pid_t;
# define GIDSET_T gid_t
# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
# define SFS_BAVAIL f_bfree /* alternate field name */
-# define SYSLOG_BUFSIZE 512
# ifdef IRIX6
# define STAT64 1
# define QUAD_T unsigned long long
# define LA_TYPE LA_IRIX6 /* figure out at run time */
# define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */
+# define SYSLOG_BUFSIZE 512
# else
# define LA_TYPE LA_INT
@@ -679,41 +674,6 @@ typedef int pid_t;
#endif
-/*
-** Apple Rhapsody
-** Contributed by Wilfredo Sanchez <wsanchez@apple.com>
-*/
-
-#ifdef __APPLE__
-# define HASFCHMOD 1 /* has fchmod(2) syscall */
-# define HASFLOCK 1 /* has flock(2) syscall */
-# define HASUNAME 1 /* has uname(2) syscall */
-# define HASUNSETENV 1
-# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
-# define HASINITGROUPS 1
-# define HASSETVBUF 1
-# define HASSETREUID 1
-# define USESETEUID 1 /* has useable seteuid(2) call */
-# define HASLSTAT 1
-# define HASSETRLIMIT 1
-# define HASWAITPID 1
-# define HASSTRERROR 1 /* has strerror(3) */
-# define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */
-# define USESTRERROR 1 /* has strerror(3) */
-# define HASGETDTABLESIZE 1
-# define HASGETUSERSHELL 1
-# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
-# define BSD4_4_SOCKADDR /* has sa_len */
-# define NETLINK 1 /* supports AF_LINK */
-# define HAS_ST_GEN 1 /* has st_gen field in stat struct */
-# define GIDSET_T gid_t
-# define LA_TYPE LA_SUBR /* use getloadavg(3) */
-# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
-# define SPT_TYPE SPT_PSSTRINGS
-# define SPT_PADCHAR '\0' /* pad process title with nulls */
-# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
-#endif
-
/*
** 4.4 BSD
@@ -861,7 +821,7 @@ typedef int pid_t;
# define SPT_TYPE SPT_BUILTIN
# endif
# if __FreeBSD_version >= 222000 /* 2.2.2-release and later */
-# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
+# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
# endif
# endif
# ifndef SPT_TYPE
@@ -1259,9 +1219,9 @@ extern void *malloc();
** Florian La Roche <rzsfl@rz.uni-sb.de>
** Karl London <karl@borg.demon.co.uk>
**
-** Last compiled against: [07/21/98 @ 11:47:34 AM (Tuesday)]
-** sendmail 8.9.1 bind-8.1.2 db-2.4.14
-** gcc-2.8.1 glibc-2.0.94 linux-2.1.109
+** Last compiled against: [06/10/96 @ 09:21:40 PM (Monday)]
+** sendmail 8.8-a4 named bind-4.9.4-T4B db-1.85
+** gcc 2.7.2 libc-5.3.12 linux 2.0.0
**
** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
** file locking is no longer allowed. In particular, make sure
@@ -1271,7 +1231,6 @@ extern void *malloc();
#ifdef __linux__
# define BSD 1 /* include BSD defines */
-# define USESETEUID 0 /* Have it due to POSIX, but doesn't work */
# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
# define HASUNAME 1 /* use System V uname(2) system call */
# define HASUNSETENV 1 /* has unsetenv(3) call */
@@ -1299,7 +1258,7 @@ extern void *malloc();
# ifndef _PATH_SENDMAILPID
# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
# endif
-# define TZ_TYPE TZ_TZNAME
+# define TZ_TYPE TZ_TNAME
# include <sys/sysmacros.h>
# undef atol /* wounded in <stdlib.h> */
#endif
@@ -1528,37 +1487,6 @@ typedef int pid_t;
# endif
#endif
-/*
-** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatiblity Libs ie. native)
-**
-** Contributed by Paul Gampe <paulg@apnic.net>
-*/
-
-#ifdef __svr5__
-# include <sys/mkdev.h>
-# define __svr4__
-# define SYS5SIGNALS 1
-# define HASSETSID 1
-# define HASSETREUID 1
-# define HASWAITPID 1
-# define HASGETDTABLESIZE 1
-# define GIDSET_T gid_t
-# define SOCKADDR_LEN_T size_t
-# define SOCKOPT_LEN_T size_t
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/stand/unix"
-# endif
-# define SPT_PADCHAR '\0' /* pad process title with nulls */
-# define SYSLOG_BUFSIZE 1024 /* unsure */
-# ifndef _PATH_VENDOR_CF
-# define _PATH_VENDOR_CF "/etc/sendmail.cf"
-# endif
-# ifndef _PATH_SENDMAILPID
-# define _PATH_SENDMAILPID "/etc/sendmail.pid"
-# endif
-#endif
-
-/* ###################################################################### */
/*
** UnixWare 2.x
@@ -1591,9 +1519,7 @@ typedef int pid_t;
# define LA_TYPE LA_ZERO
# undef WIFEXITED
# undef WEXITSTATUS
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/unix"
-# endif
+# define _PATH_UNIX "/unix"
# ifndef _PATH_VENDOR_CF
# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
# endif
diff --git a/contrib/sendmail/src/control.c b/contrib/sendmail/src/control.c
deleted file mode 100644
index 157ca08548ec5..0000000000000
--- a/contrib/sendmail/src/control.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 1998 Sendmail, Inc. All rights reserved.
- *
- * By using this file, you agree to the terms and conditions set
- * forth in the LICENSE file which can be found at the top level of
- * the sendmail distribution.
- *
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)control.c 8.17 (Berkeley) 12/1/1998";
-#endif /* not lint */
-
-#include "sendmail.h"
-
-int ControlSocket = -1;
-
- /*
-** OPENCONTROLSOCKET -- create/open the daemon control named socket
-**
-** Creates and opens a named socket for external control over
-** the sendmail daemon.
-**
-** Parameters:
-** none.
-**
-** Returns:
-** 0 if successful, -1 otherwise
-*/
-
-int
-opencontrolsocket()
-{
-#ifdef NETUNIX
-# if _FFR_CONTROL_SOCKET
- int rval;
- int sff = SFF_SAFEDIRPATH|SFF_OPENASROOT|SFF_NOLINK|SFF_CREAT|SFF_MUSTOWN;
- struct sockaddr_un controladdr;
-
- if (ControlSocketName == NULL)
- return 0;
-
- if (strlen(ControlSocketName) >= sizeof controladdr.sun_path)
- {
- errno = ENAMETOOLONG;
- return -1;
- }
-
- rval = safefile(ControlSocketName, RunAsUid, RunAsGid, RunAsUserName,
- sff, S_IRUSR|S_IWUSR, NULL);
-
- /* if not safe, don't create */
- if (rval != 0)
- {
- errno = rval;
- return -1;
- }
-
- ControlSocket = socket(AF_UNIX, SOCK_STREAM, 0);
- if (ControlSocket < 0)
- return -1;
-
- unlink(ControlSocketName);
- bzero(&controladdr, sizeof controladdr);
- controladdr.sun_family = AF_UNIX;
- strcpy(controladdr.sun_path, ControlSocketName);
-
- if (bind(ControlSocket, (struct sockaddr *) &controladdr,
- sizeof controladdr) < 0)
- {
- int save_errno = errno;
-
- (void) close(ControlSocket);
- ControlSocket = -1;
- errno = save_errno;
- return -1;
- }
-
-# if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
- {
- if (chown(ControlSocketName, TrustedUid, -1) < 0)
- {
- int save_errno = errno;
-
- sm_syslog(LOG_ALERT, NOQID,
- "ownership change on %s failed: %s",
- ControlSocketName, errstring(save_errno));
- message("050 ownership change on %s failed: %s",
- ControlSocketName, errstring(save_errno));
- errno = save_errno;
- return -1;
- }
- }
-# endif
-
- if (chmod(ControlSocketName, S_IRUSR|S_IWUSR) < 0)
- {
- int save_errno = errno;
-
- closecontrolsocket(TRUE);
- errno = save_errno;
- return -1;
- }
-
- if (listen(ControlSocket, 8) < 0)
- {
- int save_errno = errno;
-
- closecontrolsocket(TRUE);
- errno = save_errno;
- return -1;
- }
-# endif
-#endif
- return 0;
-}
- /*
-** CLOSECONTROLSOCKET -- close the daemon control named socket
-**
-** Close a named socket.
-**
-** Parameters:
-** fullclose -- if set, close the socket and remove it;
-** otherwise, just remove it
-**
-** Returns:
-** none.
-*/
-
-void
-closecontrolsocket(fullclose)
- bool fullclose;
-{
-#ifdef NETUNIX
-# if _FFR_CONTROL_SOCKET
- int sff = SFF_SAFEDIRPATH|SFF_OPENASROOT|SFF_NOLINK|SFF_CREAT|SFF_MUSTOWN;
-
- if (ControlSocket >= 0)
- {
- int rval;
-
- if (fullclose)
- {
- (void) close(ControlSocket);
- ControlSocket = -1;
- }
-
- rval = safefile(ControlSocketName, RunAsUid, RunAsGid, RunAsUserName,
- sff, S_IRUSR|S_IWUSR, NULL);
-
- /* if not safe, don't unlink */
- if (rval != 0)
- return;
-
- if (unlink(ControlSocketName) < 0)
- {
- sm_syslog(LOG_WARNING, NOQID,
- "Could not remove control socket: %s",
- errstring(errno));
- return;
- }
- }
-# endif
-#endif
- return;
-}
- /*
-** CLRCONTROL -- reset the control connection
-**
-** Parameters:
-** none.
-**
-** Returns:
-** none.
-**
-** Side Effects:
-** releases any resources used by the control interface.
-*/
-
-void
-clrcontrol()
-{
-#ifdef NETUNIX
-# if _FFR_CONTROL_SOCKET
- if (ControlSocket >= 0)
- (void) close(ControlSocket);
- ControlSocket = -1;
-# endif
-#endif
-}
-
-#ifndef NOT_SENDMAIL
-
- /*
-** CONTROL_COMMAND -- read and process command from named socket
-**
-** Read and process the command from the opened socket.
-** Return the results down the same socket.
-**
-** Parameters:
-** sock -- the opened socket from getrequests()
-** e -- the current envelope
-**
-** Returns:
-** none.
-*/
-
-struct cmd
-{
- char *cmdname; /* command name */
- int cmdcode; /* internal code, see below */
-};
-
-/* values for cmdcode */
-# define CMDERROR 0 /* bad command */
-# define CMDRESTART 1 /* restart daemon */
-# define CMDSHUTDOWN 2 /* end daemon */
-# define CMDHELP 3 /* help */
-# define CMDSTATUS 4 /* daemon status */
-
-static struct cmd CmdTab[] =
-{
- { "help", CMDHELP },
- { "restart", CMDRESTART },
- { "shutdown", CMDSHUTDOWN },
- { "status", CMDSTATUS },
- { NULL, CMDERROR }
-};
-
-void
-control_command(sock, e)
- int sock;
- ENVELOPE *e;
-{
- FILE *s;
- FILE *traffic;
- FILE *oldout;
- char *cmd;
- char *p;
- struct cmd *c;
- char cmdbuf[MAXLINE];
- char inp[MAXLINE];
- extern char **SaveArgv;
- extern void help __P((char *));
-
- sm_setproctitle(FALSE, "control cmd read");
-
- s = fdopen(sock, "r+");
- if (s == NULL)
- {
- int save_errno = errno;
-
- close(sock);
- errno = save_errno;
- return;
- }
- setbuf(s, NULL);
-
- if (fgets(inp, sizeof inp, s) == NULL)
- {
- fclose(s);
- return;
- }
- (void) fflush(s);
-
- /* clean up end of line */
- fixcrlf(inp, TRUE);
-
- sm_setproctitle(FALSE, "control: %s", inp);
-
- /* break off command */
- for (p = inp; isascii(*p) && isspace(*p); p++)
- continue;
- cmd = cmdbuf;
- while (*p != '\0' &&
- !(isascii(*p) && isspace(*p)) &&
- cmd < &cmdbuf[sizeof cmdbuf - 2])
- *cmd++ = *p++;
- *cmd = '\0';
-
- /* throw away leading whitespace */
- while (isascii(*p) && isspace(*p))
- p++;
-
- /* decode command */
- for (c = CmdTab; c->cmdname != NULL; c++)
- {
- if (!strcasecmp(c->cmdname, cmdbuf))
- break;
- }
-
- switch (c->cmdcode)
- {
- case CMDHELP: /* get help */
- traffic = TrafficLogFile;
- TrafficLogFile = NULL;
- oldout = OutChannel;
- OutChannel = s;
- help("control");
- TrafficLogFile = traffic;
- OutChannel = oldout;
- break;
-
- case CMDRESTART: /* restart the daemon */
- if (SaveArgv[0][0] != '/')
- {
- fprintf(s, "ERROR: could not restart: need full path\r\n");
- break;
- }
- if (LogLevel > 3)
- sm_syslog(LOG_INFO, NOQID,
- "restarting %s on due to control command",
- SaveArgv[0]);
- closecontrolsocket(FALSE);
- if (drop_privileges(TRUE) != EX_OK)
- {
- if (LogLevel > 0)
- sm_syslog(LOG_ALERT, NOQID,
- "could not set[ug]id(%d, %d): %m",
- RunAsUid, RunAsGid);
-
- fprintf(s, "ERROR: could not set[ug]id(%d, %d): %s, exiting...\r\n",
- (int)RunAsUid, (int)RunAsGid, errstring(errno));
- finis(FALSE, EX_OSERR);
- }
- fprintf(s, "OK\r\n");
- clrcontrol();
- (void) fcntl(sock, F_SETFD, 1);
- execve(SaveArgv[0], (ARGV_T) SaveArgv, (ARGV_T) ExternalEnviron);
- if (LogLevel > 0)
- sm_syslog(LOG_ALERT, NOQID, "could not exec %s: %m",
- SaveArgv[0]);
- fprintf(s, "ERROR: could not exec %s: %s, exiting...\r\n",
- SaveArgv[0], errstring(errno));
- finis(FALSE, EX_OSFILE);
- break;
-
- case CMDSHUTDOWN: /* kill the daemon */
- fprintf(s, "OK\r\n");
- finis(FALSE, EX_OK);
- break;
-
- case CMDSTATUS: /* daemon status */
- proc_list_probe();
- fprintf(s, "%d/%d\r\n", CurChildren, MaxChildren);
- proc_list_display(s);
- break;
-
- case CMDERROR: /* unknown command */
- fprintf(s, "Bad command (%s)\r\n", cmdbuf);
- break;
- }
- fclose(s);
-}
-#endif
diff --git a/contrib/sendmail/src/convtime.c b/contrib/sendmail/src/convtime.c
index ab8591d970eef..02c287b137225 100644
--- a/contrib/sendmail/src/convtime.c
+++ b/contrib/sendmail/src/convtime.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)convtime.c 8.14 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)convtime.c 8.14 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c
index b74a7a72efe83..dc0b5b5bd2d5e 100644
--- a/contrib/sendmail/src/daemon.c
+++ b/contrib/sendmail/src/daemon.c
@@ -15,9 +15,9 @@
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.234 (Berkeley) 12/17/1998 (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.220 (Berkeley) 6/24/98 (with daemon mode)";
#else
-static char sccsid[] = "@(#)daemon.c 8.234 (Berkeley) 12/17/1998 (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.220 (Berkeley) 6/24/98 (without daemon mode)";
#endif
#endif /* not lint */
@@ -103,22 +103,15 @@ getrequests(e)
ENVELOPE *e;
{
int t;
- time_t refuse_connections_until = 0;
- bool firsttime = TRUE;
+ bool refusingconnections = TRUE;
FILE *pidf;
- int sff;
int socksize;
u_short port;
#if XDEBUG
bool j_has_dot;
#endif
- char status[MAXLINE];
extern void reapchild __P((int));
-#ifdef NETUNIX
- extern int ControlSocket;
-#endif
extern int opendaemonsocket __P((bool));
- extern int opencontrolsocket __P((void));
/*
** Set up the address for the mailer.
@@ -176,18 +169,11 @@ getrequests(e)
/* get a socket for the SMTP connection */
socksize = opendaemonsocket(TRUE);
- if (opencontrolsocket() < 0)
- sm_syslog(LOG_WARNING, NOQID,
- "daemon could not open control socket: %s",
- errstring(errno));
-
(void) setsignal(SIGCHLD, reapchild);
/* write the pid to the log file for posterity */
- sff = SFF_NOLINK|SFF_ROOTOK|SFF_REGONLY|SFF_CREAT;
- if (TrustedUid != 0 && RealUid == TrustedUid)
- sff |= SFF_OPENASROOT;
- pidf = safefopen(PidFile, O_WRONLY|O_TRUNC, 0644, sff);
+ pidf = safefopen(PidFile, O_WRONLY|O_TRUNC, 0644,
+ SFF_NOLINK|SFF_ROOTOK|SFF_REGONLY|SFF_CREAT);
if (pidf == NULL)
{
sm_syslog(LOG_ERR, NOQID, "unable to write %s", PidFile);
@@ -215,9 +201,6 @@ getrequests(e)
}
#endif
- /* Add parent process as first item */
- proc_list_add(getpid(), "Sendmail daemon");
-
if (tTd(15, 1))
printf("getrequests: %d\n", DaemonSocket);
@@ -225,34 +208,30 @@ getrequests(e)
{
register pid_t pid;
auto SOCKADDR_LEN_T lotherend;
- bool timedout = FALSE;
- bool control = FALSE;
int savederrno;
int pipefd[2];
extern bool refuseconnections __P((int));
/* see if we are rejecting connections */
(void) blocksignal(SIGALRM);
- if (curtime() >= refuse_connections_until)
+ if (refuseconnections(ntohs(port)))
{
- if (refuseconnections(ntohs(port)))
- {
- if (DaemonSocket >= 0)
- {
- /* close socket so peer fails quickly */
- (void) close(DaemonSocket);
- DaemonSocket = -1;
- }
-
- /* refuse connections for next 15 seconds */
- refuse_connections_until = curtime() + 15;
- }
- else if (DaemonSocket < 0 || firsttime)
+ if (DaemonSocket >= 0)
{
- /* arrange to (re)open the socket if needed */
- (void) opendaemonsocket(FALSE);
- firsttime = FALSE;
+ /* close socket so peer will fail quickly */
+ (void) close(DaemonSocket);
+ DaemonSocket = -1;
}
+ refusingconnections = TRUE;
+ sleep(15);
+ continue;
+ }
+
+ /* arrange to (re)open the socket if necessary */
+ if (refusingconnections)
+ {
+ (void) opendaemonsocket(FALSE);
+ refusingconnections = FALSE;
}
#if XDEBUG
@@ -279,6 +258,9 @@ getrequests(e)
}
#endif
+ /* wait for a connection */
+ setproctitle("accepting connections on port %d",
+ ntohs(port));
#if 0
/*
** Andrew Sun <asun@ieps-sun.ml.com> claims that this will
@@ -286,97 +268,34 @@ getrequests(e)
** so is it worth doing this?
*/
- if (DaemonSocket >= 0 &&
- SetNonBlocking(DaemonSocket, FALSE) < 0)
+ if (SetNonBlocking(DaemonSocket, FALSE) < 0)
log an error here;
#endif
(void) releasesignal(SIGALRM);
for (;;)
{
- int highest = -1;
fd_set readfds;
struct timeval timeout;
FD_ZERO(&readfds);
-
- /* wait for a connection */
- if (DaemonSocket >= 0)
- {
- sm_setproctitle(TRUE,
- "accepting connections on port %d",
- ntohs(port));
- if (DaemonSocket > highest)
- highest = DaemonSocket;
- FD_SET(DaemonSocket, &readfds);
- }
-#ifdef NETUNIX
- if (ControlSocket >= 0)
- {
- if (ControlSocket > highest)
- highest = ControlSocket;
- FD_SET(ControlSocket, &readfds);
- }
-#endif
- if (DaemonSocket >= 0)
- timeout.tv_sec = 60;
- else
- timeout.tv_sec = 5;
+ FD_SET(DaemonSocket, &readfds);
+ timeout.tv_sec = 60;
timeout.tv_usec = 0;
- t = select(highest + 1, FDSET_CAST &readfds,
- NULL, NULL, &timeout);
-
+ t = select(DaemonSocket + 1, FDSET_CAST &readfds,
+ NULL, NULL, &timeout);
if (DoQueueRun)
(void) runqueue(TRUE, FALSE);
- if (t <= 0)
- {
- timedout = TRUE;
- break;
- }
+ if (t <= 0 || !FD_ISSET(DaemonSocket, &readfds))
+ continue;
- control = FALSE;
errno = 0;
- if (DaemonSocket >= 0 &&
- FD_ISSET(DaemonSocket, &readfds))
- {
- lotherend = socksize;
- t = accept(DaemonSocket,
- (struct sockaddr *)&RealHostAddr,
- &lotherend);
- }
-#ifdef NETUNIX
- else if (ControlSocket >= 0 &&
- FD_ISSET(ControlSocket, &readfds))
- {
- struct sockaddr_un sa_un;
-
- lotherend = sizeof sa_un;
- t = accept(ControlSocket,
- (struct sockaddr *)&sa_un,
- &lotherend);
- control = TRUE;
- }
-#endif
+ lotherend = socksize;
+ t = accept(DaemonSocket,
+ (struct sockaddr *)&RealHostAddr, &lotherend);
if (t >= 0 || errno != EINTR)
break;
}
- if (timedout)
- {
- timedout = FALSE;
- continue;
- }
- if (control)
- {
- if (t >= 0)
- {
- extern void control_command __P((int, ENVELOPE *));
-
- control_command(t, e);
- }
- else
- syserr("getrequests: control accept");
- continue;
- }
savederrno = errno;
(void) blocksignal(SIGALRM);
if (t < 0)
@@ -387,6 +306,8 @@ getrequests(e)
/* arrange to re-open the socket next time around */
(void) close(DaemonSocket);
DaemonSocket = -1;
+ refusingconnections = TRUE;
+ sleep(5);
continue;
}
@@ -439,16 +360,12 @@ getrequests(e)
(void) setsignal(SIGCHLD, SIG_DFL);
(void) setsignal(SIGHUP, intsig);
(void) close(DaemonSocket);
- clrcontrol();
proc_list_clear();
- /* Add parent process as first child item */
- proc_list_add(getpid(), "daemon child");
-
/* don't schedule queue runs if we are told to ETRN */
QueueIntvl = 0;
- sm_setproctitle(TRUE, "startup with %s",
+ setproctitle("startup with %s",
anynet_ntoa(&RealHostAddr));
if (pipefd[0] != -1)
@@ -478,34 +395,36 @@ getrequests(e)
if (strlen(p) > (SIZE_T) MAXNAME)
p[MAXNAME] = '\0';
RealHostName = newstr(p);
- sm_setproctitle(TRUE, "startup with %s", p);
+ setproctitle("startup with %s", p);
if ((inchannel = fdopen(t, "r")) == NULL ||
(t = dup(t)) < 0 ||
(outchannel = fdopen(t, "w")) == NULL)
{
syserr("cannot open SMTP server channel, fd=%d", t);
- finis(FALSE, EX_OK);
+ exit(EX_OK);
}
InChannel = inchannel;
OutChannel = outchannel;
DisConnected = FALSE;
+ /* open maps for check_relay ruleset */
+ initmaps(FALSE, e);
+
#ifdef XLA
if (!xla_host_ok(RealHostName))
{
message("421 Too many SMTP sessions for this host");
- finis(FALSE, EX_OK);
+ exit(EX_OK);
}
#endif
+
break;
}
/* parent -- keep track of children */
- snprintf(status, MAXLINE, "SMTP server child for %s",
- anynet_ntoa(&RealHostAddr));
- proc_list_add(pid, status);
+ proc_list_add(pid);
(void) releasesignal(SIGCHLD);
/* close the read end of the synchronization pipe */
@@ -633,7 +552,7 @@ opendaemonsocket(firsttime)
return socksize;
} while (ntries++ < MAXOPENTRIES && transienterror(saveerrno));
syserr("!opendaemonsocket: server SMTP socket wedged: exiting");
- /*NOTREACHED*/
+ finis();
return -1; /* avoid compiler warning on IRIX */
}
/*
@@ -1361,7 +1280,7 @@ getauthinfo(fd, may_be_forged)
/* translate that to a host name */
RealHostName = newstr(hostnamebyanyaddr(&RealHostAddr));
if (strlen(RealHostName) > MAXNAME)
- RealHostName[MAXNAME] = '\0';
+ RealHostName[MAXNAME - 1] = '\0';
}
/* cross check RealHostName with forward DNS lookup */
@@ -1369,8 +1288,8 @@ getauthinfo(fd, may_be_forged)
RealHostName[0] == '[')
{
/*
- ** address is not a socket or have an
- ** IP address with no forward lookup
+ ** address is not a socket or have an
+ ** IP address with no forward lookup
*/
*may_be_forged = FALSE;
}
diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c
index e70f17e675aaf..0e5eb07299057 100644
--- a/contrib/sendmail/src/deliver.c
+++ b/contrib/sendmail/src/deliver.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)deliver.c 8.366 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)deliver.c 8.353 (Berkeley) 6/30/98";
#endif /* not lint */
#include "sendmail.h"
@@ -360,7 +360,7 @@ sendall(e, mode)
if (mode != SM_VERIFY && bitset(EF_HAS_DF, e->e_flags))
dup_queue_file(e, ee, 'd');
openxscript(ee);
- if (mode != SM_VERIFY && LogLevel > 4)
+ if (LogLevel > 4)
sm_syslog(LOG_INFO, ee->e_id,
"clone %s, owner=%s",
e->e_id, owner);
@@ -552,7 +552,7 @@ sendall(e, mode)
# else
e->e_id = NULL;
# endif /* HASFLOCK */
- finis(TRUE, ExitStat);
+ finis();
}
/* be sure to give error messages in child */
@@ -570,15 +570,6 @@ sendall(e, mode)
mci_flush(FALSE, NULL);
- /*
- ** Since the delivery may happen in a child and the parent
- ** does not wait, the parent may close the maps thereby
- ** removing any shared memory used by the map. Therefore,
- ** open a copy of the maps for the delivery process.
- */
-
- initmaps(FALSE, e);
-
# if HASFLOCK
break;
# else
@@ -595,7 +586,7 @@ sendall(e, mode)
ee->e_sibling = sibling;
}
(void) dowork(e->e_id, FALSE, FALSE, e);
- finis(TRUE, ExitStat);
+ finis();
# endif /* !HASFLOCK */
}
@@ -613,7 +604,7 @@ sendall(e, mode)
Verbose = oldverbose;
if (mode == SM_FORK)
- finis(TRUE, ExitStat);
+ finis();
}
void
@@ -1100,9 +1091,8 @@ deliver(e, firstto)
e->e_from.q_paddr, to->q_paddr, e);
if (rcode == EX_OK)
{
- /* do in-code checking if not discarding */
- if (!bitset(EF_DISCARD, e->e_flags))
- rcode = checkcompat(to, e);
+ /* do in-code checking */
+ rcode = checkcompat(to, e);
}
if (rcode != EX_OK)
{
@@ -1110,22 +1100,6 @@ deliver(e, firstto)
giveresponse(rcode, m, NULL, ctladdr, xstart, e);
continue;
}
- if (bitset(EF_DISCARD, e->e_flags))
- {
- if (tTd(10, 5))
- {
- printf("deliver: discarding recipient ");
- printaddr(to, FALSE);
- }
-
- /*
- ** Remove discard bit to prevent discard of
- ** future recipients
- */
- e->e_flags &= ~EF_DISCARD;
-
- continue;
- }
/*
** Strip quote bits from names if the mailer is dumb
@@ -1435,7 +1409,7 @@ tryhost:
}
/* try the connection */
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, hostbuf, "user open");
+ setproctitle("%s %s: %s", e->e_id, hostbuf, "user open");
if (port == 0)
message("Connecting to %s via %s...",
hostbuf, m->m_name);
@@ -2122,7 +2096,7 @@ do_transfer:
rcode = smtpgetstat(m, mci, e);
if (rcode == EX_OK)
{
- if (strlen(to->q_paddr) + strlen(tobuf) + 2 > sizeof tobuf)
+ if (strlen(to->q_paddr) + strlen(tobuf) + 2 >= sizeof tobuf)
{
syserr("LMTP tobuf overflow");
}
@@ -2853,7 +2827,7 @@ putfromline(mci, e)
char hname[MAXNAME];
/*
- ** If we can construct a UUCP path, do so
+ ** If we can construct a UUCP path, do so
*/
at = strrchr(buf, '@');
@@ -2908,7 +2882,6 @@ putbody(mci, e, separator)
char *separator;
{
char buf[MAXLINE];
- char *boundaries[MAXMIMENESTING + 1];
/*
** Output the body of the message
@@ -2950,6 +2923,8 @@ putbody(mci, e, separator)
#if MIME8TO7
if (bitset(MCIF_CVT8TO7, mci->mci_flags))
{
+ char *boundaries[MAXMIMENESTING + 1];
+
/*
** Do 8 to 7 bit MIME conversion.
*/
@@ -2977,13 +2952,6 @@ putbody(mci, e, separator)
mime7to8(mci, e->e_header, e);
}
# endif
- else if (MaxMimeHeaderLength > 0 || MaxMimeFieldLength > 0)
- {
- /* Use mime8to7 to check multipart for MIME header overflows */
- boundaries[0] = NULL;
- mci->mci_flags |= MCIF_INHEADER;
- mime8to7(mci, e->e_header, e, boundaries, M87F_OUTER|M87F_NO8TO7);
- }
else
#endif
{
@@ -2998,6 +2966,7 @@ putbody(mci, e, separator)
size_t eol_len;
char peekbuf[10];
+ /* we can pass it through unmodified */
if (bitset(MCIF_INHEADER, mci->mci_flags))
{
putline("", mci);
@@ -3323,7 +3292,6 @@ mailfile(filename, mailer, ctladdr, sfflags, e)
/* child -- actually write to file */
struct stat stb;
MCI mcibuf;
- int err;
volatile int oflags = O_WRONLY|O_APPEND;
if (e->e_lockfp != NULL)
@@ -3347,11 +3315,7 @@ mailfile(filename, mailer, ctladdr, sfflags, e)
ev = NULL;
#ifdef HASLSTAT
- if (bitset(DBS_FILEDELIVERYTOSYMLINK, DontBlameSendmail))
- err = stat(filename, &stb);
- else
- err = lstat(filename, &stb);
- if (err < 0)
+ if (lstat(filename, &stb) < 0)
#else
if (stat(filename, &stb) < 0)
#endif
diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c
index a279c0e69a963..e3a5500b55160 100644
--- a/contrib/sendmail/src/domain.c
+++ b/contrib/sendmail/src/domain.c
@@ -14,9 +14,9 @@
#ifndef lint
#if NAMED_BIND
-static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (with name server)";
+static char sccsid[] = "@(#)domain.c 8.77 (Berkeley) 6/4/98 (with name server)";
#else
-static char sccsid[] = "@(#)domain.c 8.80 (Berkeley) 12/17/1998 (without name server)";
+static char sccsid[] = "@(#)domain.c 8.77 (Berkeley) 6/4/98 (without name server)";
#endif
#endif /* not lint */
@@ -451,7 +451,7 @@ bestmx_map_lookup(map, name, av, statp)
int i, len = 0;
char *p;
char *mxhosts[MAXMXHOSTS + 1];
- char buf[PSBUFSIZE / 2];
+ char buf[MXHOSTBUFSIZE + 1];
_res.options &= ~(RES_DNSRCH|RES_DEFNAMES);
nmx = getmxrr(name, mxhosts, FALSE, &rcode);
@@ -464,8 +464,8 @@ bestmx_map_lookup(map, name, av, statp)
return map_rewrite(map, mxhosts[0], strlen(mxhosts[0]), av);
/*
- ** We were given a -z flag (return all MXs) and there are multiple
- ** ones. We need to build them all into a list.
+ ** We were given a -z flag (return all MXs) and there are multiple
+ ** ones. We need to build them all into a list.
*/
p = buf;
for (i = 0; i < nmx; i++)
@@ -663,7 +663,7 @@ cnameloop:
qtype = T_A;
continue;
}
- else if (qtype == T_A && !gotmx && (trymx || **dp == '\0'))
+ else if (qtype == T_A && !gotmx && trymx)
{
qtype = T_MX;
continue;
@@ -824,7 +824,7 @@ cnameloop:
if (qtype == T_ANY)
qtype = T_A;
- else if (qtype == T_A && !gotmx && (trymx || **dp == '\0'))
+ else if (qtype == T_A && !gotmx && trymx)
qtype = T_MX;
else
{
diff --git a/contrib/sendmail/src/envelope.c b/contrib/sendmail/src/envelope.c
index a17aa8c2dfcf2..092148a2a0cac 100644
--- a/contrib/sendmail/src/envelope.c
+++ b/contrib/sendmail/src/envelope.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.121 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)envelope.c 8.117 (Berkeley) 6/4/98";
#endif /* not lint */
#include "sendmail.h"
@@ -827,7 +827,7 @@ setsender(from, e, delimptr, delimchar, internal)
sm_syslog(LOG_NOTICE, e->e_id,
"cannot prescan from (%s)",
shortenstring(from, MAXSHORTSTR));
- finis(TRUE, ExitStat);
+ finis();
}
(void) rewrite(pvp, 3, 0, e);
(void) rewrite(pvp, 1, 0, e);
diff --git a/contrib/sendmail/src/err.c b/contrib/sendmail/src/err.c
index 38a357666958c..066139557a005 100644
--- a/contrib/sendmail/src/err.c
+++ b/contrib/sendmail/src/err.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)err.c 8.74 (Berkeley) 6/4/1998";
+static char sccsid[] = "@(#)err.c 8.74 (Berkeley) 6/4/98";
#endif /* not lint */
# include "sendmail.h"
@@ -216,7 +216,7 @@ usrerr(fmt, va_alist)
char buf[MAXLINE];
snprintf(buf, sizeof buf, "Postmaster warning: %.*s",
- (int)sizeof buf - 22, MsgBuf + 4);
+ sizeof buf - 22, MsgBuf + 4);
CurEnv->e_message = newstr(buf);
}
else
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c
index 500e375d6732e..a04f59e14f4d3 100644
--- a/contrib/sendmail/src/headers.c
+++ b/contrib/sendmail/src/headers.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)headers.c 8.134 (Berkeley) 11/29/1998";
+static char sccsid[] = "@(#)headers.c 8.127 (Berkeley) 6/4/98";
#endif /* not lint */
# include <errno.h>
@@ -521,8 +521,8 @@ eatheader(e, full)
#if 0
/*
- ** Change functionality so a fatal error on an
- ** address doesn't affect the entire envelope.
+ ** Change functionality so a fatal error on an
+ ** address doesn't affect the entire envelope.
*/
/* delete fatal errors generated by this address */
@@ -1198,59 +1198,6 @@ putheader(mci, hdr, e)
xputs(p);
}
-#if _FFR_MAX_MIME_HEADER_LENGTH
- /* heuristic shortening of MIME fields to avoid MUA overflows */
- if (MaxMimeFieldLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMEFieldHeaders}", NULL)))
- {
- extern bool fix_mime_header __P((char *));
-
- if (fix_mime_header(h->h_value))
- {
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated MIME %s header due to field size (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated MIME %s header due to field size (possible attack)\n",
- h->h_field);
- }
- }
-
- if (MaxMimeHeaderLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMETextHeaders}", NULL)))
- {
- if (strlen(h->h_value) > MaxMimeHeaderLength)
- {
- h->h_value[MaxMimeHeaderLength - 1] = '\0';
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated long MIME %s header (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated long MIME %s header (possible attack)\n",
- h->h_field);
- }
- }
-
- if (MaxMimeHeaderLength > 0 &&
- wordinclass(h->h_field,
- macid("{checkMIMEHeaders}", NULL)))
- {
- extern bool shorten_rfc822_string __P((char *, int));
-
- if (shorten_rfc822_string(h->h_value, MaxMimeHeaderLength))
- {
- sm_syslog(LOG_ALERT, e->e_id,
- "Truncated long MIME %s header (possible attack)",
- h->h_field);
- if (tTd(34, 11))
- printf(" truncated long MIME %s header (possible attack)\n",
- h->h_field);
- }
- }
-#endif
-
/* suppress Content-Transfer-Encoding: if we are MIMEing */
if (bitset(H_CTE, h->h_flags) &&
bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags))
@@ -1418,7 +1365,7 @@ put_vanilla_header(h, v, mci)
*obp++ = ' ';
}
snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
- (int)(sizeof obuf - (obp - obuf) - 1), v);
+ sizeof obuf - (obp - obuf) - 1, v);
putxline(obuf, strlen(obuf), mci, putflags);
}
/*
@@ -1621,69 +1568,3 @@ copyheader(header)
return ret;
}
- /*
-** FIX_MIME_HEADER -- possibly truncate/rebalance parameters in a MIME header
-**
-** Run through all of the parameters of a MIME header and
-** possibly truncate and rebalance the parameter according
-** to MaxMimeFieldLength.
-**
-** Parameters:
-** string -- the full header
-**
-** Returns:
-** TRUE if the header was modified, FALSE otherwise
-**
-** Side Effects:
-** string modified in place
-*/
-
-bool
-fix_mime_header(string)
- char *string;
-{
- bool modified = FALSE;
- char *begin = string;
- char *end;
- extern char *find_character __P((char *, char));
- extern bool shorten_rfc822_string __P((char *, int));
-
- if (string == NULL || *string == '\0')
- return FALSE;
-
- /* Split on each ';' */
- while ((end = find_character(begin, ';')) != NULL)
- {
- char save = *end;
- char *bp;
-
- *end = '\0';
-
- /* Shorten individual parameter */
- if (shorten_rfc822_string(begin, MaxMimeFieldLength))
- modified = TRUE;
-
- /* Collapse the possibly shortened string with rest */
- bp = begin + strlen(begin);
- if (bp != end)
- {
- char *ep = end;
-
- *end = save;
- end = bp;
-
- /* copy character by character due to overlap */
- while (*ep != '\0')
- *bp++ = *ep++;
- *bp = '\0';
- }
- else
- *end = save;
- if (*end == '\0')
- break;
-
- /* Move past ';' */
- begin = end + 1;
- }
- return modified;
-}
diff --git a/contrib/sendmail/src/ldap_map.h b/contrib/sendmail/src/ldap_map.h
index 97eb29ec072cf..9f6a6796d7a6f 100644
--- a/contrib/sendmail/src/ldap_map.h
+++ b/contrib/sendmail/src/ldap_map.h
@@ -14,7 +14,7 @@
** Please go to him for support -- since I (Eric) don't run LDAP, I
** can't help you at all.
**
-** @(#)ldap_map.h 8.10 (Berkeley) 9/14/1998
+** @(#)ldap_map.h 8.9 (Berkeley) 5/19/98
*/
#ifndef _LDAP_MAP_H
@@ -61,7 +61,7 @@ typedef struct ldap_map_struct LDAP_MAP_STRUCT;
#define DEFAULT_LDAP_MAP_DEREF LDAP_DEREF_NEVER
#define DEFAULT_LDAP_MAP_SIZELIMIT 0
#define DEFAULT_LDAP_MAP_ATTRSONLY 0
-#define LDAP_MAP_MAX_FILTER 1024
+#define LDAP_MAP_MAX_FILTER 256
#ifdef LDAP_REFERRALS
# define DEFAULT_LDAP_MAP_LDAP_OPTIONS LDAP_OPT_REFERRALS
#else /* LDAP_REFERRALS */
diff --git a/contrib/sendmail/src/macro.c b/contrib/sendmail/src/macro.c
index d45a0c7080e9f..c1f9f7bb06cf4 100644
--- a/contrib/sendmail/src/macro.c
+++ b/contrib/sendmail/src/macro.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)macro.c 8.26 (Berkeley) 11/8/1998";
+static char sccsid[] = "@(#)macro.c 8.25 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
@@ -333,7 +333,7 @@ macid(p, ep)
{
int mid;
register char *bp;
- char mbuf[MAXMACNAMELEN + 1];
+ char mbuf[21];
if (tTd(35, 14))
{
@@ -361,7 +361,7 @@ macid(p, ep)
return *p;
}
bp = mbuf;
- while (*++p != '\0' && *p != '}' && bp < &mbuf[sizeof mbuf - 1])
+ while (*++p != '\0' && *p != '}' && bp < &mbuf[sizeof mbuf])
{
if (isascii(*p) && (isalnum(*p) || *p == '_'))
*bp++ = *p;
diff --git a/contrib/sendmail/src/mailq.1 b/contrib/sendmail/src/mailq.1
index bead1a26db1e2..ed6c0f6a06e5a 100644
--- a/contrib/sendmail/src/mailq.1
+++ b/contrib/sendmail/src/mailq.1
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)mailq.1 8.10 (Berkeley) 5/19/1998
+.\" @(#)mailq.1 8.10 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt MAILQ 1
diff --git a/contrib/sendmail/src/mailstats.h b/contrib/sendmail/src/mailstats.h
index 86390b3911a30..2121e149587e0 100644
--- a/contrib/sendmail/src/mailstats.h
+++ b/contrib/sendmail/src/mailstats.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)mailstats.h 8.8 (Berkeley) 5/19/1998
+ * @(#)mailstats.h 8.8 (Berkeley) 5/19/98
*/
#define STAT_VERSION 2
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c
index cea9d158d711a..f014d83c359f9 100644
--- a/contrib/sendmail/src/main.c
+++ b/contrib/sendmail/src/main.c
@@ -19,7 +19,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.322 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)main.c 8.302 (Berkeley) 6/4/98";
#endif /* not lint */
#define _DEFINE
@@ -129,7 +129,6 @@ main(argc, argv, envp)
extern char *getcfname __P((void));
extern SIGFUNC_DECL sigusr1 __P((int));
extern SIGFUNC_DECL sighup __P((int));
- extern SIGFUNC_DECL quiesce __P((int));
extern void initmacros __P((ENVELOPE *));
extern void init_md __P((int, char **));
extern int getdtsize __P((void));
@@ -305,7 +304,9 @@ main(argc, argv, envp)
if (tTd(0, 101))
{
printf("Version %s\n", Version);
- finis(FALSE, EX_OK);
+ endpwent();
+ setuid(RealUid);
+ exit(EX_OK);
}
/*
@@ -418,8 +419,8 @@ main(argc, argv, envp)
environ = emptyenviron;
/*
- ** restore any original TZ setting until TimeZoneSpec has been
- ** determined - or early log messages may get bogus time stamps
+ ** restore any original TZ setting until TimeZoneSpec has been
+ ** determined - or early log messages may get bogus time stamps
*/
if ((p = getextenv("TZ")) != NULL)
{
@@ -548,7 +549,7 @@ main(argc, argv, envp)
QueueLimitId = (QUEUE_CHAR *) NULL;
/*
- ** Crack argv.
+ ** Crack argv.
*/
av = argv;
@@ -834,7 +835,8 @@ main(argc, argv, envp)
# endif
default:
- finis(TRUE, EX_USAGE);
+ ExitStat = EX_USAGE;
+ finis();
break;
}
}
@@ -969,11 +971,8 @@ main(argc, argv, envp)
}
/* check for permissions */
- if ((OpMode == MD_DAEMON ||
- OpMode == MD_FGDAEMON ||
- OpMode == MD_PURGESTAT) &&
- RealUid != 0 &&
- RealUid != TrustedUid)
+ if ((OpMode == MD_DAEMON || OpMode == MD_FGDAEMON ||
+ OpMode == MD_PURGESTAT) && RealUid != 0)
{
if (LogLevel > 1)
sm_syslog(LOG_ALERT, NOQID,
@@ -982,7 +981,7 @@ main(argc, argv, envp)
OpMode != MD_PURGESTAT ? "run daemon"
: "purge host status");
usrerr("Permission denied");
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
if (MeToo)
@@ -1084,17 +1083,6 @@ main(argc, argv, envp)
setoption('d', "", TRUE, FALSE, CurEnv);
}
-#ifdef VENDOR_CODE
- /* check for vendor mismatch */
- if (VendorCode != VENDOR_CODE)
- {
- extern char *getvendor __P((int));
-
- message("Warning: .cf file vendor code mismatch: sendmail expects vendor %s, .cf file vendor is %s",
- getvendor(VENDOR_CODE), getvendor(VendorCode));
- }
-#endif
-
/* check for out of date configuration level */
if (ConfigLevel < MAXCONFIGLEVEL)
{
@@ -1211,22 +1199,6 @@ main(argc, argv, envp)
setclass('b', "application/octet-stream");
#endif
-#if _FFR_MAX_MIME_HEADER_LENGTH
- /* MIME headers which have fields to check for overflow */
- setclass(macid("{checkMIMEFieldHeaders}", NULL), "content-disposition");
- setclass(macid("{checkMIMEFieldHeaders}", NULL), "content-type");
-
- /* MIME headers to check for length overflow */
- setclass(macid("{checkMIMETextHeaders}", NULL), "content-description");
-
- /* MIME headers to check for overflow and rebalance */
- setclass(macid("{checkMIMEHeaders}", NULL), "content-disposition");
- setclass(macid("{checkMIMEHeaders}", NULL), "content-id");
- setclass(macid("{checkMIMEHeaders}", NULL), "content-transfer-encoding");
- setclass(macid("{checkMIMEHeaders}", NULL), "content-type");
- setclass(macid("{checkMIMEHeaders}", NULL), "mime-version");
-#endif
-
/* operate in queue directory */
if (QueueDir == NULL)
{
@@ -1269,14 +1241,18 @@ main(argc, argv, envp)
{
/* nope, really a botch */
usrerr("You do not have permission to process the queue");
- finis(FALSE, EX_NOPERM);
+ exit (EX_NOPERM);
}
}
# endif /* QUEUE */
/* if we've had errors so far, exit now */
if (ExitStat != EX_OK && OpMode != MD_TEST)
- finis(FALSE, ExitStat);
+ {
+ endpwent();
+ setuid(RealUid);
+ exit(ExitStat);
+ }
#if XDEBUG
checkfd012("before main() initmaps");
@@ -1292,31 +1268,31 @@ main(argc, argv, envp)
/* print the queue */
#if QUEUE
dropenvelope(CurEnv, TRUE);
- signal(SIGPIPE, quiesce);
printqueue();
- finis(FALSE, EX_OK);
+ endpwent();
+ setuid(RealUid);
+ exit(EX_OK);
#else /* QUEUE */
usrerr("No queue to print");
- finis(FALSE, ExitStat);
+ finis();
#endif /* QUEUE */
- break;
case MD_HOSTSTAT:
- signal(SIGPIPE, quiesce);
mci_traverse_persistent(mci_print_persistent, NULL);
- finis(FALSE, EX_OK);
+ exit(EX_OK);
break;
case MD_PURGESTAT:
mci_traverse_persistent(mci_purge_persistent, NULL);
- finis(FALSE, EX_OK);
+ exit(EX_OK);
break;
case MD_INITALIAS:
- /* initialize maps */
+ /* initialize alias database */
initmaps(TRUE, CurEnv);
- finis(FALSE, ExitStat);
- break;
+ endpwent();
+ setuid(RealUid);
+ exit(ExitStat);
case MD_SMTP:
case MD_DAEMON:
@@ -1325,11 +1301,11 @@ main(argc, argv, envp)
CurEnv->e_envid = NULL;
CurEnv->e_flags &= ~(EF_RET_PARAM|EF_NO_BODY_RETN);
- /* don't open maps for daemon -- done below in child */
+ /* don't open alias database -- done in srvrsmtp */
break;
default:
- /* open the maps */
+ /* open the alias database */
initmaps(FALSE, CurEnv);
break;
}
@@ -1383,7 +1359,7 @@ main(argc, argv, envp)
printf("> ");
(void) fflush(stdout);
if (fgets(buf, sizeof buf, stdin) == NULL)
- finis(TRUE, ExitStat);
+ finis();
p = strchr(buf, '\n');
if (p != NULL)
*p = '\0';
@@ -1401,7 +1377,7 @@ main(argc, argv, envp)
if (queuemode && OpMode != MD_DAEMON && QueueIntvl == 0)
{
(void) runqueue(FALSE, Verbose);
- finis(TRUE, ExitStat);
+ finis();
}
# endif /* QUEUE */
@@ -1426,7 +1402,7 @@ main(argc, argv, envp)
if (i < 0)
syserr("daemon: cannot fork");
if (i != 0)
- finis(FALSE, EX_OK);
+ exit(EX_OK);
/* disconnect from our controlling tty */
disconnect(2, CurEnv);
@@ -1519,9 +1495,6 @@ main(argc, argv, envp)
snprintf(pbuf, sizeof pbuf, "0");
define(macid("{client_port}", NULL), newstr(pbuf), &BlankEnvelope);
- /* initialize maps now for check_relay ruleset */
- initmaps(FALSE, CurEnv);
-
if (OpMode == MD_DAEMON)
{
/* validate the connection */
@@ -1566,7 +1539,7 @@ main(argc, argv, envp)
/* collect body for UUCP return */
if (OpMode != MD_VERIFY)
collect(InChannel, FALSE, NULL, CurEnv);
- finis(TRUE, ExitStat);
+ finis();
}
/*
@@ -1610,7 +1583,7 @@ main(argc, argv, envp)
/* bail out if message too large */
if (bitset(EF_CLRQUEUE, CurEnv->e_flags))
{
- finis(TRUE, ExitStat);
+ finis();
/*NOTREACHED*/
return -1;
}
@@ -1642,18 +1615,11 @@ main(argc, argv, envp)
** Don't send return error message if in VERIFY mode.
*/
- finis(TRUE, ExitStat);
+ finis();
/*NOTREACHED*/
return -1;
}
-/* ARGSUSED */
-SIGFUNC_DECL
-quiesce(sig)
- int sig;
-{
- finis(FALSE, EX_OK);
-}
/* ARGSUSED */
SIGFUNC_DECL
@@ -1669,8 +1635,7 @@ intindebug(sig)
** FINIS -- Clean up and exit.
**
** Parameters:
-** drop -- whether or not to drop CurEnv envelope
-** exitstat -- exit status to use for exit() call
+** none
**
** Returns:
** never
@@ -1680,21 +1645,14 @@ intindebug(sig)
*/
void
-finis(drop, exitstat)
- bool drop;
- volatile int exitstat;
+finis()
{
- extern void closemaps __P((void));
-#ifdef USERDB
- extern void _udbx_close __P((void));
-#endif
-
if (tTd(2, 1))
{
extern void printenvflags __P((ENVELOPE *));
printf("\n====finis: stat %d e_id=%s e_flags=",
- exitstat,
+ ExitStat,
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id);
printenvflags(CurEnv);
}
@@ -1710,20 +1668,12 @@ finis(drop, exitstat)
/* clean up temp files */
CurEnv->e_to = NULL;
- if (drop && CurEnv->e_id != NULL)
+ if (CurEnv->e_id != NULL)
dropenvelope(CurEnv, TRUE);
/* flush any cached connections */
mci_flush(TRUE, NULL);
- /* close maps belonging to this pid */
- closemaps();
-
-#ifdef USERDB
- /* close UserDatabase */
- _udbx_close();
-#endif
-
# ifdef XLA
/* clean up extended load average stuff */
xla_all_end();
@@ -1735,14 +1685,14 @@ finis(drop, exitstat)
sm_syslog(LOG_DEBUG, CurEnv->e_id,
"finis, pid=%d",
getpid());
- if (exitstat == EX_TEMPFAIL || CurEnv->e_errormode == EM_BERKNET)
- exitstat = EX_OK;
+ if (ExitStat == EX_TEMPFAIL || CurEnv->e_errormode == EM_BERKNET)
+ ExitStat = EX_OK;
/* reset uid for process accounting */
endpwent();
setuid(RealUid);
- exit(exitstat);
+ exit(ExitStat);
}
/*
** INTSIG -- clean up on interrupt
@@ -1769,11 +1719,15 @@ intsig(sig)
sm_syslog(LOG_DEBUG, CurEnv->e_id, "interrupt");
FileName = NULL;
unlockqueue(CurEnv);
- closecontrolsocket(TRUE);
#ifdef XLA
xla_all_end();
#endif
- finis(FALSE, EX_OK);
+
+ /* reset uid for process accounting */
+ endpwent();
+ setuid(RealUid);
+
+ exit(EX_OK);
}
/*
** INITMACROS -- initialize the macro system
@@ -2203,24 +2157,23 @@ sighup(sig)
{
if (LogLevel > 3)
sm_syslog(LOG_INFO, NOQID, "could not restart: need full path");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (LogLevel > 3)
sm_syslog(LOG_INFO, NOQID, "restarting %s on signal", SaveArgv[0]);
alarm(0);
releasesignal(SIGHUP);
- closecontrolsocket(TRUE);
if (drop_privileges(TRUE) != EX_OK)
{
if (LogLevel > 0)
sm_syslog(LOG_ALERT, NOQID, "could not set[ug]id(%d, %d): %m",
RunAsUid, RunAsGid);
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
execve(SaveArgv[0], (ARGV_T) SaveArgv, (ARGV_T) ExternalEnviron);
if (LogLevel > 0)
sm_syslog(LOG_ALERT, NOQID, "could not exec %s: %m", SaveArgv[0]);
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
/*
** DROP_PRIVILEGES -- reduce privileges to those of the RunAsUser option
diff --git a/contrib/sendmail/src/makesendmail b/contrib/sendmail/src/makesendmail
new file mode 100755
index 0000000000000..ab8a49d78cac9
--- /dev/null
+++ b/contrib/sendmail/src/makesendmail
@@ -0,0 +1,513 @@
+#!/bin/sh
+
+# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
+# Copyright (c) 1993, 1996-1997 Eric P. Allman. All rights reserved.
+# Copyright (c) 1993
+# The Regents of the University of California. All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+#
+# @(#)Build 8.93 (Berkeley) 6/24/98
+#
+
+#
+# A quick-and-dirty script to compile sendmail and related programs
+# in the presence of multiple architectures. To use, just use
+# "sh Build".
+#
+
+trap "rm -f $obj/.settings$$; exit" 1 2 3 15
+
+cflag=""
+mflag=""
+sflag=""
+makeargs=""
+libdirs=""
+incdirs=""
+libsrch=""
+siteconfig=""
+EX_USAGE=64
+EX_NOINPUT=66
+EX_UNAVAILABLE=69
+
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -c) # clean out existing $obj tree
+ cflag=1
+ shift
+ ;;
+
+ -m) # show Makefile name only
+ mflag=1
+ shift
+ ;;
+
+ -E*) # environment variables to pass into Build
+ arg=`echo $1 | sed 's/^-E//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ -z "$arg" ]
+ then
+ echo "Empty -E flag" >&2
+ exit $EX_USAGE
+ else
+ case $arg
+ in
+ *=*) # check format
+ eval $arg
+ export `echo $arg | sed 's;=.*;;'`
+ ;;
+ *) # bad format
+ echo "Bad format for -E argument ($arg)" >&2
+ exit $EX_USAGE
+ ;;
+ esac
+ shift
+ fi
+ ;;
+
+ -L*) # set up LIBDIRS
+ libdirs="$libdirs $1"
+ shift
+ ;;
+
+ -I*) # set up INCDIRS
+ incdirs="$incdirs $1"
+ shift
+ ;;
+
+ -f*) # select site config file
+ arg=`echo $1 | sed 's/^-f//'`
+ if [ -z "$arg" ]
+ then
+ shift # move to argument
+ arg=$1
+ fi
+ if [ "$siteconfig" ]
+ then
+ echo "Only one -f flag allowed" >&2
+ exit $EX_USAGE
+ else
+ siteconfig=$arg
+ if [ -z "$siteconfig" ]
+ then
+ echo "Missing argument for -f flag" >&2
+ exit $EX_USAGE
+ elif [ ! -f "$siteconfig" ]
+ then
+ echo "${siteconfig}: File not found"
+ exit $EX_NOINPUT
+ else
+ shift # move past argument
+ fi
+ fi
+ ;;
+
+ -S) # skip auto-configure
+ sflag="-s"
+ shift
+ ;;
+
+ *) # pass argument to make
+ makeargs="$makeargs \"$1\""
+ shift
+ ;;
+ esac
+done
+
+#
+# Do heuristic guesses !ONLY! for machines that do not have uname
+#
+if [ -d /NextApps -a ! -f /bin/uname -a ! -f /usr/bin/uname ]
+then
+ # probably a NeXT box
+ arch=`hostinfo | sed -n 's/.*Processor type: \([^ ]*\).*/\1/p'`
+ os=NeXT
+ rel=`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`
+elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]
+then
+ # probably a Sony NEWS 4.x
+ os=NEWS-OS
+ rel=`awk '{ print $3}' /etc/osversion`
+ arch=`/usr/sony/bin/machine`
+elif [ -d /usr/omron -a -f /bin/luna ]
+then
+ # probably a Omron LUNA
+ os=LUNA
+ if [ -f /bin/luna1 ] && /bin/luna1
+ then
+ rel=unios-b
+ arch=luna1
+ elif [ -f /bin/luna2 ] && /bin/luna2
+ then
+ rel=Mach
+ arch=luna2
+ elif [ -f /bin/luna88k ] && /bin/luna88k
+ then
+ rel=Mach
+ arch=luna88k
+ fi
+elif [ -d /usr/apollo -a -d \`node_data ]
+then
+ # probably a Apollo/DOMAIN
+ os=DomainOS
+ arch=$ISP
+ rel=`/usr/apollo/bin/bldt | grep Domain | awk '{ print $4 }' | sed -e 's/,//g'`
+fi
+
+if [ ! "$arch" -a ! "$os" -a ! "$rel" ]
+then
+ arch=`uname -m | sed -e 's/ //g'`
+ os=`uname -s | sed -e 's/\//-/g' -e 's/ //g'`
+ rel=`uname -r | sed -e 's/(/-/g' -e 's/)//g'`
+fi
+
+#
+# Tweak the values we have already got. PLEASE LIMIT THESE to
+# tweaks that are absolutely necessary because your system uname
+# routine doesn't return something sufficiently unique. Don't do
+# it just because you don't like the name that is returned. You
+# can combine the architecture name with the os name to create a
+# unique Makefile name.
+#
+
+# tweak machine architecture
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+
+ DS/907000) arch=ds90;;
+
+ NILE*) arch=NILE
+ os=`uname -v`;;
+esac
+
+# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+if [ "$rel" = 4.0 ]
+then
+ case $arch in
+ 3[34]??|3[34]??,*)
+ if [ -d /usr/sadm/sysadm/add-ons/WIN-TCP ]
+ then
+ os=NCR.MP-RAS.2.x
+ elif [ -d /usr/sadm/sysadm/add-ons/inet ]
+ then
+ os=NCR.MP-RAS.3.x
+ fi
+ ;;
+ esac
+fi
+
+case $os
+in
+ DYNIX-ptx) os=PTX;;
+ Paragon*) os=Paragon;;
+ HP-UX) rel=`echo $rel | sed -e 's/^[^.]*\.0*//'`;;
+ AIX) rela=$rel
+ rel=`uname -v`
+ case $rel in
+ 2) arch=""
+ ;;
+ 4) if [ "$rela" = "3" ]
+ then
+ arch=$rela
+ fi
+ ;;
+ esac
+ rel=$rel.$rela
+ ;;
+ BSD-386) os=BSD-OS;;
+ SCO_SV) os=SCO; rel=`uname -X | sed -n 's/Release = 3.2v//p'`;;
+ UNIX_System_V) if [ "$arch" = "ds90" ]
+ then
+ os="UXPDS"
+ rel=`uname -v | sed -e 's/\(V.*\)L.*/\1/'`
+ fi;;
+ SINIX-?) os=SINIX;;
+ DomainOS) case $rel in
+ 10.4*) rel=10.4;;
+ esac
+ ;;
+esac
+
+# get "base part" of operating system release
+rroot=`echo $rel | sed -e 's/\.[^.]*$//'`
+rbase=`echo $rel | sed -e 's/\..*//'`
+if [ "$rroot" = "$rbase" ]
+then
+ rroot=$rel
+fi
+
+# heuristic tweaks to clean up names -- PLEASE LIMIT THESE!
+if [ "$os" = "unix" ]
+then
+ # might be Altos System V
+ case $rel
+ in
+ 5.3*) os=Altos;;
+ esac
+elif [ -r /unix -a -r /usr/lib/libseq.a -a -r /lib/cpp ]
+then
+ # might be a DYNIX/ptx 2.x system, which has a broken uname
+ if strings /lib/cpp | grep _SEQUENT_ > /dev/null
+ then
+ os=PTX
+ fi
+elif [ -d /usr/nec ]
+then
+ # NEC machine -- what is it running?
+ if [ "$os" = "UNIX_System_V" ]
+ then
+ os=EWS-UX_V
+ elif [ "$os" = "UNIX_SV" ]
+ then
+ os=UX4800
+ fi
+elif [ "$arch" = "mips" ]
+then
+ case $rel
+ in
+ 4_*)
+ if [ `uname -v` = "UMIPS" ]
+ then
+ os=RISCos
+ fi;;
+ esac
+fi
+
+# see if there is a "user suffix" specified
+if [ "${SENDMAIL_SUFFIX-}x" = "x" ]
+then
+ sfx=""
+else
+ sfx=".${SENDMAIL_SUFFIX}"
+fi
+
+echo "Configuration: os=$os, rel=$rel, rbase=$rbase, rroot=$rroot, arch=$arch, sfx=$sfx"
+
+
+SMROOT=${SMROOT-..}
+BUILDTOOLS=${BUILDTOOLS-$SMROOT/BuildTools}
+export SMROOT BUILDTOOLS
+
+# see if we are in a Build-able directory
+if [ ! -f Makefile.m4 ]; then
+ echo "Makefile.m4 not found. Build can only be run from a source directory."
+ exit $EX_UNAVAILABLE
+fi
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$rel.$arch$sfx ]; then
+ obj=obj.$os.$rel.$arch$sfx
+elif [ -r obj.$os.$rroot.$arch$sfx ]; then
+ obj=obj.$os.$rroot.$arch$sfx
+elif [ -r obj.$os.$rbase.x.$arch$sfx ]; then
+ obj=obj.$os.$rbase.x.$arch$sfx
+elif [ -r obj.$os.$rel$sfx ]; then
+ obj=obj.$os.$rel$sfx
+elif [ -r obj.$os.$rbase.x$sfx ]; then
+ obj=obj.$os.$rbase.x$sfx
+elif [ -r obj.$os.$arch$sfx ]; then
+ obj=obj.$os.$arch$sfx
+elif [ -r obj.$rel.$arch$sfx ]; then
+ obj=obj.$rel.$arch$sfx
+elif [ -r obj.$rbase.x.$arch$sfx ]; then
+ obj=obj.$rbase.x.$arch$sfx
+elif [ -r obj.$os$sfx ]; then
+ obj=obj.$os$sfx
+elif [ -r obj.$arch$sfx ]; then
+ obj=obj.$arch$sfx
+elif [ -r obj.$rel$sfx ]; then
+ obj=obj.$rel$sfx
+elif [ -r obj$sfx ]; then
+ obj=obj$sfx
+fi
+if [ -z "$obj" -o "$cflag" ]
+then
+ if [ -n "$obj" ]
+ then
+ echo "Clearing out existing $obj tree"
+ rm -rf $obj
+ else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$rel.$arch$sfx
+ fi
+ if [ -r $BUILDTOOLS/OS/$os.$rel.$arch$sfx ]; then
+ oscf=$os.$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel.$arch ]; then
+ oscf=$os.$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch$sfx ]; then
+ oscf=$os.$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot.$arch ]; then
+ oscf=$os.$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch$sfx ]; then
+ oscf=$os.$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x.$arch ]; then
+ oscf=$os.$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os.$rel$sfx ]; then
+ oscf=$os.$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rel ]; then
+ oscf=$os.$rel
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot$sfx ]; then
+ oscf=$os.$rroot$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rroot ]; then
+ oscf=$os.$rroot
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x$sfx ]; then
+ oscf=$os.$rbase.x$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$rbase.x ]; then
+ oscf=$os.$rbase.x
+ elif [ -r $BUILDTOOLS/OS/$os.$arch$sfx ]; then
+ oscf=$os.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$os.$arch ]; then
+ oscf=$os.$arch
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch$sfx ]; then
+ oscf=$rel.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel.$arch ]; then
+ oscf=$rel.$arch
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch$sfx ]; then
+ oscf=$rroot.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rroot.$arch ]; then
+ oscf=$rroot.$arch
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch$sfx ]; then
+ oscf=$rbase.x.$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$rbase.x.$arch ]; then
+ oscf=$rbase.x.$arch
+ elif [ -r $BUILDTOOLS/OS/$os$sfx ]; then
+ oscf=$os$sfx
+ elif [ -r $BUILDTOOLS/OS/$os ]; then
+ oscf=$os
+ elif [ -r $BUILDTOOLS/OS/$arch$sfx ]; then
+ oscf=$arch$sfx
+ elif [ -r $BUILDTOOLS/OS/$arch ]; then
+ oscf=$arch
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ elif [ -r $BUILDTOOLS/OS/$rel ]; then
+ oscf=$rel
+ elif [ -r $BUILDTOOLS/OS/$rel$sfx ]; then
+ oscf=$rel$sfx
+ else
+ echo "Cannot determine how to support $arch.$os.$rel" >&2
+ exit $EX_UNAVAILABLE
+ fi
+ M4=`sh $BUILDTOOLS/bin/find_m4.sh`
+ ret=$?
+ if [ $ret -ne 0 ]
+ then
+ exit $ret
+ fi
+ echo "Using M4=$M4"
+ export M4
+ if [ "$mflag" ]
+ then
+ echo "Will run in virgin $obj using $BUILDTOOLS/OS/$oscf"
+ exit 0
+ fi
+ if [ "$ABI" ]
+ then
+ echo "Using ABI $ABI"
+ fi
+ echo "Creating $obj using $BUILDTOOLS/OS/$oscf"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] .)
+ if [ -f sendmail.hf ]
+ then
+ (cd $obj; ln -s ../sendmail.hf .)
+ fi
+
+ rm -f $obj/.settings$$
+ echo 'divert(-1)' > $obj/.settings$$
+ cat $BUILDTOOLS/M4/header.m4 >> $obj/.settings$$
+ if [ "$ABI" ]
+ then
+ echo "define(\`confABI', \`$ABI')" >> $obj/.settings$$
+ fi
+ cat $BUILDTOOLS/OS/$oscf >> $obj/.settings$$
+
+ if [ -z "$siteconfig" ]
+ then
+ # none specified, use defaults
+ if [ -f $BUILDTOOLS/Site/site.$oscf$sfx.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf$sfx.m4
+ elif [ -f $BUILDTOOLS/Site/site.$oscf.m4 ]
+ then
+ siteconfig=$BUILDTOOLS/Site/site.$oscf.m4
+ fi
+ if [ -f $BUILDTOOLS/Site/site.config.m4 ]
+ then
+ siteconfig="$BUILDTOOLS/Site/site.config.m4 $siteconfig"
+ fi
+ fi
+ if [ ! -z "$siteconfig" ]
+ then
+ echo "Including $siteconfig"
+ cat $siteconfig >> $obj/.settings$$
+ fi
+ if [ "$libdirs" ]
+ then
+ echo "define(\`confLIBDIRS', confLIBDIRS \`\`$libdirs'')" >> $obj/.settings$$
+ fi
+ if [ "$incdirs" ]
+ then
+ echo "define(\`confINCDIRS', confINCDIRS \`\`$incdirs'')" >> $obj/.settings$$
+ fi
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ libdirs=`(cat $obj/.settings$$; echo "_SRIDBIL_= confLIBDIRS" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_SRIDBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_SRIDBIL_=//"`
+ libsrch=`(cat $obj/.settings$$; echo "_HCRSBIL_= confLIBSEARCH" ) | \
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - | \
+ grep "^_HCRSBIL_=" | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' -e "s/^_HCRSBIL_=//"`
+ echo 'divert(-1)' >> $obj/.settings$$
+ LIBDIRS="$libdirs" LIBSRCH="$libsrch" SITECONFIG="$siteconfig" sh $BUILDTOOLS/bin/configure.sh $sflag $oscf >> $obj/.settings$$
+ echo 'divert(0)dnl' >> $obj/.settings$$
+ sed -e 's/\(.\)include/\1_include_/g' -e 's/#define/#_define_/g' $obj/.settings$$ | \
+ ${M4} -DconfBUILDTOOLSDIR=$BUILDTOOLS - Makefile.m4 | \
+ sed -e 's/#_define_/#define/g' -e 's/_include_/include/g' > $obj/Makefile
+ if [ $? -ne 0 -o ! -s $obj/Makefile ]
+ then
+ echo "ERROR: ${M4} failed; You may need a newer version of M4, at least as new as System V or GNU" 1>&2
+ rm -rf $obj
+ exit $EX_UNAVAILABLE
+ fi
+ rm -f $obj/.settings$$
+ echo "Making dependencies in $obj"
+ (cd $obj; ${MAKE-make} depend)
+fi
+
+if [ "$mflag" ]
+then
+ makefile=`ls -l $obj/Makefile | sed 's/.* //'`
+ if [ -z "$makefile" ]
+ then
+ echo "ERROR: $obj exists but has no Makefile" >&2
+ exit $EX_NOINPUT
+ fi
+ echo "Will run in existing $obj using $makefile"
+ exit 0
+fi
+
+echo "Making in $obj"
+cd $obj
+eval exec ${MAKE-make} $makeargs
diff --git a/contrib/sendmail/src/map.c b/contrib/sendmail/src/map.c
index 787ae07deb8d8..4c95b7fd6ab46 100644
--- a/contrib/sendmail/src/map.c
+++ b/contrib/sendmail/src/map.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.256 (Berkeley) 11/15/1998";
+static char sccsid[] = "@(#)map.c 8.239 (Berkeley) 6/5/98";
#endif /* not lint */
#include "sendmail.h"
@@ -437,9 +437,9 @@ map_init(s, pass)
pass);
/*
- ** Pass 0 opens all non-rebuildable maps.
- ** Pass 1 opens all rebuildable maps for read.
- ** Pass 2 rebuilds all rebuildable maps.
+ ** Pass 0 opens all non-rebuildable maps.
+ ** Pass 1 opens all rebuildable maps for read.
+ ** Pass 2 rebuilds all rebuildable maps.
*/
rebuildable = (bitset(MF_ALIAS, map->map_mflags) &&
@@ -478,7 +478,6 @@ map_init(s, pass)
map->map_file == NULL ? "NULL" :
map->map_file);
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
}
else
{
@@ -497,55 +496,10 @@ map_init(s, pass)
map->map_class = &BogusMapClass;
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
}
}
}
/*
-** CLOSEMAPS -- close all open maps opened by the current pid.
-**
-** Parameters:
-** none
-**
-** Returns:
-** none.
-*/
-
-void
-closemaps()
-{
- extern void map_close __P((STAB *, int));
-
- stabapply(map_close, 0);
-}
-
-/* ARGSUSED1 */
-void
-map_close(s, unused)
- register STAB *s;
- int unused;
-{
- MAP *map;
-
- if (s->s_type != ST_MAP)
- return;
-
- map = &s->s_map;
-
- if (!bitset(MF_VALID, map->map_mflags) ||
- !bitset(MF_OPEN, map->map_mflags) ||
- map->map_pid != getpid())
- return;
-
- if (tTd(38, 5))
- printf("closemaps: closing %s (%s)\n",
- map->map_mname == NULL ? "NULL" : map->map_mname,
- map->map_file == NULL ? "NULL" : map->map_file);
-
- map->map_class->map_close(map);
- map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
-}
- /*
** GETCANONNAME -- look up name using service switch
**
** Parameters:
@@ -999,11 +953,10 @@ ndbm_map_open(map, mode)
else
{
map->map_mflags |= MF_LOCKED;
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(dfd, TrustedUid, -1) < 0 ||
- fchown(pfd, TrustedUid, -1) < 0)
+ if (fchown(dfd, TrustedFileUid, -1) < 0 ||
+ fchown(pfd, TrustedFileUid, -1) < 0)
{
int err = errno;
@@ -1014,7 +967,6 @@ ndbm_map_open(map, mode)
map->map_file, errstring(err));
}
}
-#endif
}
if (fstat(dfd, &st) >= 0)
map->map_mtime = st.st_mtime;
@@ -1068,7 +1020,6 @@ lockdbm:
if (map->map_class->map_open(map, omode))
{
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
if ((omode && O_ACCMODE) == O_RDWR)
map->map_mflags |= MF_WRITABLE;
goto lockdbm;
@@ -1082,7 +1033,6 @@ lockdbm:
*statp = EX_TEMPFAIL;
map->map_class = &BogusMapClass;
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
syserr("Cannot reopen NDBM database %s",
map->map_file);
}
@@ -1209,7 +1159,7 @@ ndbm_map_close(map)
{
#ifdef NDBM_YP_COMPAT
bool inclnull;
- char buf[MAXHOSTNAMELEN];
+ char buf[200];
inclnull = bitset(MF_INCLNULL, map->map_mflags);
map->map_mflags &= ~MF_INCLNULL;
@@ -1550,10 +1500,9 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
if (mode == O_RDWR)
{
(void) db->sync(db, 0);
-#if _FFR_TRUSTED_USER
- if (geteuid() == 0 && TrustedUid != 0)
+ if (geteuid() == 0 && TrustedFileUid != 0)
{
- if (fchown(fd, TrustedUid, -1) < 0)
+ if (fchown(fd, TrustedFileUid, -1) < 0)
{
int err = errno;
@@ -1564,7 +1513,6 @@ db_map_open(map, mode, mapclassname, dbtype, openinfo)
buf, errstring(err));
}
}
-#endif
}
if (fd >= 0 && fstat(fd, &st) >= 0)
@@ -1642,7 +1590,6 @@ db_map_lookup(map, name, av, statp)
if (map->map_class->map_open(map, omode))
{
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
if ((omode && O_ACCMODE) == O_RDWR)
map->map_mflags |= MF_WRITABLE;
db = (DB *) map->map_db2;
@@ -1657,7 +1604,6 @@ db_map_lookup(map, name, av, statp)
*statp = EX_TEMPFAIL;
map->map_class = &BogusMapClass;
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
syserr("Cannot reopen DB database %s",
map->map_file);
}
@@ -1871,31 +1817,9 @@ db_map_close(map)
#if DB_VERSION_MAJOR < 2
if (db->close(db) != 0)
#else
- /*
- ** Berkeley DB can use internal shared memory
- ** locking for its memory pool. Closing a map
- ** opened by another process will interfere
- ** with the shared memory and locks of the parent
- ** process leaving things in a bad state.
- **
- ** If this map was not opened by the current
- ** process, do not close it here but recover
- ** the file descriptor.
- */
- if (map->map_pid != getpid())
- {
- int fd = -1;
-
- errno = db->fd(db, &fd);
- if (fd >= 0)
- (void) close(fd);
- return;
- }
-
if ((errno = db->close(db, 0)) != 0)
#endif
- syserr("db_map_close(%s, %s, %lx): db close failure",
- map->map_mname, map->map_file, map->map_mflags);
+ syserr("readaliases: db close failure");
}
#endif
@@ -2326,10 +2250,7 @@ nisplus_map_lookup(map, name, av, statp)
if (!bitset(MF_OPEN, map->map_mflags))
{
if (nisplus_map_open(map, O_RDONLY))
- {
map->map_mflags |= MF_OPEN;
- map->map_pid = getpid();
- }
else
{
*statp = EX_UNAVAILABLE;
@@ -2670,38 +2591,18 @@ ldap_map_start(map)
ev = setevent(lmap->timeout.tv_sec, ldaptimeout, 0);
}
-#ifdef LDAP_VERSION3
- ld = ldap_init(lmap->ldaphost,lmap->ldapport);
-#else
- ld = ldap_open(lmap->ldaphost,lmap->ldapport);
-#endif
-
- /* clear the event if it has not sprung */
- if (lmap->timeout.tv_sec != 0)
- clrevent(ev);
-
- if (ld == NULL)
+ if ((ld = ldap_open(lmap->ldaphost,lmap->ldapport)) == NULL)
{
if (!bitset(MF_OPTIONAL, map->map_mflags))
{
- syserr("%sldapopen failed to %s in map %s",
- bitset(MF_NODEFER, map->map_mflags) ? "" : "421 ",
+ syserr("ldapopen failed to %s in map %s",
lmap->ldaphost, map->map_mname);
}
return FALSE;
}
-#ifdef LDAP_VERSION3
- ldap_set_option(ld, LDAP_OPT_DEREF, &lmap->deref);
- ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &lmap->timelimit);
- ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &lmap->sizelimit);
- ldap_set_option(ld, LDAP_OPT_REFERRALS, &lmap->ldap_options);
-
- /* ld needs to be cast into the map struct */
- lmap->ld = ld;
- return TRUE;
-#else
-
+ /* clear the event if it has not sprung */
+ clrevent(ev);
/* From here on in we can use ldap internal timelimits */
ld->ld_deref = lmap->deref;
ld->ld_timelimit = lmap->timelimit;
@@ -2724,12 +2625,11 @@ ldap_map_start(map)
}
return FALSE;
-#endif
}
/*
-** LDAP_MAP_CLOSE -- close ldap map
+** LDAP_MAP_CLOSE -- close ldap map
*/
void
@@ -2745,8 +2645,8 @@ ldap_map_close(map)
#ifdef SUNET_ID
/*
-** SUNET_ID_HASH -- Convert a string to it's Sunet_id canonical form
-** This only makes sense at Stanford University.
+** SUNET_ID_HASH -- Convert a string to it's Sunet_id canonical form
+** This only makes sense at Stanford University.
*/
char *
@@ -2780,7 +2680,7 @@ sunet_id_hash(str)
#endif /* SUNET_ID */
/*
-** LDAP_MAP_LOOKUP -- look up a datum in a LDAP map
+** LDAP_MAP_LOOKUP -- look up a datum in a LDAP map
*/
char *
@@ -2799,7 +2699,6 @@ ldap_map_lookup(map, name, av, statp)
char **attr_values = NULL;
char *result;
int name_len;
- char *fp, *p, *q;
if (tTd(38, 20))
printf("ldap_map_lookup(%s, %s)\n", map->map_mname, name);
@@ -2828,28 +2727,8 @@ ldap_map_lookup(map, name, av, statp)
makelower(keybuf);
#endif /*SUNET_ID */
- /* substitute keybuf into filter, perhaps multiple times */
- fp = filter;
- p = lmap->filter;
- while ((q = strchr(p, '%')) != NULL)
- {
- if (q[1] == 's')
- {
- snprintf(fp, SPACELEFT(filter, fp), "%.*s%s",
- q - p, p, keybuf);
- p = q + 2;
- }
- else
- {
- snprintf(fp, SPACELEFT(filter, fp), "%.*s",
- q - p + 1, p);
- p = q + (q[1] == '%' ? 2 : 1);
- }
- fp += strlen(fp);
- }
- snprintf(fp, SPACELEFT(filter, fp), "%s", p);
- if (tTd(38, 20))
- printf("ldap search filter=%s\n", filter);
+ /* sprintf keybuf into filter */
+ snprintf(filter, sizeof filter, lmap->filter, keybuf);
if (ldap_search_st(lmap->ld, lmap->base,lmap->scope,filter,
lmap->attr, lmap->attrsonly, &(lmap->timeout),
@@ -2870,8 +2749,7 @@ ldap_map_lookup(map, name, av, statp)
{
if (!bitset(MF_OPTIONAL, map->map_mflags))
{
- syserr("%sError in ldap_search_st using %s in map %s",
- bitset(MF_NODEFER, map->map_mflags) ? "" : "421 ",
+ syserr("Error in ldap_search_st using %s in map %s",
filter, map->map_mname);
}
result = NULL;
@@ -2924,7 +2802,7 @@ ldap_map_lookup(map, name, av, statp)
/*
-** LDAP_MAP_DEQUOTE - helper routine for ldap_map_parseargs
+** LDAP_MAP_DEQUOTE - helper routine for ldap_map_parseargs
*/
char *
@@ -2954,7 +2832,7 @@ ldap_map_dequote(str)
}
/*
-** LDAP_MAP_PARSEARGS -- parse ldap map definition args.
+** LDAP_MAP_PARSEARGS -- parse ldap map definition args.
*/
bool
@@ -3158,8 +3036,8 @@ ldap_map_parseargs(map,args)
map->map_domain = newstr(ldap_map_dequote(map->map_domain));
/*
- ** We need to swallow up all the stuff into a struct
- ** and dump it into map->map_dbptr1
+ ** We need to swallow up all the stuff into a struct
+ ** and dump it into map->map_dbptr1
*/
if (lmap->ldaphost != NULL)
@@ -3217,7 +3095,7 @@ ldap_map_parseargs(map,args)
#endif /* LDAP Modules */
/*
-** syslog map
+** syslog map
*/
#if _FFR_MAP_SYSLOG
@@ -3225,7 +3103,7 @@ ldap_map_parseargs(map,args)
#define map_prio map_lockfd /* overload field */
/*
-** SYSLOG_MAP_PARSEARGS -- check for priority level to syslog messages.
+** SYSLOG_MAP_PARSEARGS -- check for priority level to syslog messages.
*/
bool
@@ -3307,7 +3185,7 @@ syslog_map_parseargs(map, args)
}
/*
-** SYSLOG_MAP_LOOKUP -- rewrite and syslog message. Always return empty string
+** SYSLOG_MAP_LOOKUP -- rewrite and syslog message. Always return empty string
*/
char *
@@ -3504,6 +3382,8 @@ ni_map_open(map, mode)
MAP *map;
int mode;
{
+ char *p;
+
if (tTd(38, 2))
printf("ni_map_open(%s, %s, %d)\n",
map->map_mname, map->map_file, mode);
@@ -3786,7 +3666,7 @@ ni_propval(keydir, keyprop, keyval, valprop, sepchar)
return propval;
}
-#endif /* NETINFO */
+#endif
/*
** TEXT (unindexed text file) Modules
**
@@ -3962,11 +3842,6 @@ text_map_lookup(map, name, av, statp)
return NULL;
}
vp = get_column(linebuf, map->map_valcolno, delim, buf, sizeof buf);
- if (vp == NULL)
- {
- *statp = EX_NOTFOUND;
- return NULL;
- }
vsize = strlen(vp);
*statp = EX_OK;
if (bitset(MF_MATCHONLY, map->map_mflags))
diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c
index 8ebb7a000a4cb..efb8cbad67a84 100644
--- a/contrib/sendmail/src/mci.c
+++ b/contrib/sendmail/src/mci.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)mci.c 8.83 (Berkeley) 10/13/1998";
+static char sccsid[] = "@(#)mci.c 8.82 (Berkeley) 6/15/98";
#endif /* not lint */
#include "sendmail.h"
@@ -428,9 +428,7 @@ mci_dump(mci, logit)
sep = logit ? " " : "\n\t";
p = buf;
- snprintf(p, SPACELEFT(buf, p), "MCI@%lx: ",
- sizeof(void *) == sizeof(u_long) ?
- (u_long)(void *)mci : (u_long)(u_int)(void *)mci);
+ snprintf(p, SPACELEFT(buf, p), "MCI@%x: ", mci);
p += strlen(p);
if (mci == NULL)
{
@@ -505,7 +503,7 @@ mci_dump_all(logit)
mci_dump(MciCache[i], logit);
}
/*
-** MCI_LOCK_HOST -- Lock host while sending.
+** MCI_LOCK_HOST -- Lock host while sending.
**
** If we are contacting a host, we'll need to
** update the status information in the host status
@@ -645,7 +643,7 @@ mci_unlock_host(mci)
errno = saveErrno;
}
/*
-** MCI_LOAD_PERSISTENT -- load persistent host info
+** MCI_LOAD_PERSISTENT -- load persistent host info
**
** Load information about host that is kept
** in common for all running sendmails.
@@ -1018,8 +1016,8 @@ mci_traverse_persistent(action, pathname)
*hostptr = '\0';
/*
- ** Do something with the file containing the persistent
- ** information.
+ ** Do something with the file containing the persistent
+ ** information.
*/
ret = (*action)(pathname, host);
}
@@ -1169,7 +1167,7 @@ mci_purge_persistent(pathname, hostname)
return 0;
}
/*
-** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
+** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
**
** Given `host', convert from a.b.c to $QueueDir/.hoststat/c./b./a,
** putting the result into `path'. if `createflag' is set, intervening
diff --git a/contrib/sendmail/src/mime.c b/contrib/sendmail/src/mime.c
index a1429cb950d04..11a141e4f8a3d 100644
--- a/contrib/sendmail/src/mime.c
+++ b/contrib/sendmail/src/mime.c
@@ -14,7 +14,7 @@
# include <string.h>
#ifndef lint
-static char sccsid[] = "@(#)mime.c 8.70 (Berkeley) 11/10/1998";
+static char sccsid[] = "@(#)mime.c 8.66 (Berkeley) 5/19/98";
#endif /* not lint */
/*
@@ -225,8 +225,7 @@ mime8to7(mci, header, e, boundaries, flags)
** Do a recursive descent into the message.
*/
- if (strcasecmp(type, "multipart") == 0 &&
- (!bitset(M87F_NO8BIT, flags) || bitset(M87F_NO8TO7, flags)))
+ if (strcasecmp(type, "multipart") == 0 && !bitset(M87F_NO8BIT, flags))
{
int blen;
@@ -380,7 +379,7 @@ mime8to7(mci, header, e, boundaries, flags)
*/
sectionsize = sectionhighbits = 0;
- if (!bitset(M87F_NO8BIT|M87F_NO8TO7, flags))
+ if (!bitset(M87F_NO8BIT, flags))
{
/* remember where we were */
offset = ftell(e->e_dfp);
@@ -442,13 +441,8 @@ mime8to7(mci, header, e, boundaries, flags)
if (sectionhighbits == 0)
{
/* no encoding necessary */
- if (cte != NULL && bitset(MCIF_INMIME, mci->mci_flags))
+ if (cte != NULL)
{
- /*
- ** Skip _unless_ in MIME mode; see putheader() for the
- ** counterpart where this is skipped _if_ in MIME mode.
- */
-
snprintf(buf, sizeof buf,
"Content-Transfer-Encoding: %.200s", cte);
putline(buf, mci);
@@ -668,22 +662,15 @@ mime_getchar(fp, boundaries, btp)
static bool atbol = TRUE; /* at beginning of line */
static int bt = MBT_SYNTAX; /* boundary type of next EOF */
static u_char buf[128]; /* need not be a full line */
- int start = 0; /* indicates position of - in buffer */
- if (buflen == 1 && *bp == '\n')
- {
- /* last \n in buffer may be part of next MIME boundary */
- c = *bp;
- }
- else if (buflen > 0)
+ if (buflen > 0)
{
buflen--;
return *bp++;
}
- else
- c = getc(fp);
bp = buf;
buflen = 0;
+ c = getc(fp);
if (c == '\n')
{
/* might be part of a MIME boundary */
@@ -695,7 +682,6 @@ mime_getchar(fp, boundaries, btp)
ungetc(c, fp);
return c;
}
- start = 1;
}
if (c != EOF)
*bp++ = c;
@@ -724,7 +710,7 @@ mime_getchar(fp, boundaries, btp)
*bp++ = c;
}
*bp = '\0';
- bt = mimeboundary((char *) &buf[start], boundaries);
+ bt = mimeboundary((char *) &buf[1], boundaries);
switch (bt)
{
case MBT_FINAL:
diff --git a/contrib/sendmail/src/newaliases.1 b/contrib/sendmail/src/newaliases.1
index b9673cd35353f..acf3245316404 100644
--- a/contrib/sendmail/src/newaliases.1
+++ b/contrib/sendmail/src/newaliases.1
@@ -8,7 +8,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)newaliases.1 8.10 (Berkeley) 5/19/1998
+.\" @(#)newaliases.1 8.10 (Berkeley) 5/19/98
.\"
.Dd May 19, 1998
.Dt NEWALIASES 1
diff --git a/contrib/sendmail/src/parseaddr.c b/contrib/sendmail/src/parseaddr.c
index 86762fd669451..c3c89b45d2f27 100644
--- a/contrib/sendmail/src/parseaddr.c
+++ b/contrib/sendmail/src/parseaddr.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)parseaddr.c 8.156 (Berkeley) 10/27/1998";
+static char sccsid[] = "@(#)parseaddr.c 8.153 (Berkeley) 6/24/98";
#endif /* not lint */
# include "sendmail.h"
@@ -67,6 +67,7 @@ parseaddr(addr, a, flags, delim, delimptr, e)
auto char *delimptrbuf;
bool queueup;
char pvpbuf[PSBUFSIZE];
+ extern ADDRESS *buildaddr __P((char **, ADDRESS *, int, ENVELOPE *));
extern bool invalidaddr __P((char *, char *));
extern void allocaddr __P((ADDRESS *, int, char *));
@@ -1449,17 +1450,8 @@ map_lookup(map, key, argvect, pstat, e)
/* XXX should try to auto-open the map here */
if (tTd(60, 1))
- {
- printf("map_lookup(%s, %s", map->s_name, key);
- if (tTd(60, 5))
- {
- int i;
-
- for (i = 0; argvect[i] != NULL; i++)
- printf(", %%%d=%s", i, argvect[i]);
- }
- printf(") => ");
- }
+ printf("map_lookup(%s, %s) => ",
+ map->s_name, key);
replac = (*map->s_map.map_class->map_lookup)(&map->s_map,
key, argvect, &stat);
if (tTd(60, 1))
@@ -1561,7 +1553,7 @@ buildaddr(tv, a, flags, e)
static MAILER errormailer;
static char *discardargv[] = { "DISCARD", NULL };
static char *errorargv[] = { "ERROR", NULL };
- static char ubuf[MAXNAME + 2];
+ static char ubuf[MAXNAME + 1];
if (tTd(24, 5))
{
diff --git a/contrib/sendmail/src/pathnames.h b/contrib/sendmail/src/pathnames.h
index 7a06b120652c8..e10387ee398ed 100644
--- a/contrib/sendmail/src/pathnames.h
+++ b/contrib/sendmail/src/pathnames.h
@@ -8,7 +8,7 @@
* the sendmail distribution.
*
*
- * @(#)pathnames.h 8.8 (Berkeley) 5/19/1998
+ * @(#)pathnames.h 8.8 (Berkeley) 5/19/98
*/
#ifndef _PATH_SENDMAILCF
diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c
index 65e777ac5aba3..24b789a251b8f 100644
--- a/contrib/sendmail/src/queue.c
+++ b/contrib/sendmail/src/queue.c
@@ -14,9 +14,9 @@
#ifndef lint
#if QUEUE
-static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (without queueing)";
#endif
#endif /* not lint */
@@ -611,7 +611,7 @@ runqueue(forkflag, verbose)
{
/* parent -- pick up intermediate zombie */
(void) blocksignal(SIGALRM);
- proc_list_add(pid, "Queue runner");
+ proc_list_add(pid);
(void) releasesignal(SIGALRM);
releasesignal(SIGCHLD);
if (QueueIntvl != 0)
@@ -619,17 +619,13 @@ runqueue(forkflag, verbose)
return TRUE;
}
/* child -- double fork and clean up signals */
- clrcontrol();
proc_list_clear();
-
- /* Add parent process as first child item */
- proc_list_add(getpid(), "Queue runner child process");
releasesignal(SIGCHLD);
(void) setsignal(SIGCHLD, SIG_DFL);
(void) setsignal(SIGHUP, intsig);
}
- sm_setproctitle(TRUE, "running queue: %s", QueueDir);
+ setproctitle("running queue: %s", QueueDir);
if (LogLevel > 69)
sm_syslog(LOG_DEBUG, NOQID,
@@ -754,6 +750,7 @@ runqueue(forkflag, verbose)
else
{
pid_t pid;
+ extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
if (Verbose)
{
@@ -774,7 +771,7 @@ runqueue(forkflag, verbose)
/* exit without the usual cleanup */
e->e_id = NULL;
- finis(TRUE, ExitStat);
+ finis();
/*NOTREACHED*/
return TRUE;
}
@@ -896,16 +893,7 @@ orderq(doall)
continue;
if (strlen(d->d_name) > MAXQFNAME)
- {
- if (Verbose)
- printf("orderq: %s too long, %d max characters\n",
- d->d_name, MAXQFNAME);
- if (LogLevel > 0)
- sm_syslog(LOG_ALERT, NOQID,
- "orderq: %s too long, %d max characters",
- d->d_name, MAXQFNAME);
continue;
- }
check = QueueLimitId;
while (check != NULL)
@@ -1455,16 +1443,6 @@ dowork(id, forkflag, requeueflag, e)
{
/* child -- error messages to the transcript */
QuickAbort = OnlyOneError = FALSE;
-
- /*
- ** Since the delivery may happen in a child and the
- ** parent does not wait, the parent may close the
- ** maps thereby removing any shared memory used by
- ** the map. Therefore, open a copy of the maps for
- ** the delivery process.
- */
-
- initmaps(FALSE, e);
}
}
else
@@ -1496,7 +1474,7 @@ dowork(id, forkflag, requeueflag, e)
disconnect(1, e);
OpMode = MD_DELIVER;
}
- sm_setproctitle(TRUE, "%s: from queue", id);
+ setproctitle("%s: from queue", id);
if (LogLevel > 76)
sm_syslog(LOG_DEBUG, e->e_id,
"dowork, pid=%d",
@@ -1512,7 +1490,7 @@ dowork(id, forkflag, requeueflag, e)
printf("readqf(%s) failed\n", e->e_id);
e->e_id = NULL;
if (forkflag)
- finis(FALSE, EX_OK);
+ exit(EX_OK);
else
return 0;
}
@@ -1528,7 +1506,7 @@ dowork(id, forkflag, requeueflag, e)
/* finish up and exit */
if (forkflag)
- finis(TRUE, ExitStat);
+ finis();
else
dropenvelope(e, TRUE);
}
@@ -1799,6 +1777,7 @@ readqf(e)
curtime() < e->e_dtime + MinQueueAge)
{
char *howlong = pintvl(curtime() - e->e_dtime, TRUE);
+ extern void unlockqueue __P((ENVELOPE *));
if (Verbose || tTd(40, 8))
printf("%s: too young (%s)\n",
@@ -2206,7 +2185,7 @@ queuename(e, type)
continue;
syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_UNAVAILABLE);
+ exit(EX_UNAVAILABLE);
}
do
{
@@ -2233,7 +2212,7 @@ queuename(e, type)
{
syserr("queuename: Cannot lock \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
/* a reader got the file; abandon it and try again */
@@ -2243,7 +2222,7 @@ queuename(e, type)
{
syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
e->e_id = newstr(&qf[2]);
define('i', e->e_id, e);
diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c
index 56aa825981b4f..db71937fba6e2 100644
--- a/contrib/sendmail/src/readcf.c
+++ b/contrib/sendmail/src/readcf.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)readcf.c 8.235 (Berkeley) 8/18/1998";
+static char sccsid[] = "@(#)readcf.c 8.230 (Berkeley) 6/5/98";
#endif /* not lint */
# include "sendmail.h"
@@ -106,19 +106,19 @@ readcf(cfname, safe, e)
if (cf == NULL)
{
syserr("cannot open");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (fstat(fileno(cf), &statb) < 0)
{
syserr("cannot fstat");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (!S_ISREG(statb.st_mode))
{
syserr("not a plain file");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
if (OpMode != MD_TEST && bitset(S_IWGRP|S_IWOTH, statb.st_mode))
@@ -518,7 +518,7 @@ readcf(cfname, safe, e)
if (ferror(cf))
{
syserr("I/O read error");
- finis(FALSE, EX_OSFILE);
+ exit(EX_OSFILE);
}
fclose(cf);
FileName = NULL;
@@ -1515,18 +1515,11 @@ struct optioninfo
#define O_CNCTONLYTO 0xa6
{ "ConnectOnlyTo", O_CNCTONLYTO, FALSE },
#endif
-#if _FFR_TRUSTED_USER
-#define O_TRUSTUSER 0xa7
- { "TrustedUser", O_TRUSTUSER, FALSE },
-#endif
-#if _FFR_MAX_MIME_HEADER_LENGTH
-#define O_MAXMIMEHDRLEN 0xa8
- { "MaxMimeHeaderLength", O_MAXMIMEHDRLEN, FALSE },
-#endif
-#if _FFR_CONTROL_SOCKET
-#define O_CONTROLSOCKET 0xa9
- { "ControlSocketName", O_CONTROLSOCKET, FALSE },
+#if _FFR_TRUSTED_FILE_OWNER
+#define O_TRUSTFILEOWN 0xa7
+ { "TrustedFileOwner", O_TRUSTFILEOWN, FALSE },
#endif
+
{ NULL, '\0', FALSE }
};
@@ -1714,7 +1707,7 @@ setoption(opt, val, safe, sticky, e)
default:
syserr("Unknown 8-bit mode %c", *val);
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
break;
#endif
@@ -1778,7 +1771,7 @@ setoption(opt, val, safe, sticky, e)
default:
syserr("Unknown delivery mode %c", *val);
- finis(FALSE, EX_USAGE);
+ exit(EX_USAGE);
}
buf[0] = (char)e->e_sendmode;
buf[1] = '\0';
@@ -2408,64 +2401,33 @@ setoption(opt, val, safe, sticky, e)
break;
#endif
-#if _FFR_TRUSTED_USER
- case O_TRUSTUSER:
+#if _FFR_TRUSTED_FILE_OWNER
+ case O_TRUSTFILEOWN:
if (isascii(*val) && isdigit(*val))
- TrustedUid = atoi(val);
+ TrustedFileUid = atoi(val);
else
{
register struct passwd *pw;
- TrustedUid = 0;
+ TrustedFileUid = 0;
pw = sm_getpwnam(val);
if (pw == NULL)
- syserr("readcf: option TrustedUser: unknown user %s", val);
+ syserr("readcf: option TrustedFileOwner: unknown user %s", val);
else
- TrustedUid = pw->pw_uid;
+ TrustedFileUid = pw->pw_uid;
}
#ifdef UID_MAX
- if (TrustedUid > UID_MAX)
+ if (TrustedFileUid > UID_MAX)
{
- syserr("readcf: option TrustedUser: uid value (%ld) > UID_MAX (%ld)",
- TrustedUid, UID_MAX);
- TrustedUid = 0;
+ syserr("readcf: option TrustedFileOwner: uid value (%ld) > UID_MAX (%ld)",
+ TrustedFileUid, UID_MAX);
+ TrustedFileUid = 0;
}
#endif
break;
#endif
-#if _FFR_MAX_MIME_HEADER_LENGTH
- case O_MAXMIMEHDRLEN:
- p = strchr(val, '/');
- if (p != NULL)
- *p++ = '\0';
- MaxMimeHeaderLength = atoi(val);
- if (p != NULL && *p != '\0')
- MaxMimeFieldLength = atoi(p);
- else
- MaxMimeFieldLength = MaxMimeHeaderLength / 2;
-
- if (MaxMimeHeaderLength < 0)
- MaxMimeHeaderLength = 0;
- else if (MaxMimeHeaderLength < 128)
- printf("Warning: MaxMimeHeaderLength: header length limit set lower than 128\n");
-
- if (MaxMimeFieldLength < 0)
- MaxMimeFieldLength = 0;
- else if (MaxMimeFieldLength < 40)
- printf("Warning: MaxMimeHeaderLength: field length limit set lower than 40\n");
- break;
-#endif
-
-#if _FFR_CONTROL_SOCKET
- case O_CONTROLSOCKET:
- if (ControlSocketName != NULL)
- free(ControlSocketName);
- ControlSocketName = newstr(val);
- break;
-#endif
-
default:
if (tTd(37, 1))
{
diff --git a/contrib/sendmail/src/recipient.c b/contrib/sendmail/src/recipient.c
index 59412a842c65b..9a73b6a39cf9c 100644
--- a/contrib/sendmail/src/recipient.c
+++ b/contrib/sendmail/src/recipient.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)recipient.c 8.161 (Berkeley) 12/18/1998";
+static char sccsid[] = "@(#)recipient.c 8.154 (Berkeley) 6/24/98";
#endif /* not lint */
# include "sendmail.h"
@@ -331,11 +331,8 @@ recipient(a, sendq, aliaslevel, e)
}
/* add address on list */
- if (pq != NULL)
- {
- *pq = a;
- a->q_next = NULL;
- }
+ *pq = a;
+ a->q_next = NULL;
/*
** Alias the name and handle special mailer types.
@@ -343,10 +340,7 @@ recipient(a, sendq, aliaslevel, e)
trylocaluser:
if (tTd(29, 7))
- {
- printf("at trylocaluser: ");
- printaddr(a, FALSE);
- }
+ printf("at trylocaluser %s\n", a->q_user);
if (bitset(QDONTSEND|QBADADDR|QVERIFIED, a->q_flags))
goto testselfdestruct;
@@ -937,7 +931,7 @@ include(fname, forwarding, ctladdr, sendq, aliaslevel, e)
(int) getuid(), (int) geteuid());
if (forwarding)
- sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOWLINK;
+ sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOSLINK;
ca = getctladdr(ctladdr);
if (ca == NULL)
@@ -1201,7 +1195,7 @@ resetuid:
}
/*
- ** Check to see if some bad guy can write this file
+ ** Check to see if some bad guy can write this file
**
** Group write checking could be more clever, e.g.,
** guessing as to which groups are actually safe ("sys"
diff --git a/contrib/sendmail/src/safefile.c b/contrib/sendmail/src/safefile.c
index ff94b3d243bf4..16f3f3927c993 100644
--- a/contrib/sendmail/src/safefile.c
+++ b/contrib/sendmail/src/safefile.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)safefile.c 8.43 (Berkeley) 10/13/1998";
+static char sccsid[] = "@(#)safefile.c 8.40 (Berkeley) 6/5/98";
#endif /* not lint */
# include "sendmail.h"
@@ -102,7 +102,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
if (bitset(S_ISUID, st->st_mode))
#else
if (bitset(S_ISUID, st->st_mode) && st->st_uid != 0 &&
- st->st_uid != TrustedUid)
+ st->st_uid != TrustedFileUid)
#endif
{
uid = st->st_uid;
@@ -206,7 +206,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
if (stbuf.st_uid == uid)
;
- else if (uid == 0 && stbuf.st_uid == TrustedUid)
+ else if (uid == 0 && TrustedFileUid != 0 && stbuf.st_uid == TrustedFileUid)
;
else
{
@@ -299,7 +299,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
mode >>= 6;
else if (st->st_uid == uid)
;
- else if (uid == 0 && st->st_uid == TrustedUid)
+ else if (uid == 0 && TrustedFileUid != 0 && st->st_uid == TrustedFileUid)
;
else
{
@@ -328,7 +328,7 @@ safefile(fn, uid, gid, uname, flags, mode, st)
(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 ||
- st->st_uid == TrustedUid ||
+ st->st_uid == TrustedFileUid ||
!bitset(SFF_MUSTOWN, flags)) &&
(st->st_mode & mode) == mode)
{
@@ -429,9 +429,9 @@ safedirpath(fn, uid, gid, uname, flags)
}
/*
- ** Let OS determine access to file if we are not
- ** running as a privileged user. This allows ACLs
- ** to work.
+ ** Let OS determine access to file if we are not
+ ** running as a privileged user. This allows ACLs
+ ** to work.
*/
if (geteuid() != 0)
continue;
diff --git a/contrib/sendmail/src/savemail.c b/contrib/sendmail/src/savemail.c
index 53e1a51756caa..4fbfd675621ba 100644
--- a/contrib/sendmail/src/savemail.c
+++ b/contrib/sendmail/src/savemail.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.139 (Berkeley) 8/5/1998";
+static char sccsid[] = "@(#)savemail.c 8.138 (Berkeley) 6/17/98";
#endif /* not lint */
# include "sendmail.h"
@@ -91,7 +91,8 @@ savemail(e, sendbody)
RF_COPYPARSE|RF_SENDERADDR, '\0', NULL, e) == NULL)
{
syserr("553 Cannot parse Postmaster!");
- finis(TRUE, EX_SOFTWARE);
+ ExitStat = EX_SOFTWARE;
+ finis();
}
}
e->e_to = NULL;
@@ -550,7 +551,7 @@ returntosender(msg, returnq, flags, e)
addheader("MIME-Version", "1.0", &ee->e_header);
(void) snprintf(buf, sizeof buf, "%s.%ld/%.100s",
- ee->e_id, (long)curtime(), MyHostName);
+ ee->e_id, curtime(), MyHostName);
ee->e_msgboundary = newstr(buf);
(void) snprintf(buf, sizeof buf,
#if DSN
@@ -587,14 +588,14 @@ returntosender(msg, returnq, flags, e)
else if (bitset(RTSF_PM_BOUNCE, flags))
{
snprintf(buf, sizeof buf, "Postmaster notify: %.*s",
- (int)sizeof buf - 20, msg);
+ sizeof buf - 20, msg);
addheader("Subject", buf, &ee->e_header);
p = "postmaster-notification";
}
else
{
snprintf(buf, sizeof buf, "Returned mail: %.*s",
- (int)sizeof buf - 20, msg);
+ sizeof buf - 20, msg);
addheader("Subject", buf, &ee->e_header);
p = "failure";
}
diff --git a/contrib/sendmail/src/sendmail.8 b/contrib/sendmail/src/sendmail.8
index be31d2eb7c63c..7738e128643b6 100644
--- a/contrib/sendmail/src/sendmail.8
+++ b/contrib/sendmail/src/sendmail.8
@@ -8,9 +8,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" @(#)sendmail.8 8.20 (Berkeley) 8/2/1998
+.\" @(#)sendmail.8 8.19 (Berkeley) 5/19/98
.\"
-.Dd August 2, 1998
+.Dd May 19, 1998
.Dt SENDMAIL 8
.Os BSD 4
.Sh NAME
@@ -277,9 +277,6 @@ Log all traffic in and out of mailers in the indicated log file.
This should only be used as a last resort
for debugging mailer bugs.
It will log a lot of data very quickly.
-.It Fl -
-Stop processing command flags and use the rest of the arguments
-as addresses.
.El
.Ss Options
There are also a number of processing options that may be set.
diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h
index 023799d7e81bb..7bfe11b760696 100644
--- a/contrib/sendmail/src/sendmail.h
+++ b/contrib/sendmail/src/sendmail.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)sendmail.h 8.292 (Berkeley) 11/21/1998
+ * @(#)sendmail.h 8.280 (Berkeley) 6/5/98
*/
/*
@@ -19,7 +19,7 @@
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 8.292 11/21/1998";
+static char SmailSccsId[] = "@(#)sendmail.h 8.280 6/5/98";
# endif
# else /* _DEFINE */
# define EXTERN extern
@@ -684,7 +684,6 @@ MAP
char *map_domain; /* the (nominal) NIS domain */
char *map_rebuild; /* program to run to do auto-rebuild */
time_t map_mtime; /* last database modification time */
- pid_t map_pid; /* PID of process which opened map */
int map_lockfd; /* auxiliary lock file descriptor */
short map_specificity; /* specificity of aliases */
MAP *map_stack[MAXMAPSTACK]; /* list for stacked maps */
@@ -1009,7 +1008,6 @@ extern bool filechanged __P((char *, int, struct stat *));
#define M87F_OUTER 0 /* outer context */
#define M87F_NO8BIT 0x0001 /* can't have 8-bit in this section */
#define M87F_DIGEST 0x0002 /* processing multipart/digest */
-#define M87F_NO8TO7 0x0004 /* don't do 8->7 bit conversions */
/*
@@ -1079,7 +1077,6 @@ extern char *validate_connection __P((SOCKADDR *, char *, ENVELOPE *));
#define VENDOR_SUN 2 /* Sun-native configuration file */
#define VENDOR_HP 3 /* Hewlett-Packard specific config syntax */
#define VENDOR_IBM 4 /* IBM specific config syntax */
-#define VENDOR_SENDMAIL 5 /* Sendmail, Inc. specific config syntax */
EXTERN int VendorCode; /* vendor-specific operation enhancements */
@@ -1100,6 +1097,7 @@ extern void vendor_daemon_setup __P((ENVELOPE *));
#define DBS_GROUPWRITABLEALIASFILE 0x00000010
#define DBS_WORLDWRITABLEALIASFILE 0x00000020
#define DBS_FORWARDFILEINUNSAFEDIRPATH 0x00000040
+#define DBS_INCLUDEFILEINUNSAFEDIRPATH 0x00000060
#define DBS_MAPINUNSAFEDIRPATH 0x00000080
#define DBS_LINKEDALIASFILEINWRITABLEDIR 0x00000100
#define DBS_LINKEDCLASSFILEINWRITABLEDIR 0x00000200
@@ -1122,7 +1120,6 @@ extern void vendor_daemon_setup __P((ENVELOPE *));
#define DBS_INCLUDEFILEINUNSAFEDIRPATHSAFE 0x04000000
#define DBS_RUNPROGRAMINUNSAFEDIRPATH 0x08000000
#define DBS_RUNWRITABLEPROGRAM 0x10000000
-#define DBS_INCLUDEFILEINUNSAFEDIRPATH 0x20000000
/* struct defining such things */
struct dbsval
@@ -1186,7 +1183,7 @@ EXTERN gid_t RealGid; /* real gid of caller */
EXTERN uid_t DefUid; /* default uid to run as */
EXTERN gid_t DefGid; /* default gid to run as */
EXTERN char *DefUser; /* default user to run as (from DefUid) */
-EXTERN uid_t TrustedUid; /* uid of trusted user for files and startup */
+EXTERN uid_t TrustedFileUid; /* uid of trusted owner of files and dirs */
EXTERN MODE_T OldUmask; /* umask when sendmail starts up */
EXTERN int Verbose; /* set if blow-by-blow desired */
EXTERN int Errors; /* set if errors (local to single pass) */
@@ -1224,7 +1221,6 @@ EXTERN char SpaceSub; /* substitution for <lwsp> */
EXTERN int PrivacyFlags; /* privacy flags */
EXTERN char *ConfFile; /* location of configuration file [conf.c] */
EXTERN char *PidFile; /* location of proc id file [conf.c] */
-EXTERN char *ControlSocketName; /* control socket filename [control.c] */
extern ADDRESS NullAddress; /* a null (template) address [main.c] */
EXTERN long WkClassFact; /* multiplier for message class -> priority */
EXTERN long WkRecipFact; /* multiplier for # of recipients -> priority */
@@ -1289,13 +1285,10 @@ EXTERN char *DoubleBounceAddr; /* where to send double bounces */
EXTERN char **ExternalEnviron; /* input environment */
EXTERN char *UserEnviron[MAXUSERENVIRON + 1];
/* saved user environment */
-EXTERN int MaxMimeHeaderLength; /* maximum MIME header length */
-EXTERN int MaxMimeFieldLength; /* maximum MIME field length */
-
extern int errno;
/*
-** Queue Run Limitations
+** Queue Run Limitations
*/
struct queue_char
{
@@ -1407,7 +1400,7 @@ extern char *denlstring __P((char *, bool, bool));
extern void makelower __P((char *));
extern bool rebuildaliases __P((MAP *, bool));
extern void readaliases __P((MAP *, FILE *, bool, bool));
-extern void finis __P((bool, volatile int));
+extern void finis __P((void));
extern void setsender __P((char *, ENVELOPE *, char **, int, bool));
extern void xputs __P((const char *));
extern void logsender __P((ENVELOPE *, char *));
@@ -1435,12 +1428,9 @@ extern void xfclose __P((FILE *, char *, char *));
extern int switch_map_find __P((char *, char *[], short []));
extern void shorten_hostname __P((char []));
extern int waitfor __P((pid_t));
-extern void proc_list_add __P((pid_t, char *));
-extern void proc_list_set __P((pid_t, char *));
+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 proc_list_display __P((FILE *));
-extern void proc_list_probe __P((void));
extern void buffer_errors __P((void));
extern void flush_errors __P((bool));
extern void putline __P((char *, MCI *));
@@ -1478,8 +1468,6 @@ extern bool path_is_dir __P((char *, bool));
extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
extern int drop_privileges __P((bool));
extern void fill_fd __P((int, char *));
-extern void closecontrolsocket __P((bool));
-extern void clrcontrol __P((void));
extern const char *errstring __P((int));
extern sigfunc_t setsignal __P((int, sigfunc_t));
@@ -1503,7 +1491,6 @@ extern void usrerr __P((const char *, ...));
extern void message __P((const char *, ...));
extern void nmessage __P((const char *, ...));
extern void setproctitle __P((const char *, ...));
-extern void sm_setproctitle __P((bool, const char *, ...));
extern void sm_syslog __P((int, const char *, const char *, ...));
#if !HASSNPRINTF
diff --git a/contrib/sendmail/src/sendmail.hf b/contrib/sendmail/src/sendmail.hf
index 0952963b8bd2d..12a306012b387 100644
--- a/contrib/sendmail/src/sendmail.hf
+++ b/contrib/sendmail/src/sendmail.hf
@@ -9,7 +9,7 @@ cpyr By using this file, you agree to the terms and conditions set
cpyr forth in the LICENSE file which can be found at the top level of
cpyr the sendmail distribution.
cpyr
-cpyr @(#)sendmail.hf 8.18 (Berkeley) 11/19/1998
+cpyr @(#)sendmail.hf 8.16 (Berkeley) 5/19/98
cpyr
smtp Topics:
smtp HELO EHLO MAIL RCPT DATA
@@ -117,8 +117,3 @@ dsn ORCPT Original recipient.
-bt /map mapname key :look up `key' in the indicated `mapname'.
-bt rules addr :run the indicated address through the named rules.
-bt Rules can be a comma separated list of rules.
-control Help for smcontrol:
-control help This message.
-control restart Restart sendmail.
-control shutdown Shutdown sendmail.
-control status Show sendmail status.
diff --git a/contrib/sendmail/src/snprintf.c b/contrib/sendmail/src/snprintf.c
index 3e07e1b9920f8..9e0b6f14f15a8 100644
--- a/contrib/sendmail/src/snprintf.c
+++ b/contrib/sendmail/src/snprintf.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)snprintf.c 8.12 (Berkeley) 10/13/1998";
+static char sccsid[] = "@(#)snprintf.c 8.11 (Berkeley) 6/4/98";
#endif /* not lint */
#include "sendmail.h"
@@ -367,10 +367,10 @@ quad_to_string(value)
static char buf[64];
/*
- ** Use sprintf() instead of snprintf() since snprintf()
- ** does not support %qu or %llu. The buffer is large enough
- ** to hold the string so there is no danger of buffer
- ** overflow.
+ ** Use sprintf() instead of snprintf() since snprintf()
+ ** does not support %qu or %llu. The buffer is large enough
+ ** to hold the string so there is no danger of buffer
+ ** overflow.
*/
#if NEED_PERCENTQ
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c
index f4ffe8c0dfa62..fba103c6f0456 100644
--- a/contrib/sendmail/src/srvrsmtp.c
+++ b/contrib/sendmail/src/srvrsmtp.c
@@ -14,9 +14,9 @@
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.187 (Berkeley) 10/23/1998 (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.181 (Berkeley) 6/15/98 (with SMTP)";
#else
-static char sccsid[] = "@(#)srvrsmtp.c 8.187 (Berkeley) 10/23/1998 (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.181 (Berkeley) 6/15/98 (without SMTP)";
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ smtp(nullserver, e)
char *id;
volatile int nrcpts = 0; /* number of RCPT commands */
bool doublequeue;
- volatile bool discard;
+ bool discard;
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 */
@@ -163,7 +163,7 @@ smtp(nullserver, e)
/* check_relay may have set discard bit, save for later */
discard = bitset(EF_DISCARD, e->e_flags);
- sm_setproctitle(TRUE, "server %s startup", CurSmtpClient);
+ setproctitle("server %s startup", CurSmtpClient);
#if DAEMON
if (LogLevel > 11)
{
@@ -222,7 +222,7 @@ smtp(nullserver, e)
/* read the input line */
SmtpPhase = "server cmd read";
- sm_setproctitle(TRUE, "server %s cmd read", CurSmtpClient);
+ setproctitle("server %s cmd read", CurSmtpClient);
p = sfgets(inp, sizeof inp, InChannel, TimeOuts.to_nextcommand,
SmtpPhase);
@@ -243,15 +243,15 @@ smtp(nullserver, e)
CurSmtpClient);
/*
- ** If have not accepted mail (DATA), do not bounce
- ** bad addresses back to sender.
+ ** If have not accepted mail (DATA), do not bounce
+ ** bad addresses back to sender.
*/
if (bitset(EF_CLRQUEUE, e->e_flags))
e->e_sendqueue = NULL;
if (InChild)
ExitStat = EX_QUIT;
- finis(TRUE, ExitStat);
+ finis();
}
/* clean up end of line */
@@ -267,9 +267,9 @@ smtp(nullserver, e)
inp);
if (e->e_id == NULL)
- sm_setproctitle(TRUE, "%s: %.80s", CurSmtpClient, inp);
+ setproctitle("%s: %.80s", CurSmtpClient, inp);
else
- sm_setproctitle(TRUE, "%s %s: %.80s", e->e_id, CurSmtpClient, inp);
+ setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
/* break off command */
for (p = inp; isascii(*p) && isspace(*p); p++)
@@ -457,7 +457,7 @@ smtp(nullserver, e)
{
errno = 0;
syserr("503 Nested MAIL command: MAIL %s", p);
- finis(TRUE, ExitStat);
+ finis();
}
/* make sure we know who the sending host is */
@@ -498,7 +498,7 @@ smtp(nullserver, e)
goto undo_subproc_no_pm;
nrcpts = 0;
e->e_flags |= EF_LOGSENDER|EF_CLRQUEUE;
- sm_setproctitle(TRUE, "%s %s: %.80s", e->e_id, CurSmtpClient, inp);
+ setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
/* child -- go do the processing */
if (setjmp(TopFrame) > 0)
@@ -512,7 +512,7 @@ smtp(nullserver, e)
QuickAbort = FALSE;
SuprErrs = TRUE;
e->e_flags &= ~EF_FATALERRS;
- finis(TRUE, ExitStat);
+ finis();
}
break;
}
@@ -633,14 +633,8 @@ smtp(nullserver, e)
if (p == NULL)
break;
a = parseaddr(p, NULLADDR, RF_COPYALL, ' ', &delimptr, e);
- if (Errors > 0)
- break;
- if (a == NULL)
- {
- usrerr("501 Missing recipient");
+ if (a == NULL || Errors > 0)
break;
- }
-
if (delimptr != NULL && *delimptr != '\0')
*delimptr++ = '\0';
@@ -814,6 +808,8 @@ smtp(nullserver, e)
if (!shouldqueue(e->e_msgpriority, e->e_ctime))
{
+ extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
+
unlockqueue(e);
(void) dowork(id, TRUE, TRUE, e);
}
@@ -822,7 +818,7 @@ smtp(nullserver, e)
abortmessage:
/* if in a child, pop back to our parent */
if (InChild)
- finis(TRUE, ExitStat);
+ finis();
/* clean up a bit */
gotmail = FALSE;
@@ -841,7 +837,7 @@ smtp(nullserver, e)
e->e_sendqueue = NULL;
e->e_flags |= EF_CLRQUEUE;
if (InChild)
- finis(TRUE, ExitStat);
+ finis();
/* clean up a bit */
gotmail = FALSE;
@@ -920,7 +916,7 @@ smtp(nullserver, e)
vrfyqueue = vrfyqueue->q_next;
}
if (InChild)
- finis(TRUE, ExitStat);
+ finis();
break;
case CMDETRN: /* etrn -- force queue flush */
@@ -996,7 +992,7 @@ doquit:
sm_syslog(LOG_INFO, NULL,
"Null connection from %.100s",
CurSmtpClient);
- finis(TRUE, ExitStat);
+ finis();
case CMDVERB: /* set verbose mode */
if (bitset(PRIV_NOEXPN, PrivacyFlags) ||
@@ -1421,7 +1417,7 @@ runinchild(label, e)
auto int st;
/* parent -- wait for child to complete */
- sm_setproctitle(TRUE, "server %s child wait", CurSmtpClient);
+ setproctitle("server %s child wait", CurSmtpClient);
st = waitfor(childpid);
if (st == -1)
syserr("451 %s: lost child", label);
@@ -1433,7 +1429,7 @@ runinchild(label, e)
if (WEXITSTATUS(st) == EX_QUIT)
{
disconnect(1, e);
- finis(TRUE, ExitStat);
+ finis();
}
/* restore the child signal */
@@ -1451,6 +1447,10 @@ runinchild(label, e)
(void) releasesignal(SIGCHLD);
}
}
+
+ /* open alias database */
+ initmaps(FALSE, e);
+
return (0);
}
diff --git a/contrib/sendmail/src/stab.c b/contrib/sendmail/src/stab.c
index 37b87a371246b..1ffc7cb1fcf3d 100644
--- a/contrib/sendmail/src/stab.c
+++ b/contrib/sendmail/src/stab.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stab.c 8.19 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)stab.c 8.19 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/stats.c b/contrib/sendmail/src/stats.c
index b1162ff79ea29..767a55e174132 100644
--- a/contrib/sendmail/src/stats.c
+++ b/contrib/sendmail/src/stats.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stats.c 8.22 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)stats.c 8.22 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/sysexits.c b/contrib/sendmail/src/sysexits.c
index c7934c7384096..10d7c85a1824c 100644
--- a/contrib/sendmail/src/sysexits.c
+++ b/contrib/sendmail/src/sysexits.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)sysexits.c 8.13 (Berkeley) 5/24/1998";
+static char sccsid[] = "@(#)sysexits.c 8.13 (Berkeley) 5/24/98";
#endif /* not lint */
#include "sendmail.h"
diff --git a/contrib/sendmail/src/trace.c b/contrib/sendmail/src/trace.c
index 5ab60325133fd..5ff9795c5122b 100644
--- a/contrib/sendmail/src/trace.c
+++ b/contrib/sendmail/src/trace.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)trace.c 8.12 (Berkeley) 5/19/1998";
+static char sccsid[] = "@(#)trace.c 8.12 (Berkeley) 5/19/98";
#endif /* not lint */
# include "sendmail.h"
diff --git a/contrib/sendmail/src/udb.c b/contrib/sendmail/src/udb.c
index a279afff1552c..e7f42af2ba915 100644
--- a/contrib/sendmail/src/udb.c
+++ b/contrib/sendmail/src/udb.c
@@ -14,9 +14,9 @@
#ifndef lint
#if USERDB
-static char sccsid [] = "@(#)udb.c 8.70 (Berkeley) 12/21/1998 (with USERDB)";
+static char sccsid [] = "@(#)udb.c 8.66 (Berkeley) 6/18/98 (with USERDB)";
#else
-static char sccsid [] = "@(#)udb.c 8.70 (Berkeley) 12/21/1998 (without USERDB)";
+static char sccsid [] = "@(#)udb.c 8.66 (Berkeley) 6/18/98 (without USERDB)";
#endif
#endif
@@ -49,7 +49,6 @@ struct udbent
{
char *udb_spec; /* string version of spec */
int udb_type; /* type of entry */
- pid_t udb_pid; /* PID of process which opened db */
char *udb_default; /* default host for outgoing mail */
union
{
@@ -92,7 +91,7 @@ struct udbent
#define MAXUDBENT 10 /* maximum number of UDB entries */
-struct udb_option
+struct option
{
char *name;
char *val;
@@ -141,7 +140,6 @@ udbexpand(a, sendq, aliaslevel, e)
register struct udbent *up;
int keylen;
int naddrs;
- char *user;
char keybuf[MAXKEY];
bzero(&key, sizeof key);
@@ -166,24 +164,20 @@ udbexpand(a, sendq, aliaslevel, e)
if (UdbSpec == NULL || UdbSpec[0] == '\0')
return EX_OK;
- /* extract user to do userdb matching on */
- user = a->q_user;
-
/* short circuit name begins with '\\' since it can't possibly match */
- /* (might want to treat this as unquoted instead) */
- if (user[0] == '\\')
+ if (a->q_user[0] == '\\')
return EX_OK;
/* if name is too long, assume it won't match */
- if (strlen(user) > (SIZE_T) sizeof keybuf - 12)
+ if (strlen(a->q_user) > (SIZE_T) sizeof keybuf - 12)
return EX_OK;
/* if name begins with a colon, it indicates our metadata */
- if (user[0] == ':')
+ if (a->q_user[0] == ':')
return EX_OK;
/* build actual database key */
- (void) strcpy(keybuf, user);
+ (void) strcpy(keybuf, a->q_user);
(void) strcat(keybuf, ":maildrop");
keylen = strlen(keybuf);
@@ -228,13 +222,8 @@ udbexpand(a, sendq, aliaslevel, e)
#else
i = 0;
if (dbc == NULL &&
-# if DB_VERSION_MAJOR > 2 || DB_VERSION_MINOR >=6
- (errno = (*up->udb_dbp->cursor)(up->udb_dbp,
- NULL, &dbc, 0)) != 0)
-# else
(errno = (*up->udb_dbp->cursor)(up->udb_dbp,
NULL, &dbc)) != 0)
-# endif
i = -1;
if (i != 0 || dbc == NULL ||
(errno = dbc->c_get(dbc, &key,
@@ -903,8 +892,8 @@ _udbx_init(e)
register struct hostent *h;
char *mxhosts[MAXMXHOSTS + 1];
# endif
- struct udb_option opts[MAXUDBOPTS + 1];
- extern int _udb_parsespec __P((char *, struct udb_option [], int));
+ struct option opts[MAXUDBOPTS + 1];
+ extern int _udb_parsespec __P((char *, struct option [], int));
while (*p == ' ' || *p == '\t' || *p == ',')
p++;
@@ -983,7 +972,6 @@ _udbx_init(e)
if (h == NULL)
continue;
up->udb_type = UDB_REMOTE;
- up->udb_pid = getpid();
up->udb_addr.sin_family = h->h_addrtype;
bcopy(h->h_addr_list[0],
(char *) &up->udb_addr.sin_addr,
@@ -1005,7 +993,6 @@ _udbx_init(e)
case '@': /* forward to remote host */
up->udb_type = UDB_FORWARD;
- up->udb_pid = getpid();
up->udb_fwdhost = spec + 1;
ents++;
up++;
@@ -1017,7 +1004,6 @@ _udbx_init(e)
if (strcasecmp(spec, "hesiod") != 0)
goto badspec;
up->udb_type = UDB_HESIOD;
- up->udb_pid = getpid();
ents++;
up++;
break;
@@ -1080,17 +1066,7 @@ _udbx_init(e)
free(up->udb_dbname);
break;
}
- if (tTd(28, 1))
- {
-#if DB_VERSION_MAJOR < 2
- printf("_udbx_init: dbopen(%s)\n",
-#else
- printf("_udbx_init: db_open(%s)\n",
-#endif
- up->udb_dbname);
- }
up->udb_type = UDB_DBFETCH;
- up->udb_pid = getpid();
ents++;
up++;
break;
@@ -1162,15 +1138,6 @@ badspec:
#else
errno = (*up->udb_dbp->close)(up->udb_dbp, 0);
#endif
- if (tTd(28, 1))
- {
-#if DB_VERSION_MAJOR < 2
- printf("_udbx_init: db->close(%s)\n",
-#else
- printf("_udbx_init: db->close(%s)\n",
-#endif
- up->udb_dbname);
- }
}
}
#endif
@@ -1180,7 +1147,7 @@ badspec:
int
_udb_parsespec(udbspec, opt, maxopts)
char *udbspec;
- struct udb_option opt[];
+ struct option opt[];
int maxopts;
{
register char *spec;
@@ -1206,52 +1173,6 @@ _udb_parsespec(udbspec, opt, maxopts)
}
return optnum;
}
- /*
-** _UDBX_CLOSE -- close all file based UDB entries.
-**
-** Parameters:
-** none
-**
-** Returns:
-** none
-*/
-void
-_udbx_close()
-{
- pid_t pid;
- struct udbent *up;
-
- if (!UdbInitialized)
- return;
-
- pid = getpid();
-
- for (up = UdbEnts; up->udb_type != UDB_EOLIST; up++)
- {
- if (up->udb_pid != pid)
- continue;
-
-#ifdef NEWDB
- if (up->udb_type == UDB_DBFETCH)
- {
-#if DB_VERSION_MAJOR < 2
- (*up->udb_dbp->close)(up->udb_dbp);
-#else
- errno = (*up->udb_dbp->close)(up->udb_dbp, 0);
-#endif
- }
- if (tTd(28, 1))
- {
-#if DB_VERSION_MAJOR < 2
- printf("_udbx_init: db->close(%s)\n",
-#else
- printf("_udbx_init: db->close(%s)\n",
-#endif
- up->udb_dbname);
- }
-#endif
- }
-}
#ifdef HESIOD
diff --git a/contrib/sendmail/src/useful.h b/contrib/sendmail/src/useful.h
index a19dd9e0305d6..2a283ab7b8be7 100644
--- a/contrib/sendmail/src/useful.h
+++ b/contrib/sendmail/src/useful.h
@@ -9,7 +9,7 @@
* the sendmail distribution.
*
*
- * @(#)useful.h 8.12 (Berkeley) 5/19/1998
+ * @(#)useful.h 8.12 (Berkeley) 5/19/98
*/
# include <sys/types.h>
diff --git a/contrib/sendmail/src/usersmtp.c b/contrib/sendmail/src/usersmtp.c
index 99ea64696f038..23e4d0256933b 100644
--- a/contrib/sendmail/src/usersmtp.c
+++ b/contrib/sendmail/src/usersmtp.c
@@ -14,9 +14,9 @@
#ifndef lint
#if SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.108 (Berkeley) 10/6/1998 (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.104 (Berkeley) 6/30/98 (with SMTP)";
#else
-static char sccsid[] = "@(#)usersmtp.c 8.108 (Berkeley) 10/6/1998 (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.104 (Berkeley) 6/30/98 (without SMTP)";
#endif
#endif /* not lint */
@@ -118,7 +118,7 @@ smtpinit(m, mci, e)
*/
SmtpPhase = mci->mci_phase = "client greeting";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_initial, esmtp_check);
if (r < 0)
goto tempfail1;
@@ -151,7 +151,7 @@ tryhelo:
smtpmessage("HELO %s", m, mci, MyHostName);
SmtpPhase = mci->mci_phase = "client HELO";
}
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_helo, helo_options);
if (r < 0)
goto tempfail1;
@@ -439,7 +439,7 @@ smtpmailfrom(m, mci, e)
*bufp == '@' ? ',' : ':', bufp, optbuf);
}
SmtpPhase = mci->mci_phase = "client MAIL";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_mail, NULL);
if (r < 0)
{
@@ -580,7 +580,7 @@ smtprcpt(to, m, mci, e)
smtpmessage("RCPT To:<%s>%s", m, mci, to->q_user, optbuf);
SmtpPhase = mci->mci_phase = "client RCPT";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_rcpt, NULL);
to->q_rstatus = newstr(SmtpReplyBuffer);
to->q_status = smtptodsn(r);
@@ -661,7 +661,7 @@ smtpdata(m, mci, e)
/* send the command and check ok to proceed */
smtpmessage("DATA", m, mci);
SmtpPhase = mci->mci_phase = "client DATA 354";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_datainit, NULL);
if (r < 0 || REPLYTYPE(r) == 4)
{
@@ -741,7 +741,7 @@ smtpdata(m, mci, e)
/* check for the results of the transaction */
SmtpPhase = mci->mci_phase = "client DATA status";
- sm_setproctitle(TRUE, "%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
+ setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
if (bitnset(M_LMTP, m->m_flags))
return EX_OK;
r = reply(m, mci, e, TimeOuts.to_datafinal, NULL);
@@ -974,6 +974,7 @@ reply(m, mci, e, timeout, pfunc)
for (;;)
{
register char *p;
+ extern time_t curtime __P((void));
/* actually do the read */
if (e->e_xfp != NULL)
@@ -1007,10 +1008,7 @@ reply(m, mci, e, timeout, pfunc)
oldholderrs = HoldErrs;
HoldErrs = TRUE;
usrerr("451 reply: read error from %s", CurHostName);
-
- /* errors on QUIT should not be persistent */
- if (strncmp(SmtpMsgBuffer, "QUIT", 4) != 0)
- mci_setstat(mci, EX_TEMPFAIL, "4.4.2", MsgBuf);
+ mci_setstat(mci, EX_TEMPFAIL, "4.4.2", MsgBuf);
/* if debugging, pause so we can see state */
if (tTd(18, 100))
@@ -1034,8 +1032,7 @@ reply(m, mci, e, timeout, pfunc)
wbufleft -= plen;
}
snprintf(p, wbufleft, "reply(%.100s) during %s",
- CurHostName == NULL ? "NO_HOST" : CurHostName,
- SmtpPhase);
+ CurHostName, SmtpPhase);
checkfd012(wbuf);
}
#endif
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c
index 785d36269eb98..ba35dcd9531cb 100644
--- a/contrib/sendmail/src/util.c
+++ b/contrib/sendmail/src/util.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)util.c 8.167 (Berkeley) 12/1/1998";
+static char sccsid[] = "@(#)util.c 8.159 (Berkeley) 7/1/98";
#endif /* not lint */
# include "sendmail.h"
@@ -174,182 +174,6 @@ rfc822_string(s)
return TRUE;
}
/*
-** SHORTEN_RFC822_STRING -- Truncate and rebalance an RFC822 string
-**
-** Arbitratily shorten (in place) an RFC822 string and rebalance
-** comments and quotes.
-**
-** Parameters:
-** string -- the string to shorten
-** length -- the maximum size, 0 if no maximum
-**
-** Returns:
-** TRUE if string is changed, FALSE otherwise
-**
-** Side Effects:
-** Changes string in place, possibly resulting
-** in a shorter string.
-*/
-
-bool
-shorten_rfc822_string(string, length)
- char *string;
- size_t length;
-{
- bool backslash = FALSE;
- bool modified = FALSE;
- bool quoted = FALSE;
- size_t slen;
- int parencount = 0;
- char *ptr = string;
-
- /*
- ** If have to rebalance an already short enough string,
- ** need to do it within allocated space.
- */
- slen = strlen(string);
- if (length == 0 || slen < length)
- length = slen;
-
- while (*ptr != '\0')
- {
- if (backslash)
- {
- backslash = FALSE;
- goto increment;
- }
-
- if (*ptr == '\\')
- backslash = TRUE;
- else if (*ptr == '(')
- {
- if (!quoted)
- parencount++;
- }
- else if (*ptr == ')')
- {
- if (--parencount < 0)
- parencount = 0;
- }
-
- /* Inside a comment, quotes don't matter */
- if (parencount <= 0 && *ptr == '"')
- quoted = !quoted;
-
-increment:
- /* Check for sufficient space for next character */
- if (length - (ptr - string) <= ((backslash ? 1 : 0) +
- parencount +
- (quoted ? 1 : 0)))
- {
- /* Not enough, backtrack */
- if (*ptr == '\\')
- backslash = FALSE;
- else if (*ptr == '(' && !quoted)
- parencount--;
- else if (*ptr == '"' && parencount == 0)
- quoted = FALSE;
- break;
- }
- ptr++;
- }
-
- /* Rebalance */
- while (parencount-- > 0)
- {
- if (*ptr != ')')
- {
- modified = TRUE;
- *ptr = ')';
- }
- ptr++;
- }
- if (quoted)
- {
- if (*ptr != '"')
- {
- modified = TRUE;
- *ptr = '"';
- }
- ptr++;
- }
- if (*ptr != '\0')
- {
- modified = TRUE;
- *ptr = '\0';
- }
- return modified;
-}
- /*
-** FIND_CHARACTER -- find an unquoted character in an RFC822 string
-**
-** Find an unquoted, non-commented character in an RFC822
-** string and return a pointer to its location in the
-** string.
-**
-** Parameters:
-** string -- the string to search
-** character -- the character to find
-**
-** Returns:
-** pointer to the character, or
-** a pointer to the end of the line if character is not found
-*/
-
-char *
-find_character(string, character)
- char *string;
- char character;
-{
- bool backslash = FALSE;
- bool quoted = FALSE;
- int parencount = 0;
-
- while (string != NULL && *string != '\0')
- {
- if (backslash)
- {
- backslash = FALSE;
- if (!quoted && character == '\\' && *string == '\\')
- break;
- string++;
- continue;
- }
- switch (*string)
- {
- case '\\':
- backslash = TRUE;
- break;
-
- case '(':
- if (!quoted)
- parencount++;
- break;
-
- case ')':
- if (--parencount < 0)
- parencount = 0;
- break;
- }
-
- /* Inside a comment, nothing matters */
- if (parencount > 0)
- {
- string++;
- continue;
- }
-
- if (*string == '"')
- quoted = !quoted;
- else if (*string == character && !quoted)
- break;
- string++;
- }
-
- /* Return pointer to the character */
- return string;
-}
- /*
** XALLOC -- Allocate memory and bitch wildly on failure.
**
** THIS IS A CLUDGE. This should be made to give a proper
@@ -2022,13 +1846,7 @@ path_is_dir(pathname, createflag)
** none
*/
-struct procs
-{
- pid_t proc_pid;
- char *proc_task;
-};
-
-static struct procs *ProcListVec = NULL;
+static pid_t *ProcListVec = NULL;
static int ProcListSize = 0;
#define NO_PID ((pid_t) 0)
@@ -2037,15 +1855,15 @@ static int ProcListSize = 0;
#endif
void
-proc_list_add(pid, task)
+proc_list_add(pid)
pid_t pid;
- char *task;
{
int i;
+ extern void proc_list_probe __P((void));
for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == NO_PID)
+ if (ProcListVec[i] == NO_PID)
break;
}
if (i >= ProcListSize)
@@ -2056,66 +1874,29 @@ proc_list_add(pid, task)
/* now scan again */
for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == NO_PID)
+ if (ProcListVec[i] == NO_PID)
break;
}
}
if (i >= ProcListSize)
{
/* grow process list */
- struct procs *npv;
+ pid_t *npv;
- npv = (struct procs *) xalloc(sizeof (struct procs) * (ProcListSize + PROC_LIST_SEG));
+ npv = (pid_t *) xalloc(sizeof (pid_t) * (ProcListSize + PROC_LIST_SEG));
if (ProcListSize > 0)
{
- bcopy(ProcListVec, npv, ProcListSize *
- sizeof (struct procs));
+ bcopy(ProcListVec, npv, ProcListSize * sizeof (pid_t));
free(ProcListVec);
}
for (i = ProcListSize; i < ProcListSize + PROC_LIST_SEG; i++)
- {
- npv[i].proc_pid = NO_PID;
- npv[i].proc_task = NULL;
- }
+ npv[i] = NO_PID;
i = ProcListSize;
ProcListSize += PROC_LIST_SEG;
ProcListVec = npv;
}
- ProcListVec[i].proc_pid = pid;
- ProcListVec[i].proc_task = newstr(task);
-
- /* if process adding itself, it's not a child */
- if (pid != getpid())
- CurChildren++;
-}
- /*
-** PROC_LIST_SET -- set pid task in process list
-**
-** Parameters:
-** pid -- pid to set
-** task -- task of pid
-**
-** Returns:
-** none.
-*/
-
-void
-proc_list_set(pid, task)
- pid_t pid;
- char *task;
-{
- int i;
-
- for (i = 0; i < ProcListSize; i++)
- {
- if (ProcListVec[i].proc_pid == pid)
- {
- if (ProcListVec[i].proc_task != NULL)
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = newstr(task);
- break;
- }
- }
+ ProcListVec[i] = pid;
+ CurChildren++;
}
/*
** PROC_LIST_DROP -- drop pid from process list
@@ -2135,14 +1916,9 @@ proc_list_drop(pid)
for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == pid)
+ if (ProcListVec[i] == pid)
{
- ProcListVec[i].proc_pid = NO_PID;
- if (ProcListVec[i].proc_task != NULL)
- {
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = NULL;
- }
+ ProcListVec[i] = NO_PID;
break;
}
}
@@ -2164,16 +1940,8 @@ proc_list_clear()
{
int i;
- /* start from 1 since 0 is the daemon itself */
- for (i = 1; i < ProcListSize; i++)
- {
- ProcListVec[i].proc_pid = NO_PID;
- if (ProcListVec[i].proc_task != NULL)
- {
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = NULL;
- }
- }
+ for (i = 0; i < ProcListSize; i++)
+ ProcListVec[i] = NO_PID;
CurChildren = 0;
}
/*
@@ -2191,23 +1959,17 @@ proc_list_probe()
{
int i;
- /* start from 1 since 0 is the daemon itself */
- for (i = 1; i < ProcListSize; i++)
+ for (i = 0; i < ProcListSize; i++)
{
- if (ProcListVec[i].proc_pid == NO_PID)
+ if (ProcListVec[i] == NO_PID)
continue;
- if (kill(ProcListVec[i].proc_pid, 0) < 0)
+ if (kill(ProcListVec[i], 0) < 0)
{
if (LogLevel > 3)
sm_syslog(LOG_DEBUG, CurEnv->e_id,
"proc_list_probe: lost pid %d",
- (int) ProcListVec[i].proc_pid);
- ProcListVec[i].proc_pid = NO_PID;
- if (ProcListVec[i].proc_task != NULL)
- {
- free(ProcListVec[i].proc_task);
- ProcListVec[i].proc_task = NULL;
- }
+ ProcListVec[i]);
+ ProcListVec[i] = NO_PID;
CurChildren--;
}
}
@@ -2215,35 +1977,6 @@ proc_list_probe()
CurChildren = 0;
}
/*
-** PROC_LIST_DISPLAY -- display the process list
-**
-** Parameters:
-** out -- output file pointer
-**
-** Returns:
-** none.
-*/
-
-void
-proc_list_display(out)
- FILE *out;
-{
- int i;
-
- for (i = 0; i < ProcListSize; i++)
- {
- if (ProcListVec[i].proc_pid == NO_PID)
- continue;
-
- fprintf(out, "%d %s%s\n", (int) ProcListVec[i].proc_pid,
- ProcListVec[i].proc_task != NULL ?
- ProcListVec[i].proc_task : "(unknown)",
- (OpMode == MD_SMTP ||
- OpMode == MD_DAEMON ||
- OpMode == MD_ARPAFTP) ? "\r" : "");
- }
-}
- /*
** SM_STRCASECMP -- 8-bit clean version of strcasecmp
**
** Thank you, vendors, for making this all necessary.
diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c
index 8e8707b7a9f56..bf0b3918adc48 100644
--- a/contrib/sendmail/src/version.c
+++ b/contrib/sendmail/src/version.c
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)version.c 8.9.2.1 (Berkeley) 12/29/1998";
+static char sccsid[] = "@(#)version.c 8.9.1.1 (Berkeley) 7/2/98";
#endif /* not lint */
-char Version[] = "8.9.2";
+char Version[] = "8.9.1";