summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-10-01 17:18:31 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-10-01 17:18:31 +0000
commit43d38ada21ea773ebfa5e9e6541b53e85250309e (patch)
tree308de1fc7bbef3214be358a1762c932758b1f0ae /gnu
parent8dee1861c085bad9fb091c6ac52dca6100e5899c (diff)
Update to sendmail 8.12.1.
A potential security problem has been uncovered in 8.12.0 which might be exploited locally by malicious users to gain access to the client mail queue. However, as long as the MTA accepts local connections, the possible consequences of this potential local exploit are small. Notice: some operating systems don't provide a way to completely drop privileges from a set-group-ID program. In that case sendmail refuses to run if unsafe options are given.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.sbin/sendmail/README18
-rw-r--r--gnu/usr.sbin/sendmail/RELEASE_NOTES71
-rw-r--r--gnu/usr.sbin/sendmail/cf/README53
-rw-r--r--gnu/usr.sbin/sendmail/cf/feature/dnsbl.m44
-rw-r--r--gnu/usr.sbin/sendmail/cf/feature/msp.m44
-rw-r--r--gnu/usr.sbin/sendmail/cf/m4/proto.m418
-rw-r--r--gnu/usr.sbin/sendmail/cf/m4/version.m44
-rw-r--r--gnu/usr.sbin/sendmail/doc/op/op.me37
-rw-r--r--gnu/usr.sbin/sendmail/include/libmilter/mfapi.h32
-rw-r--r--gnu/usr.sbin/sendmail/include/libmilter/mfdef.h12
-rw-r--r--gnu/usr.sbin/sendmail/include/libsmdb/smdb.h26
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/bitops.h9
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/conf.h16
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/gen.h2
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/os/sm_os_aix.h7
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/os/sm_os_irix.h7
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/os/sm_os_openunix.h5
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/os/sm_os_osf1.h7
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/os/sm_os_ultrix.h7
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/os/sm_os_unixware.h8
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/stdio.h108
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/sysstat.h29
-rw-r--r--gnu/usr.sbin/sendmail/include/sm/varargs.h3
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/comm.c4
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/engine.c40
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/handler.c2
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/libmilter.h2
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/listener.c10
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/main.c4
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/signal.c14
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/sm_gethost.c4
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/smfi.c57
-rw-r--r--gnu/usr.sbin/sendmail/libsm/assert.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/b-strcmp.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/b-strl.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/cf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/clock.c10
-rw-r--r--gnu/usr.sbin/sendmail/libsm/clrerr.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/config.c9
-rw-r--r--gnu/usr.sbin/sendmail/libsm/debug.c4
-rw-r--r--gnu/usr.sbin/sendmail/libsm/errstring.c14
-rw-r--r--gnu/usr.sbin/sendmail/libsm/exc.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fclose.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/feof.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/ferror.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fflush.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fget.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/findfp.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/flags.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fopen.c12
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fpos.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fprintf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fpurge.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fput.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fread.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fscanf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fseek.c4
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fvwrite.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fwalk.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/fwrite.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/get.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/heap.c6
-rw-r--r--gnu/usr.sbin/sendmail/libsm/ldap.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/makebuf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/match.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/mbdb.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/niprop.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/path.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/put.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/refill.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/rewind.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/rpool.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/setvbuf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/shm.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/signal.c14
-rw-r--r--gnu/usr.sbin/sendmail/libsm/smstdio.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/snprintf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/sscanf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/stdio.c4
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strcasecmp.c4
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strdup.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strerror.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strexit.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/string.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/stringf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strio.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strl.c6
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strrevcmp.c4
-rw-r--r--gnu/usr.sbin/sendmail/libsm/strto.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/syslogio.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-cf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-event.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-exc.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-float.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-fopen.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-heap.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-match.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-path.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-rpool.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-scanf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-shm.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-smstdio.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-string.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-strio.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-strl.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-strrevcmp.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/t-types.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/test.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/ungetc.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vasprintf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vfprintf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vfscanf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vprintf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vsnprintf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vsprintf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/vsscanf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/wbuf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/wsetup.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsm/xtrap.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsmdb/smdb.c28
-rw-r--r--gnu/usr.sbin/sendmail/libsmdb/smdb1.c14
-rw-r--r--gnu/usr.sbin/sendmail/libsmdb/smdb2.c16
-rw-r--r--gnu/usr.sbin/sendmail/libsmdb/smndbm.c6
-rw-r--r--gnu/usr.sbin/sendmail/libsmutil/cf.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsmutil/debug.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsmutil/err.c2
-rw-r--r--gnu/usr.sbin/sendmail/libsmutil/lockfile.c4
-rw-r--r--gnu/usr.sbin/sendmail/libsmutil/safefile.c17
-rw-r--r--gnu/usr.sbin/sendmail/libsmutil/snprintf.c4
-rw-r--r--gnu/usr.sbin/sendmail/mail.local/mail.local.c2
-rw-r--r--gnu/usr.sbin/sendmail/mailstats/mailstats.c2
-rw-r--r--gnu/usr.sbin/sendmail/makemap/makemap.c7
-rw-r--r--gnu/usr.sbin/sendmail/praliases/praliases.c2
-rw-r--r--gnu/usr.sbin/sendmail/rmail/rmail.c4
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/README15
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/SECURITY16
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/alias.c16
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/arpadate.c2
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/bf.c2
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/collect.c16
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/conf.c130
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/conf.h2
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/control.c14
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/convtime.c4
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/daemon.c124
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/deliver.c101
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/domain.c24
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/envelope.c52
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/err.c26
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/headers.c28
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/macro.c12
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/main.c365
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/map.c98
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/mci.c42
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/milter.c130
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/mime.c24
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/parseaddr.c72
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/queue.c492
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/readcf.c39
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/recipient.c18
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sasl.c4
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/savemail.c21
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sendmail.h106
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sfsasl.c2
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/shmticklib.c4
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sm_resolve.c2
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c161
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/stab.c12
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/stats.c8
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/sysexits.c6
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/timers.c2
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/tls.c28
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/trace.c2
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/udb.c14
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/usersmtp.c63
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/util.c116
-rw-r--r--gnu/usr.sbin/sendmail/sendmail/version.c4
-rw-r--r--gnu/usr.sbin/sendmail/smrsh/smrsh.c2
-rw-r--r--gnu/usr.sbin/sendmail/vacation/vacation.c5
179 files changed, 2172 insertions, 1231 deletions
diff --git a/gnu/usr.sbin/sendmail/README b/gnu/usr.sbin/sendmail/README
index 2bf3438365e..03430cc884a 100644
--- a/gnu/usr.sbin/sendmail/README
+++ b/gnu/usr.sbin/sendmail/README
@@ -176,15 +176,13 @@ Important RFCs for electronic mail are:
RFC974 MX routing
RFC976 UUCP mail format
RFC1123 Host requirements (modifies 821, 822, and 974)
- RFC1413 Identification server
- RFC1869 SMTP Service Extensions (ESMTP spec)
- RFC1652 SMTP Service Extension for 8bit-MIMEtransport
- RFC1870 SMTP Service Extension for Message Size Declaration
- RFC2045 Multipurpose Internet Mail Extensions (MIME) Part One:
- Format of Internet Message Bodies
RFC1344 Implications of MIME for Internet Mail Gateways
+ RFC1413 Identification server
RFC1428 Transition of Internet Mail from Just-Send-8 to
8-bit SMTP/MIME
+ RFC1652 SMTP Service Extension for 8bit-MIMEtransport
+ RFC1869 SMTP Service Extensions (ESMTP spec)
+ RFC1870 SMTP Service Extension for Message Size Declaration
RFC1891 SMTP Service Extension for Delivery Status Notifications
RFC1892 Multipart/Report Content Type for the Reporting of
Mail System Administrative Messages
@@ -194,9 +192,15 @@ Important RFCs for electronic mail are:
RFC1985 SMTP Service Extension for Remote Message Queue Starting
RFC2033 Local Mail Transfer Protocol (LMTP)
RFC2034 SMTP Service Extension for Returning Enhanced Error Codes
+ RFC2045 Multipurpose Internet Mail Extensions (MIME) Part One:
+ Format of Internet Message Bodies
RFC2476 Message Submission
RFC2487 SMTP Service Extension for Secure SMTP over TLS
RFC2554 SMTP Service Extension for Authentication
+ RFC2821 Simple Mail Transfer Protocol
+ RFC2822 Internet Message Format
+ RFC2852 Deliver By SMTP Service Extension
+ RFC2920 SMTP Service Extension for Command Pipelining
Other standards that may be of interest (but which are less directly
relevant to sendmail) are:
@@ -396,4 +400,4 @@ sendmail Source for the sendmail program itself.
test Some test scripts (currently only for compilation aids).
vacation Source for the vacation program. NOT PART OF SENDMAIL!
-$Revision: 1.6 $, Last updated $Date: 2001/09/11 19:02:47 $
+$Revision: 1.7 $, Last updated $Date: 2001/10/01 17:18:28 $
diff --git a/gnu/usr.sbin/sendmail/RELEASE_NOTES b/gnu/usr.sbin/sendmail/RELEASE_NOTES
index 37534e49fb3..6adfa0d9fd0 100644
--- a/gnu/usr.sbin/sendmail/RELEASE_NOTES
+++ b/gnu/usr.sbin/sendmail/RELEASE_NOTES
@@ -1,11 +1,78 @@
SENDMAIL RELEASE NOTES
- $Sendmail: RELEASE_NOTES,v 8.1127 2001/09/08 01:30:01 ca Exp $
+ $Sendmail: RELEASE_NOTES,v 8.1155 2001/09/30 01:07:23 ca Exp $
This listing shows the version of the sendmail binary, the version
of the sendmail configuration files, the date of release, and a
summary of the changes in that release.
+8.12.1/8.12.1 2001/10/01
+ SECURITY: Check whether dropping group privileges actually succeeded
+ to avoid possible compromises of the mail system by
+ supplying bogus data. Add configuration options for
+ different set*gid() calls to reset saved gid. Problem
+ found by Michal Zalewski.
+ PRIVACY: Prevent information leakage when sendmail has extra
+ privileges by disabling debugging (command line -d flag)
+ during queue runs and disabling ETRN when sendmail -bs is
+ used. Suggested by Michal Zalewski.
+ Avoid memory corruption problems resulting from bogus .cf files.
+ Problem found by Michal Zalewski.
+ Set the ${server_addr} macro to name of mailer when doing LMTP
+ delivery. LMTP systems may offer SMTP Authentication or
+ STARTTLS causing sendmail to use this macro in rulesets.
+ If debugging is turned on (-d0.10) print not just the default
+ values for configuration file and pid file but also the
+ selected values. Problem noted by Brad Chapman.
+ Continue dealing with broken nameservers by ignoring SERVFAIL
+ errors returned on T_AAAA (IPv6) lookups at delivery time
+ if ResolverOptions=WorkAroundBrokenAAAA is set. Previously
+ this only applied to hostname canonification. Problem
+ noted by Bill Fenner of AT&T Research.
+ Ignore comments in NIS host records when trying to find the
+ canonical name for a host.
+ When sendmail has extra privileges, limit mail submission command
+ line flags (i.e., -G, -h, -F, etc.) to mail submission
+ operating modes (i.e., -bm, -bs, -bv, etc.). Idea based on
+ suggestion from Michal Zalewski.
+ Portability:
+ AIX: Use `oslevel` if available to determine OS version.
+ `uname` does not given complete information.
+ Problem noted by Keith Neufeld of the Cessna
+ Aircraft Company.
+ OpenUNIX: Use lockf() for LDA delivery (affects mail.local).
+ Problem noticed by Boyd Lynn Gerber of ZENEX.
+ Avoid compiler warnings by not using pointers to pass
+ integers. Problem noted by Todd C. Miller of
+ Courtesan Consulting.
+ CONFIG: Add restrictqrun to PrivacyOptions for the MSP to minimize
+ problems with potential misconfigurations.
+ CONFIG: Fix comment showing default value of MaxHopCount. Problem
+ noted by Greg Robinson of the Defence Science and
+ Technology Organisation of Australia.
+ CONFIG: dnsbl: If an argument specifies an error message in case
+ of temporary lookup failures for DNS based blacklists
+ then use it.
+ LIBMILTER: Install mfdef.h, required by mfapi.h. Problem noted by
+ Richard A. Nelson of Debian.
+ LIBMILTER: Add __P definition for OS that lack it. Problem noted
+ by Chris Adams from HiWAAY Informations Services.
+ LIBSMDB: Fix a lock race condition that affects makemap, praliases,
+ and vacation.
+ MAKEMAP: Avoid going beyond the end of an input line if it does
+ not contain a value for a key. Based on patch from
+ Mark Bixby from Hewlett-Packard.
+ New Files:
+ test/Build
+ test/Makefile
+ test/Makefile.m4
+ test/README
+ test/t_dropgid.c
+ test/t_setgid.c
+ Deleted Files:
+ include/sm/stdio.h
+ include/sm/sysstat.h
+
8.12.0/8.12.0 2001/09/08
*NOTICE*: The default installation of sendmail does not use
set-user-ID root anymore. You need to create a new user and
@@ -51,7 +118,7 @@ summary of the changes in that release.
file: client or mta). See sendmail/SECURITY.
The SMTP server no longer forks on each MAIL command. The ONEX
command has been removed.
- Implement SMTP PIPELINING per RFC 1854. It can be turned off
+ Implement SMTP PIPELINING per RFC 2920. It can be turned off
at compile time or per host (ruleset).
New option MailboxDatabase specifies the type of mailbox database
used to look up local mail recipients; the default value
diff --git a/gnu/usr.sbin/sendmail/cf/README b/gnu/usr.sbin/sendmail/cf/README
index 885a650f6c1..55654271b8e 100644
--- a/gnu/usr.sbin/sendmail/cf/README
+++ b/gnu/usr.sbin/sendmail/cf/README
@@ -463,7 +463,9 @@ the default value. Example:
MODIFY_MAILER_FLAGS(`LOCAL', `+e')
-will add the flag `e' to LOCAL_MAILER_FLAGS.
+will add the flag `e' to LOCAL_MAILER_FLAGS. Notice: there are
+several smtp mailers all of which are manipulated individually.
+See the section MAILERS for the available mailer names.
WARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS
unconditionally, i.e., without respecting any definitions in an
OSTYPE setting.
@@ -1265,7 +1267,7 @@ msp Defines config file for Message Submission Program.
all e-mails to. If `MSA' is specified as second argument
then port 587 is used to contact the server. Example:
- FEATURE(`msp, `', `MSA')
+ FEATURE(`msp', `', `MSA')
Some more hints about possible changes can be found below
in the section MESSAGE SUBMISSION PROGRAM.
@@ -2661,7 +2663,34 @@ Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
(line breaks have been inserted for readability).
-Of course it is also possible to write a simple rulesets that allows
+Examples:
+
+To allow relaying for everyone who can present a cert signed by
+
+/C=US/ST=California/O=endmail.org/OU=private/CN=
+Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
+
+simply use:
+
+CERTIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
+Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org RELAY
+
+To allow relaying only for a subset of machines that have a cert signed by
+
+/C=US/ST=California/O=endmail.org/OU=private/CN=
+Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
+
+use:
+
+CERTIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
+Darth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org SUBJECT
+CERTSubject:/C=US/ST=California/O=endmail.org/OU=private/CN=
+DeathStar/Email=deathstar@endmail.org RELAY
+
+Note: line breaks have been inserted after "CN=" for readability,
+each tagged entry must be one (long) line in the access map.
+
+Of course it is also possible to write a simple ruleset that allows
relaying for everyone who can present a cert that can be verified, e.g.,
LOCAL_RULESETS
@@ -3947,12 +3976,16 @@ include:
Some things are not intended to work with the MSP. These include
features that influence the delivery process (e.g., mailertable,
aliases), or those that are only important for a SMTP server (e.g.,
-virtusertable, DaemonPortOptions). Other things don't work well
-with the MSP and require tweaking or workarounds. For example, to
-allow for client authentication it is not just sufficient to provide
-a client certificate and the corresponding key, but it is also
-necessary to make the key group (smmsp) readable and tell sendmail
-not to complain about that, i.e.,
+virtusertable, DaemonPortOptions, multiple queues). Moreover,
+relaxing certain restrictions (RestrictQueueRun, permissions on
+queue directory) or adding features (e.g., enabling prog/file mailer)
+can cause security problems.
+
+Other things don't work well with the MSP and require tweaking or
+workarounds. For example, to allow for client authentication it
+is not just sufficient to provide a client certificate and the
+corresponding key, but it is also necessary to make the key group
+(smmsp) readable and tell sendmail not to complain about that, i.e.,
define(`confDONT_BLAME_SENDMAIL', `GroupReadableKeyFile')
@@ -4176,4 +4209,4 @@ M4 DIVERSIONS
8 DNS based blacklists
9 special local rulesets (1 and 2)
-$Revision: 1.9 $, Last updated $Date: 2001/09/11 19:02:48 $
+$Revision: 1.10 $, Last updated $Date: 2001/10/01 17:18:28 $
diff --git a/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4 b/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4
index a66f47ed8cb..f008f68409c 100644
--- a/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4
+++ b/gnu/usr.sbin/sendmail/cf/feature/dnsbl.m4
@@ -11,7 +11,7 @@ divert(-1)
divert(0)
ifdef(`_DNSBL_R_',`dnl',`dnl
-VERSIONID(`$Sendmail: dnsbl.m4,v 8.24 2001/03/29 20:48:45 gshapiro Exp $')
+VERSIONID(`$Sendmail: dnsbl.m4,v 8.25 2001/09/18 21:47:39 ca Exp $')
define(`_DNSBL_R_',`')
LOCAL_CONFIG
# map for DNS based blacklist lookups
@@ -19,7 +19,7 @@ Kdnsbl host -T<TMP>')
divert(-1)
define(`_DNSBL_SRV_', `ifelse(len(X`'_ARG_),`1',`blackholes.mail-abuse.org',_ARG_)')dnl
define(`_DNSBL_MSG_', `ifelse(len(X`'_ARG2_),`1',`"550 Mail from " $`'&{client_addr} " refused by blackhole site '_DNSBL_SRV_`"',`_ARG2_')')dnl
-define(`_DNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_DNSBL_SRV_`"',`_ARG2_')')dnl
+define(`_DNSBL_MSG_TMP_', `ifelse(_ARG3_,`t',`"451 Temporary lookup failure of " $`'&{client_addr} " at '_DNSBL_SRV_`"',`_ARG3_')')dnl
divert(8)
# DNS based IP address spam list _DNSBL_SRV_
R$* $: $&{client_addr}
diff --git a/gnu/usr.sbin/sendmail/cf/feature/msp.m4 b/gnu/usr.sbin/sendmail/cf/feature/msp.m4
index de8ee0c4697..e3f5f80f9bb 100644
--- a/gnu/usr.sbin/sendmail/cf/feature/msp.m4
+++ b/gnu/usr.sbin/sendmail/cf/feature/msp.m4
@@ -10,13 +10,13 @@ divert(-1)
#
divert(0)dnl
-VERSIONID(`$Sendmail: msp.m4,v 1.27 2001/08/16 16:31:29 ca Exp $')
+VERSIONID(`$Sendmail: msp.m4,v 1.28 2001/09/22 21:46:42 ca Exp $')
divert(-1)
define(`ALIAS_FILE', `')
define(`confDELIVERY_MODE', `i')
define(`confUSE_MSP', `True')
define(`confFORWARD_PATH', `')
-define(`confPRIVACY_FLAGS', `goaway,noetrn')
+define(`confPRIVACY_FLAGS', `goaway,noetrn,restrictqrun')
define(`confDONT_PROBE_INTERFACES', `True')
dnl ---------------------------------------------
dnl run as this user (even if called by root)
diff --git a/gnu/usr.sbin/sendmail/cf/m4/proto.m4 b/gnu/usr.sbin/sendmail/cf/m4/proto.m4
index dc2ae85c02c..909783c7f15 100644
--- a/gnu/usr.sbin/sendmail/cf/m4/proto.m4
+++ b/gnu/usr.sbin/sendmail/cf/m4/proto.m4
@@ -13,7 +13,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`$Sendmail: proto.m4,v 8.620 2001/08/20 00:55:08 ca Exp $')
+VERSIONID(`$Sendmail: proto.m4,v 8.624 2001/09/28 21:52:59 ca Exp $')
# level CF_LEVEL config file format
V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')
@@ -291,7 +291,7 @@ _OPTION(TempFileMode, `confTEMP_FILE_MODE', `0600')
_OPTION(MatchGECOS, `confMATCH_GECOS', `False')
# maximum hop count
-_OPTION(MaxHopCount, `confMAX_HOP', `17')
+_OPTION(MaxHopCount, `confMAX_HOP', `25')
# location of help file
O HelpFile=ifdef(`HELP_FILE', HELP_FILE, `MAIL_SETTINGS_DIR`'helpfile')
@@ -2184,7 +2184,9 @@ R<$*> $+ $@ NOSPAMHATER everyone else: stop
dnl',`dnl')
dnl run further checks: check_mail
dnl should we "clean up" $&f?
-R$* $: $1 $| $>checkmail <$&f>
+ifdef(`_FFR_MAIL_MACRO',
+`R$* $: $1 $| $>checkmail $&{mail_from}',
+`R$* $: $1 $| $>checkmail <$&f>')
R$* $| $#$* $#$2
dnl run further checks: check_relay
R$* $: $1 $| $>checkrelay $&{client_name} $| $&{client_addr}
@@ -2416,7 +2418,7 @@ R$* $| $#$* $#$2
R$* $| $* $: $1', `dnl')
R$* $: $>D <$&{client_name}> <?> <! SRV_FEAT_TAG> <>
R<?>$* $: $>A <$&{client_addr}> <?> <! SRV_FEAT_TAG> <>
-R<?>$* $: <$(access SRV_FEAT_TAG: $: ? $)>
+R<?>$* $: <$(access SRV_FEAT_TAG`'_TAG_DELIM_ $: ? $)>
R<?>$* $@ OK
ifdef(`_ATMPF_', `dnl tempfail?
R<$* _ATMPF_>$* $#temp', `dnl')
@@ -2433,7 +2435,7 @@ R$* $| $#$* $#$2
R$* $| $* $: $1', `dnl')
R$* $: $>D <$&{server_name}> <?> <! TLS_TRY_TAG> <>
R<?>$* $: $>A <$&{server_addr}> <?> <! TLS_TRY_TAG> <>
-R<?>$* $: <$(access TLS_TRY_TAG: $: ? $)>
+R<?>$* $: <$(access TLS_TRY_TAG`'_TAG_DELIM_ $: ? $)>
R<?>$* $@ OK
ifdef(`_ATMPF_', `dnl tempfail?
R<$* _ATMPF_>$* $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."', `dnl')
@@ -2697,13 +2699,13 @@ R<?> $* $@ NO not authenticated
ifdef(`_CERT_REGEX_ISSUER_', `dnl
R$* $: $(CERTIssuer $&{cert_issuer} $)',
`R$* $: $&{cert_issuer}')
-R$+ $: $(access CERTISSUER:$1 $)
+R$+ $: $(access CERTISSUER`'_TAG_DELIM_`'$1 $)
dnl use $# to stop further checks (delay_check)
RRELAY $# RELAY
ifdef(`_CERT_REGEX_SUBJECT_', `dnl
RSUBJECT $: <@> $(CERTSubject $&{cert_subject} $)',
`RSUBJECT $: <@> $&{cert_subject}')
-R<@> $+ $: <@> $(access CERTSUBJECT:$1 $)
+R<@> $+ $: <@> $(access CERTSUBJECT`'_TAG_DELIM_`'$1 $)
R<@> RELAY $# RELAY
R$* $: NO', `dnl')
@@ -2732,7 +2734,7 @@ dnl', `dnl
ifdef(`_ACCESS_TABLE_', `dnl
R$* $: $1 $| $>D <$&{server_name}> <?> <! AuthInfo> <>
R$* $| <?>$* $: $1 $| $>A <$&{server_addr}> <?> <! AuthInfo> <>
-R$* $| <?>$* $: $1 $| <$(access AuthInfo: $: ? $)> <>
+R$* $| <?>$* $: $1 $| <$(access AuthInfo`'_TAG_DELIM_ $: ? $)> <>
R$* $| <?>$* $@ no no authinfo available
R$* $| <$*> <> $# $2
dnl', `dnl')')
diff --git a/gnu/usr.sbin/sendmail/cf/m4/version.m4 b/gnu/usr.sbin/sendmail/cf/m4/version.m4
index d4b63a5fc5f..e6b37762813 100644
--- a/gnu/usr.sbin/sendmail/cf/m4/version.m4
+++ b/gnu/usr.sbin/sendmail/cf/m4/version.m4
@@ -11,8 +11,8 @@ divert(-1)
# the sendmail distribution.
#
#
-VERSIONID(`$Sendmail: version.m4,v 8.71 2001/09/07 20:59:45 ca Exp $')
+VERSIONID(`$Sendmail: version.m4,v 8.73 2001/09/29 01:51:40 ca Exp $')
#
divert(0)
# Configuration version number
-DZ8.12.0`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.12.1`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/gnu/usr.sbin/sendmail/doc/op/op.me b/gnu/usr.sbin/sendmail/doc/op/op.me
index 96bd17402ec..e3f9c6df89f 100644
--- a/gnu/usr.sbin/sendmail/doc/op/op.me
+++ b/gnu/usr.sbin/sendmail/doc/op/op.me
@@ -9,7 +9,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Sendmail: op.me,v 8.569 2001/09/08 01:20:50 gshapiro Exp $
+.\" $Sendmail: op.me,v 8.575 2001/09/28 22:03:15 ca Exp $
.\"
.\" eqn op.me | pic | troff -me
.\"
@@ -88,7 +88,7 @@ Sendmail, Inc.
.de Ve
Version \\$2
..
-.Ve $Revision: 1.9 $
+.Ve $Revision: 1.10 $
.rm Ve
.sp
For Sendmail Version 8.12
@@ -128,10 +128,9 @@ RFC821 (Simple Mail Transport Protocol),
RFC822 (Internet Mail Headers Format),
RFC974 (MX routing),
RFC1123 (Internet Host Requirements),
-RFC2045 (MIME),
-RFC1869 (SMTP Service Extensions),
+RFC1413 (Identification server),
RFC1652 (SMTP 8BITMIME Extension),
-RFC1854 (SMTP Service Extension for Command Pipelining),
+RFC1869 (SMTP Service Extensions),
RFC1870 (SMTP SIZE Extension),
RFC1891 (SMTP Delivery Status Notifications),
RFC1892 (Multipart/Report),
@@ -140,6 +139,7 @@ RFC1894 (Delivery Status Notifications),
RFC1985 (SMTP Service Extension for Remote Message Queue Starting),
RFC2033 (Local Message Transmission Protocol),
RFC2034 (SMTP Service Extension for Returning Enhanced Error Codes),
+RFC2045 (MIME),
RFC2476 (Message Submission),
RFC2487 (SMTP Service Extension for Secure SMTP over TLS),
RFC2554 (SMTP Service Extension for Authentication),
@@ -147,7 +147,7 @@ RFC2821 (Simple Mail Transfer Protocol),
RFC2822 (Internet Message Format),
RFC2852 (Deliver By SMTP Service Extension),
and
-RFC2920 (SMTP Service Extension for Command Pipelining),
+RFC2920 (SMTP Service Extension for Command Pipelining).
However, since
.i sendmail
is designed to work in a wider world,
@@ -748,9 +748,9 @@ This directory should be mode 700
and owned by root.
.pp
The actual path of this directory
-is defined in the
-.b Q
-keyword of the
+is defined by the
+.b QueueDirectory
+option of the
.i sendmail.cf
file.
To use multiple queues,
@@ -790,6 +790,20 @@ Notice: do not use the same key for
.i sendmail
invocations with different queue directories
or different queue group declarations.
+.sh 3 "/var/spool/clientmqueue"
+.pp
+The directory
+.i /var/spool/clientmqueue
+should be created to hold the mail queue.
+This directory should be mode 770
+and owned by user smmsp, group smmsp.
+.pp
+The actual path of this directory
+is defined by the
+.b QueueDirectory
+option of the
+.i submit.cf
+file.
.sh 3 "/var/spool/mqueue/.hoststat"
.pp
This is a typical value for the
@@ -4710,8 +4724,9 @@ command.
Defined in the SMTP server only after a RCPT command.
.ip ${server_addr}
The address of the server of the current outgoing SMTP connection.
+For LMTP delivery the macro is set to the name of the mailer.
.ip ${server_name}
-The name of the server of the current outgoing SMTP connection.
+The name of the server of the current outgoing SMTP or LMTP connection.
.ip ${tls_version}
The TLS/SSL version used for the connection, e.g., TLSv1, SSLv3, SSLv2;
defined after STARTTLS has been used.
@@ -10529,7 +10544,7 @@ replace it with a blank sheet for double-sided output.
.\".sz 10
.\"Eric Allman
.\".sp
-.\"Version $Revision: 1.9 $
+.\"Version $Revision: 1.10 $
.\".ce 0
.bp 3
.ce
diff --git a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
index 97a07b41974..9258da0a32e 100644
--- a/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
+++ b/gnu/usr.sbin/sendmail/include/libmilter/mfapi.h
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: mfapi.h,v 8.28 2001/07/19 21:20:29 gshapiro Exp $
+ * $Sendmail: mfapi.h,v 8.32 2001/09/13 20:38:40 ca Exp $
*/
/*
@@ -50,16 +50,25 @@ typedef struct smfiDesc *smfiDesc_ptr;
typedef int sfsistat;
-/*
-** structure describing one milter
-*/
-
#if defined(__linux__) && defined(__GNUC__) && defined(__cplusplus) && __GNUC_MINOR__ >= 8
# define SM__P(X) __PMT(X)
#else /* __linux__ && __GNUC__ && __cplusplus && _GNUC_MINOR__ >= 8 */
# define SM__P(X) __P(X)
#endif /* __linux__ && __GNUC__ && __cplusplus && _GNUC_MINOR__ >= 8 */
+/* Some platforms don't define __P -- do it for them here: */
+#ifndef __P
+# ifdef __STDC__
+# define __P(X) X
+# else /* __STDC__ */
+# define __P(X) ()
+# endif /* __STDC__ */
+#endif /* __P */
+
+/*
+** structure describing one milter
+*/
+
struct smfiDesc
{
char *xxfi_name; /* filter name */
@@ -118,6 +127,9 @@ LIBMILTER_API int smfi_stop __P((void));
#define SMFIF_ADDRCPT 0x00000004L /* filter may add recipients */
#define SMFIF_DELRCPT 0x00000008L /* filter may delete recipients */
#define SMFIF_CHGHDRS 0x00000010L /* filter may change/delete headers */
+#if _FFR_QUARANTINE
+# define SMFIF_QUARANTINE 0x00000020L /* filter may quarantine envelope */
+#endif /* _FFR_QUARANTINE */
/*
** Continue processing message/connection.
@@ -376,6 +388,16 @@ LIBMILTER_API int smfi_replacebody __P((SMFICTX *, unsigned char *, int));
** xxfi_abort is called. This can be used to reset state.
*/
+#if _FFR_QUARANTINE
+/*
+** Quarantine an envelope
+**
+** SMFICTX *ctx; Opaque context structure
+** char *reason: explanation
+*/
+
+LIBMILTER_API int smfi_quarantine __P((SMFICTX *ctx, char *reason));
+#endif /* _FFR_QUARANTINE */
/*
** Connection-private data (specific to an SMTP connection) can be
diff --git a/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h b/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h
index 53cf13d6b9d..4da2e6c1b02 100644
--- a/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h
+++ b/gnu/usr.sbin/sendmail/include/libmilter/mfdef.h
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: mfdef.h,v 8.7 2001/07/19 21:20:29 gshapiro Exp $
+ * $Sendmail: mfdef.h,v 8.11 2001/09/12 18:02:19 gshapiro Exp $
*/
/*
@@ -22,8 +22,13 @@
# define MILTER_OPTLEN (MILTER_LEN_BYTES * 3) /* length of options */
# define MILTER_CHUNK_SIZE 65535 /* body chunk size */
+/* These apply to SMFIF_* flags */
#define SMFI_V1_ACTS 0x0000000FL /* The actions of V1 filter */
-#define SMFI_V2_ACTS 0x0000001FL /* The actions of V2 filter */
+#if _FFR_QUARANTINE
+# define SMFI_V2_ACTS 0x0000003FL /* The actions of V2 filter */
+#else /* _FFR_QUARANTINE */
+# define SMFI_V2_ACTS 0x0000001FL /* The actions of V2 filter */
+#endif /* _FFR_QUARANTINE */
#define SMFI_CURR_ACTS SMFI_V2_ACTS /* The current version */
/* address families */
@@ -59,6 +64,9 @@
# define SMFIR_TEMPFAIL 't' /* tempfail */
# define SMFIR_ADDHEADER 'h' /* add header */
# define SMFIR_REPLYCODE 'y' /* reply code etc */
+# if _FFR_QUARANTINE
+# define SMFIR_QUARANTINE 'q' /* quarantine */
+# endif /* _FFR_QUARANTINE */
/* What the MTA can send/filter wants in protocol */
# define SMFIP_NOCONNECT 0x00000001L /* MTA should not send connect info */
diff --git a/gnu/usr.sbin/sendmail/include/libsmdb/smdb.h b/gnu/usr.sbin/sendmail/include/libsmdb/smdb.h
index 5606381b223..4628666b075 100644
--- a/gnu/usr.sbin/sendmail/include/libsmdb/smdb.h
+++ b/gnu/usr.sbin/sendmail/include/libsmdb/smdb.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: smdb.h,v 8.36 2001/05/18 14:55:56 ca Exp $
+ * $Sendmail: smdb.h,v 8.37 2001/09/11 03:08:28 gshapiro Exp $
*
*/
@@ -56,7 +56,7 @@ typedef struct database_struct SMDB_DATABASE;
typedef struct cursor_struct SMDB_CURSOR;
typedef struct entry_struct SMDB_DBENT;
- /*
+/*
** DB_CLOSE_FUNC -- close the database
**
** Parameters:
@@ -69,7 +69,7 @@ typedef struct entry_struct SMDB_DBENT;
typedef int (*db_close_func) __P((SMDB_DATABASE *db));
- /*
+/*
** DB_DEL_FUNC -- removes a key and data pair from the database
**
** Parameters:
@@ -86,7 +86,7 @@ typedef int (*db_close_func) __P((SMDB_DATABASE *db));
typedef int (*db_del_func) __P((SMDB_DATABASE *db,
SMDB_DBENT *key, unsigned int flags));
- /*
+/*
** DB_FD_FUNC -- Returns a pointer to a file used for the database.
**
** Parameters:
@@ -100,7 +100,7 @@ typedef int (*db_del_func) __P((SMDB_DATABASE *db,
typedef int (*db_fd_func) __P((SMDB_DATABASE *db, int* fd));
- /*
+/*
** DB_GET_FUNC -- Gets the data associated with a key.
**
** Parameters:
@@ -119,7 +119,7 @@ typedef int (*db_get_func) __P((SMDB_DATABASE *db,
SMDB_DBENT *key,
SMDB_DBENT *data, unsigned int flags));
- /*
+/*
** DB_PUT_FUNC -- Sets some data according to the key.
**
** Parameters:
@@ -140,7 +140,7 @@ typedef int (*db_put_func) __P((SMDB_DATABASE *db,
SMDB_DBENT *key,
SMDB_DBENT *data, unsigned int flags));
- /*
+/*
** DB_SYNC_FUNC -- Flush any cached information to disk.
**
** Parameters:
@@ -154,7 +154,7 @@ typedef int (*db_put_func) __P((SMDB_DATABASE *db,
typedef int (*db_sync_func) __P((SMDB_DATABASE *db, unsigned int flags));
- /*
+/*
** DB_SET_OWNER_FUNC -- Set the owner and group of the database files.
**
** Parameters:
@@ -169,7 +169,7 @@ typedef int (*db_sync_func) __P((SMDB_DATABASE *db, unsigned int flags));
typedef int (*db_set_owner_func) __P((SMDB_DATABASE *db, uid_t uid, gid_t gid));
- /*
+/*
** DB_CURSOR -- Obtain a cursor for sequential access
**
** Parameters:
@@ -200,7 +200,7 @@ struct database_struct
db_lockfd_func smdb_lockfd;
void *smdb_impl;
};
- /*
+/*
** DB_CURSOR_CLOSE -- Close a cursor
**
** Parameters:
@@ -213,7 +213,7 @@ struct database_struct
typedef int (*db_cursor_close_func) __P((SMDB_CURSOR *cursor));
- /*
+/*
** DB_CURSOR_DEL -- Delete the key/value pair of this cursor
**
** Parameters:
@@ -228,7 +228,7 @@ typedef int (*db_cursor_close_func) __P((SMDB_CURSOR *cursor));
typedef int (*db_cursor_del_func) __P((SMDB_CURSOR *cursor,
unsigned int flags));
- /*
+/*
** DB_CURSOR_GET -- Get the key/value of this cursor.
**
** Parameters:
@@ -259,7 +259,7 @@ typedef int (*db_cursor_get_func) __P((SMDB_CURSOR *cursor,
#define SMDB_CURSOR_GET_NEXT 2
#define SMDB_CURSOR_GET_RANGE 3
- /*
+/*
** DB_CURSOR_PUT -- Put the key/value at this cursor.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/include/sm/bitops.h b/gnu/usr.sbin/sendmail/include/sm/bitops.h
index 20cf5d0337c..a72f5bf5ec7 100644
--- a/gnu/usr.sbin/sendmail/include/sm/bitops.h
+++ b/gnu/usr.sbin/sendmail/include/sm/bitops.h
@@ -10,7 +10,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: bitops.h,v 1.1 2001/01/29 07:38:16 gshapiro Exp $
+ * $Sendmail: bitops.h,v 1.2 2001/09/22 22:05:42 ca Exp $
*/
#ifndef SM_BITOPS_H
@@ -26,10 +26,13 @@
# define BITMAPBITS 256 /* number of bits in a bit map */
# define BYTEBITS 8 /* number of bits in a byte */
# define BITMAPBYTES (BITMAPBITS / BYTEBITS) /* number of bytes in bit map */
+# define BITMAPMAX ((BITMAPBYTES / sizeof (int)) - 1)
/* internal macros */
-# define _BITWORD(bit) ((bit) / (BYTEBITS * sizeof (int)))
-# define _BITBIT(bit) ((unsigned int)1 << ((bit) % (BYTEBITS * sizeof (int))))
+
+/* make sure this index never leaves the allowed range: 0 to BITMAPMAX */
+# define _BITWORD(bit) (((unsigned char)(bit) / (BYTEBITS * sizeof (int))) & BITMAPMAX)
+# define _BITBIT(bit) ((unsigned int)1 << ((unsigned char)(bit) % (BYTEBITS * sizeof (int))))
typedef unsigned int BITMAP256[BITMAPBYTES / sizeof (int)];
diff --git a/gnu/usr.sbin/sendmail/include/sm/conf.h b/gnu/usr.sbin/sendmail/include/sm/conf.h
index 582a383decd..600dabeef49 100644
--- a/gnu/usr.sbin/sendmail/include/sm/conf.h
+++ b/gnu/usr.sbin/sendmail/include/sm/conf.h
@@ -10,7 +10,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: conf.h,v 1.76 2001/08/31 23:03:11 gshapiro Exp $
+ * $Sendmail: conf.h,v 1.78 2001/09/23 03:13:09 ca Exp $
*/
/*
@@ -27,7 +27,7 @@
# include <sm/config.h>
# include <sm/varargs.h>
- /*
+/*
** General "standard C" defines.
**
** These may be undone later, to cope with systems that claim to
@@ -59,7 +59,7 @@
#define LOG 1 /* enable logging -- don't turn off */
- /**********************************************************************
+/**********************************************************************
** Operating system configuration.
**
** Unless you are porting to a new OS, you shouldn't have to
@@ -80,6 +80,7 @@
# define HASINITGROUPS 1 /* has initgroups(3) call */
# define HASFCHMOD 1 /* has fchmod(2) syscall */
# define USESETEUID 1 /* has usable seteuid(2) call */
+# define HASSETRESGID 1 /* use setresgid(2) to set saved gid */
# define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */
# define seteuid(e) setresuid(-1, e, -1)
# define IP_SRCROUTE 1 /* can check IP source routing */
@@ -373,6 +374,7 @@ typedef int pid_t;
# endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */
# if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
# define HASSETREUID 1 /* setreuid works as of 2.5 */
+# define HASSETREGID 1 /* use setregid(2) to set saved gid */
# if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
# ifndef LA_TYPE
# define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */
@@ -882,6 +884,7 @@ typedef int pid_t;
# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
# define HASSETLOGIN 1 /* has setlogin(2) */
# define HASSETREUID 0 /* OpenBSD has broken setreuid(2) emulation */
+# define HASSETEGID 1 /* use setegid(2) to set saved gid */
# define HASURANDOMDEV 1 /* has /dev/urandom(4) */
# if OpenBSD >= 200006
# define HASSRANDOMDEV 1 /* has srandomdev(3) */
@@ -1281,6 +1284,7 @@ extern void *malloc();
# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
# endif /* !defined(KERNEL_VERSION) */
# define BSD 1 /* include BSD defines */
+# define HASSETREGID 1 /* use setregid(2) to set saved gid */
# ifndef REQUIRES_DIR_FSYNC
# define REQUIRES_DIR_FSYNC 1 /* requires fsync() on directory */
# endif /* REQUIRES_DIR_FSYNC */
@@ -2114,7 +2118,7 @@ typedef struct msgb mblk_t;
/**********************************************************************
** End of Per-Operating System defines
**********************************************************************/
- /**********************************************************************
+/**********************************************************************
** More general defines
**********************************************************************/
@@ -2214,7 +2218,7 @@ typedef struct msgb mblk_t;
# define USESETEUID 1 /* has usable seteuid(2) call */
# endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */
# endif /* _POSIX_VERSION */
- /*
+/*
** Tweaking for systems that (for example) claim to be BSD or POSIX
** but don't have all the standard BSD or POSIX routines (boo hiss).
*/
@@ -2353,7 +2357,7 @@ typedef struct msgb mblk_t;
# ifndef QUAD_T
# define QUAD_T unsigned long
# endif /* ! QUAD_T */
- /**********************************************************************
+/**********************************************************************
** Remaining definitions should never have to be changed. They are
** primarily to provide back compatibility for older systems -- for
** example, it includes some POSIX compatibility definitions
diff --git a/gnu/usr.sbin/sendmail/include/sm/gen.h b/gnu/usr.sbin/sendmail/include/sm/gen.h
index 55bacb593a7..8fdc0aac7d7 100644
--- a/gnu/usr.sbin/sendmail/include/sm/gen.h
+++ b/gnu/usr.sbin/sendmail/include/sm/gen.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: gen.h,v 1.17 2001/07/19 21:13:19 gshapiro Exp $
+ * $Sendmail: gen.h,v 1.19 2001/09/11 04:04:43 gshapiro Exp $
*/
/*
diff --git a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_aix.h b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_aix.h
index f4472cccbda..faf10acc81a 100644
--- a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_aix.h
+++ b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_aix.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: sm_os_aix.h,v 1.7 2001/04/20 17:04:23 ca Exp $
+ * $Sendmail: sm_os_aix.h,v 1.8 2001/10/01 15:04:26 ca Exp $
*/
/*
@@ -33,3 +33,8 @@
# endif /* SM_CONF_SYSLOG */
# endif /* ! _AIX4 */
#endif /* _AIX3 */
+
+/* can't set real gid */
+#ifndef SM_CONF_CANT_SETRGID
+# define SM_CONF_CANT_SETRGID 1
+#endif /* SM_CONF_CANT_SETRGID */
diff --git a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_irix.h b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_irix.h
index 7151c477fc4..0b2a9b4704d 100644
--- a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_irix.h
+++ b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_irix.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: sm_os_irix.h,v 1.5 2001/03/18 18:07:25 ca Exp $
+ * $Sendmail: sm_os_irix.h,v 1.6 2001/09/30 16:35:29 ca Exp $
*/
/*
@@ -53,3 +53,8 @@
#ifndef SM_CONF_TEST_LLONG
# define SM_CONF_TEST_LLONG 0
#endif /* !SM_CONF_TEST_LLONG */
+
+/* can't set real gid */
+#ifndef SM_CONF_CANT_SETRGID
+# define SM_CONF_CANT_SETRGID 1
+#endif /* SM_CONF_CANT_SETRGID */
diff --git a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_openunix.h b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_openunix.h
index 3fa3721bea5..524d8aaec00 100644
--- a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_openunix.h
+++ b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_openunix.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: sm_os_openunix.h,v 1.1 2001/08/22 17:22:34 ca Exp $
+ * $Sendmail: sm_os_openunix.h,v 1.2 2001/09/11 23:04:15 ca Exp $
*/
#define SM_OS_NAME "openunix"
@@ -17,6 +17,9 @@
/* long long seems to work */
#define SM_CONF_LONGLONG 1
+/* don't use flock() in mail.local.c */
+#define LDA_USE_LOCKF 1
+
#ifndef SM_CONF_SHM
# define SM_CONF_SHM 1
#endif /* SM_CONF_SHM */
diff --git a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_osf1.h b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_osf1.h
index 9d6f76af904..195ec7895cd 100644
--- a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_osf1.h
+++ b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_osf1.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: sm_os_osf1.h,v 1.1 2001/02/22 22:07:14 gshapiro Exp $
+ * $Sendmail: sm_os_osf1.h,v 1.2 2001/10/01 14:10:45 ca Exp $
*/
/*
@@ -16,3 +16,8 @@
#define SM_OS_NAME "osf1"
#define SM_CONF_SETITIMER 0
+
+/* can't set real gid */
+#ifndef SM_CONF_CANT_SETRGID
+# define SM_CONF_CANT_SETRGID 1
+#endif /* SM_CONF_CANT_SETRGID */
diff --git a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_ultrix.h b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_ultrix.h
index 17cab48ce9f..19bce8082f3 100644
--- a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_ultrix.h
+++ b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_ultrix.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: sm_os_ultrix.h,v 1.1 2001/01/29 21:07:31 gshapiro Exp $
+ * $Sendmail: sm_os_ultrix.h,v 1.2 2001/10/01 14:10:45 ca Exp $
*/
/*
@@ -16,3 +16,8 @@
#define SM_OS_NAME "ultrix"
#define SM_CONF_SSIZE_T 0
+
+/* can't set real gid */
+#ifndef SM_CONF_CANT_SETRGID
+# define SM_CONF_CANT_SETRGID 1
+#endif /* SM_CONF_CANT_SETRGID */
diff --git a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_unixware.h b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_unixware.h
index eb88d532ea3..2fc571fd4f4 100644
--- a/gnu/usr.sbin/sendmail/include/sm/os/sm_os_unixware.h
+++ b/gnu/usr.sbin/sendmail/include/sm/os/sm_os_unixware.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: sm_os_unixware.h,v 1.4 2001/08/22 02:58:20 ca Exp $
+ * $Sendmail: sm_os_unixware.h,v 1.5 2001/09/24 20:34:36 ca Exp $
*/
#define SM_OS_NAME "unixware"
@@ -25,3 +25,9 @@
/* size_t seems to be signed */
#define SM_CONF_BROKEN_SIZE_T 1
+
+/* can't set real gid */
+#ifndef SM_CONF_CANT_SETRGID
+# define SM_CONF_CANT_SETRGID 1
+#endif /* SM_CONF_CANT_SETRGID */
+
diff --git a/gnu/usr.sbin/sendmail/include/sm/stdio.h b/gnu/usr.sbin/sendmail/include/sm/stdio.h
deleted file mode 100644
index d4f5189b724..00000000000
--- a/gnu/usr.sbin/sendmail/include/sm/stdio.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
- * 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.
- *
- * $Sendmail: stdio.h,v 1.16 2001/03/08 03:23:08 ca Exp $
- */
-
-#ifndef SM_STDIO_H
-#define SM_STDIO_H
-
-#include <sm/gen.h>
-#include <sm/io.h>
-
-/*
-** We include <stdio.h> here for several reasons:
-** - To force the <stdio.h> idempotency macro to be defined so that
-** any future includes of <stdio.h> will have no effect;
-** - To declare functions like rename() which we do not and can not override.
-** Note that all of the following redefinitions of standard stdio
-** apis are macros.
-*/
-
-#include <stdio.h>
-#undef FILE
-#undef _IOFBF
-#undef _IOLBF
-#undef EOF
-#undef BUFSIZ
-#undef getc
-#undef putc
-
-/*
-** Temporary for transition from stdio to sm_io.
-*/
-
-#define FILE SM_FILE_T
-#define _IOFBF SM_IO_FBF
-#define _IOLBF SM_IO_LBF
-#define _SMIONBF SM_IO_NBF
-#define EOF SM_IO_EOF
-#define BUFSIZ SM_IO_BUFSIZ
-#define fpos_t off_t
-
-#undef stdin
-#undef stdout
-#undef stderr
-#undef clearerr
-#undef feof
-#undef ferror
-#undef getc_unlocked
-#undef getchar
-#undef putc_unlocked
-#undef putchar
-#undef fileno
-
-#define stdin smioin
-#define stdout smioout
-#define stderr smioerr
-
-#define clearerr(f) sm_io_clearerr(f)
-#define fclose(f) sm_io_close(f)
-#define feof(f) sm_io_eof(f)
-#define ferror(f) sm_io_error(f)
-#define fflush(f) sm_io_flush(f)
-#define fgetc(f) sm_io_fgetc(f)
-#define fgetln(f, x) sm_io_getln(f, x)
-#define fgetpos(f, p) sm_io_getpos(f, p)
-#define fgets(b, n, f) sm_io_fgets(f, b, n)
-#define fpurge(f) sm_io_purge(f)
-#define fputc(c, f) sm_io_fputc(f, c)
-#define fread(b, s, c, f) sm_io_read(f, b, s, c)
-#define fseek(f, o, w) sm_io_seek(f, o, w)
-#define fsetpos(f, p) sm_io_setpos(f, p)
-#define ftell(f) sm_io_tell(f)
-#define fwrite(b, s, c, f) sm_io_write(f, b, s, c)
-#define getc(f) sm_io_getc(f)
-#define getc_unlocked(f) sm_io_getc_unlocked(f)
-#define getchar() sm_io_getc(smioout)
-#define putc(c, f) sm_io_putc(f, c)
-#define putc_unlocked(c, f) sm_io_putc_unlocked(f, c)
-#define putchar(c) sm_io_putc(smioout, c)
-#define rewind(f) sm_io_rewind(f)
-#define setbuf(f, b) (void)sm_io_setvbuf(f, b, b ? SM_IO_FBF : \
- SM_IO_NBF, SM_IO_BUFSIZ);
-#define setbuffer(f, b, size) (void)sm_io_setvbuf(f, b, b ? SM_IO_FBF : \
- SM_IO_NBF, size);
-#define setlinebuf(f) sm_io_setvbuf(f, (char *)NULL, SM_IO_LBF, (size_t)0);
-#define setvbuf(f, b, m, size) sm_io_setvbuf(f, b, m, size)
-#define ungetc(c, f) sm_io_ungetc(f, c)
-
-#define fileno(fp) sm_io_getinfo(fp, SM_IO_WHAT_FD, NULL)
-#define fopen(path, mode) ((FILE *)sm_io_open(SmFtStdio, (void *)(fd), (strcmp((mode), "r")==0?SM_IO_RDONLY:strcmp((mode), "w")==0?SM_IO_WRONLY:SM_IO_RDWR), NULL))
-#define freopen(path, mode, fp) ((FILE *)sm_io_reopen(SmFtStdio, (path), (strcmp((mode), "w")==0?SM_IO_WRONLY:SM_IO_RDONLY), NULL, (fp))
-#define fdopen(fd, mode) ((FILE *)sm_io_open(SmFtStdiofd, (void *)(fd), (strcmp((mode), "r")==0?SM_IO_RDONLY:strcmp((mode), "w")==0?SM_IO_WRONLY:SM_IO_RDWR), NULL))
-
-/* the following have variable arg counts */
-#define fscanf sm_io_fscanf
-#define fprintf sm_io_fprintf
-#define printf( sm_io_printf(smioout,
-#define snprintf sm_io_snprintf
-#define vsnprintf sm_io_vsnprintf
-#define vfprintf sm_io_vfprintf
-
-#endif /* SM_STDIO_H */
diff --git a/gnu/usr.sbin/sendmail/include/sm/sysstat.h b/gnu/usr.sbin/sendmail/include/sm/sysstat.h
deleted file mode 100644
index 28e1d388a03..00000000000
--- a/gnu/usr.sbin/sendmail/include/sm/sysstat.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
- * 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.
- *
- * $Sendmail: sysstat.h,v 1.5 2001/04/03 01:53:01 gshapiro Exp $
- */
-
-/*
-** This is a wrapper for <sys/stat.h> that fixes portability problems.
-*/
-
-#ifndef SM_SYSSTAT_H
-# define SM_SYSSTAT_H
-
-# include <sys/stat.h>
-
-/*
-** Some platforms lack lstat()
-*/
-
-# ifndef S_ISLNK
-# define lstat(fn, st) stat(fn, st)
-# endif /* ! S_ISLNK */
-
-#endif /* ! SM_SYSSTAT_H */
diff --git a/gnu/usr.sbin/sendmail/include/sm/varargs.h b/gnu/usr.sbin/sendmail/include/sm/varargs.h
index 6857b307a6d..4cdb7f32f01 100644
--- a/gnu/usr.sbin/sendmail/include/sm/varargs.h
+++ b/gnu/usr.sbin/sendmail/include/sm/varargs.h
@@ -6,12 +6,11 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Sendmail: varargs.h,v 1.6 2001/04/23 17:58:27 ca Exp $
+ * $Sendmail: varargs.h,v 1.7 2001/09/13 16:45:40 ca Exp $
*/
/*
** libsm variable argument lists
-** See libsm/varargs.html for documentation.
*/
#ifndef SM_VARARGS_H
diff --git a/gnu/usr.sbin/sendmail/libmilter/comm.c b/gnu/usr.sbin/sendmail/libmilter/comm.c
index 4d8baaa9dd3..7f7c3e91e97 100644
--- a/gnu/usr.sbin/sendmail/libmilter/comm.c
+++ b/gnu/usr.sbin/sendmail/libmilter/comm.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: comm.c,v 8.43 2001/07/20 20:33:07 ca Exp $")
+SM_RCSID("@(#)$Sendmail: comm.c,v 8.46 2001/09/11 04:04:44 gshapiro Exp $")
#include "libmilter.h"
#include <sm/errstring.h>
@@ -189,7 +189,7 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name)
*cmd = SMFIC_UNKNERR;
return NULL;
}
- /*
+/*
** MI_WR_CMD -- write a cmd to sd
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libmilter/engine.c b/gnu/usr.sbin/sendmail/libmilter/engine.c
index 4b8cb008644..7393b2a25d7 100644
--- a/gnu/usr.sbin/sendmail/libmilter/engine.c
+++ b/gnu/usr.sbin/sendmail/libmilter/engine.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: engine.c,v 8.94 2001/08/14 12:49:45 ca Exp $")
+SM_RCSID("@(#)$Sendmail: engine.c,v 8.97 2001/09/11 04:04:44 gshapiro Exp $")
#include "libmilter.h"
@@ -173,7 +173,7 @@ static cmdfct cmds[] =
#define _SMFIS_NOREPLY 23
#define _SMFIS_FAIL (-1)
- /*
+/*
** MI_ENGINE -- receive commands and process them
**
** Parameters:
@@ -359,7 +359,7 @@ mi_engine(ctx)
mi_clr_macros(ctx, 0);
return ret;
}
- /*
+/*
** SENDREPLY -- send a reply to the MTA
**
** Parameters:
@@ -462,7 +462,7 @@ mi_clr_macros(ctx, m)
}
}
}
- /*
+/*
** ST_OPTIONNEG -- negotiate options
**
** Parameters:
@@ -543,7 +543,7 @@ st_optionneg(g)
return _SMFIS_OPTIONS;
}
- /*
+/*
** ST_CONNECTINFO -- receive connection information
**
** Parameters:
@@ -660,7 +660,7 @@ st_connectinfo(g)
return (*fi_connect)(g->a_ctx, g->a_buf,
family != SMFIA_UNKNOWN ? &sockaddr : NULL);
}
- /*
+/*
** ST_EOH -- end of headers
**
** Parameters:
@@ -683,7 +683,7 @@ st_eoh(g)
return (*fi_eoh)(g->a_ctx);
return SMFIS_CONTINUE;
}
- /*
+/*
** ST_HELO -- helo/ehlo command
**
** Parameters:
@@ -706,7 +706,7 @@ st_helo(g)
return (*fi_helo)(g->a_ctx, g->a_buf);
return SMFIS_CONTINUE;
}
- /*
+/*
** ST_HEADER -- header line
**
** Parameters:
@@ -751,7 +751,7 @@ st_header(g)
free(argv); \
return r;
- /*
+/*
** ST_SENDER -- MAIL FROM command
**
** Parameters:
@@ -767,7 +767,7 @@ st_sender(g)
{
ARGV_FCT(fi_envfrom, xxfi_envfrom, CI_MAIL)
}
- /*
+/*
** ST_RCPT -- RCPT TO command
**
** Parameters:
@@ -783,7 +783,7 @@ st_rcpt(g)
{
ARGV_FCT(fi_envrcpt, xxfi_envrcpt, CI_RCPT)
}
- /*
+/*
** ST_MACROS -- deal with macros received from the MTA
**
** Parameters:
@@ -833,7 +833,7 @@ st_macros(g)
g->a_ctx->ctx_mac_buf[i] = g->a_buf;
return _SMFIS_KEEP;
}
- /*
+/*
** ST_QUIT -- quit command
**
** Parameters:
@@ -849,7 +849,7 @@ st_quit(g)
{
return _SMFIS_NOREPLY;
}
- /*
+/*
** ST_BODYCHUNK -- deal with a piece of the mail body
**
** Parameters:
@@ -873,7 +873,7 @@ st_bodychunk(g)
g->a_len);
return SMFIS_CONTINUE;
}
- /*
+/*
** ST_BODYEND -- deal with the last piece of the mail body
**
** Parameters:
@@ -920,7 +920,7 @@ st_bodyend(g)
return (*fi_eom)(g->a_ctx);
return r;
}
- /*
+/*
** ST_ABORTFCT -- deal with aborts
**
** Parameters:
@@ -943,7 +943,7 @@ st_abortfct(g)
(void) (*fi_abort)(g->a_ctx);
return _SMFIS_NOREPLY;
}
- /*
+/*
** TRANS_OK -- is the state transition ok?
**
** Parameters:
@@ -988,7 +988,7 @@ trans_ok(old, new)
} while (s <= ST_LAST);
return false;
}
- /*
+/*
** FIX_STM -- add "skip" bits to the state transition table
**
** Parameters:
@@ -1025,7 +1025,7 @@ fix_stm(ctx)
if (bitset(SMFIP_NOBODY, fl))
next_states[ST_BODY] |= NX_SKIP;
}
- /*
+/*
** DEC_ARGV -- split a buffer into a list of strings, NULL terminated
**
** Parameters:
@@ -1069,7 +1069,7 @@ dec_argv(buf, len)
s[elem] = NULL;
return s;
}
- /*
+/*
** DEC_ARG2 -- split a buffer into two strings
**
** Parameters:
@@ -1098,7 +1098,7 @@ dec_arg2(buf, len, s1, s2)
*s2 = buf + i + 1;
return MI_SUCCESS;
}
- /*
+/*
** SENDOK -- is it ok for the filter to send stuff to the MTA?
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libmilter/handler.c b/gnu/usr.sbin/sendmail/libmilter/handler.c
index f165befc2a2..9fcf3c587b1 100644
--- a/gnu/usr.sbin/sendmail/libmilter/handler.c
+++ b/gnu/usr.sbin/sendmail/libmilter/handler.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: handler.c,v 8.24 2000/12/29 19:45:55 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: handler.c,v 8.26 2001/09/11 04:04:45 gshapiro Exp $")
#include "libmilter.h"
diff --git a/gnu/usr.sbin/sendmail/libmilter/libmilter.h b/gnu/usr.sbin/sendmail/libmilter/libmilter.h
index fe90c563e06..f68d3d32021 100644
--- a/gnu/usr.sbin/sendmail/libmilter/libmilter.h
+++ b/gnu/usr.sbin/sendmail/libmilter/libmilter.h
@@ -19,7 +19,7 @@
#ifdef _DEFINE
# define EXTERN
# define INIT(x) = x
-SM_IDSTR(MilterlId, "@(#)$Sendmail: libmilter.h,v 8.26 2001/07/20 02:48:37 gshapiro Exp $")
+SM_IDSTR(MilterlId, "@(#)$Sendmail: libmilter.h,v 8.28 2001/09/11 04:04:45 gshapiro Exp $")
#else /* _DEFINE */
# define EXTERN extern
# define INIT(x)
diff --git a/gnu/usr.sbin/sendmail/libmilter/listener.c b/gnu/usr.sbin/sendmail/libmilter/listener.c
index 656c82ba6b6..f573c8e65d1 100644
--- a/gnu/usr.sbin/sendmail/libmilter/listener.c
+++ b/gnu/usr.sbin/sendmail/libmilter/listener.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: listener.c,v 8.72 2001/06/28 20:59:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: listener.c,v 8.75 2001/09/11 04:04:45 gshapiro Exp $")
/*
** listener.c -- threaded network listener
@@ -25,7 +25,7 @@ SM_RCSID("@(#)$Sendmail: listener.c,v 8.72 2001/06/28 20:59:06 ca Exp $")
static smutex_t L_Mutex;
- /*
+/*
** MI_MILTEROPEN -- setup socket to listen on
**
** Parameters:
@@ -431,7 +431,7 @@ mi_milteropen(conn, backlog, socksize, family, name)
*family = addr.sa.sa_family;
return sock;
}
- /*
+/*
** MI_THREAD_HANDLE_WRAPPER -- small wrapper to handle session
**
** Parameters:
@@ -450,7 +450,7 @@ mi_thread_handle_wrapper(arg)
static socket_t listenfd = INVALID_SOCKET;
- /*
+/*
** MI_CLOSENER -- close listen socket
**
** NOTE: It is assumed that this function is called from a
@@ -509,7 +509,7 @@ mi_closener()
(void) smutex_unlock(&L_Mutex);
}
- /*
+/*
** MI_LISTENER -- Generic listener harness
**
** Open up listen port
diff --git a/gnu/usr.sbin/sendmail/libmilter/main.c b/gnu/usr.sbin/sendmail/libmilter/main.c
index 2fbe35334e3..2a7f665cb81 100644
--- a/gnu/usr.sbin/sendmail/libmilter/main.c
+++ b/gnu/usr.sbin/sendmail/libmilter/main.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: main.c,v 8.49 2001/04/21 01:18:16 ca Exp $")
+SM_RCSID("@(#)$Sendmail: main.c,v 8.52 2001/09/11 04:04:45 gshapiro Exp $")
#define _DEFINE 1
#include "libmilter.h"
@@ -68,7 +68,7 @@ smfi_register(smfilter)
return MI_SUCCESS;
}
- /*
+/*
** SMFI_STOP -- stop milter
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libmilter/signal.c b/gnu/usr.sbin/sendmail/libmilter/signal.c
index b41f8f8fcb5..113f7c9a96a 100644
--- a/gnu/usr.sbin/sendmail/libmilter/signal.c
+++ b/gnu/usr.sbin/sendmail/libmilter/signal.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: signal.c,v 8.24 2001/01/24 00:27:35 ca Exp $")
+SM_RCSID("@(#)$Sendmail: signal.c,v 8.27 2001/09/11 04:04:45 gshapiro Exp $")
#include "libmilter.h"
@@ -21,7 +21,7 @@ static smutex_t M_Mutex;
static int MilterStop = MILTER_CONT;
- /*
+/*
** MI_STOP -- return value of MilterStop
**
** Parameters:
@@ -36,7 +36,7 @@ mi_stop()
{
return MilterStop;
}
- /*
+/*
** MI_STOP_MILTERS -- set value of MilterStop
**
** Parameters:
@@ -58,7 +58,7 @@ mi_stop_milters(v)
mi_closener();
(void) smutex_unlock(&M_Mutex);
}
- /*
+/*
** MI_CLEAN_SIGNALS -- clean up signal handler thread
**
** Parameters:
@@ -73,7 +73,7 @@ mi_clean_signals()
{
(void) smutex_destroy(&M_Mutex);
}
- /*
+/*
** MI_SIGNAL_THREAD -- thread to deal with signals
**
** Parameters:
@@ -136,7 +136,7 @@ mi_signal_thread(name)
}
}
}
- /*
+/*
** MI_SPAWN_SIGNAL_THREAD -- spawn thread to handle signals
**
** Parameters:
@@ -174,7 +174,7 @@ mi_spawn_signal_thread(name)
}
return MI_SUCCESS;
}
- /*
+/*
** MI_CONTROL_STARTUP -- startup for thread to handle signals
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libmilter/sm_gethost.c b/gnu/usr.sbin/sendmail/libmilter/sm_gethost.c
index a0337b1f73b..25e77a733a8 100644
--- a/gnu/usr.sbin/sendmail/libmilter/sm_gethost.c
+++ b/gnu/usr.sbin/sendmail/libmilter/sm_gethost.c
@@ -9,14 +9,14 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: sm_gethost.c,v 8.23 2001/07/21 00:05:06 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: sm_gethost.c,v 8.26 2001/09/11 04:04:45 gshapiro Exp $")
#include <sendmail.h>
#if NETINET || NETINET6
# include <arpa/inet.h>
#endif /* NETINET || NETINET6 */
- /*
+/*
** MI_GETHOSTBY{NAME,ADDR} -- compatibility routines for gethostbyXXX
**
** Some operating systems have wierd problems with the gethostbyXXX
diff --git a/gnu/usr.sbin/sendmail/libmilter/smfi.c b/gnu/usr.sbin/sendmail/libmilter/smfi.c
index 82b3d4cf638..3fd3d5ce321 100644
--- a/gnu/usr.sbin/sendmail/libmilter/smfi.c
+++ b/gnu/usr.sbin/sendmail/libmilter/smfi.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: smfi.c,v 8.42 2001/08/27 18:09:16 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: smfi.c,v 8.46 2001/09/11 04:04:45 gshapiro Exp $")
#include "libmilter.h"
@@ -107,7 +107,7 @@ smfi_chgheader(ctx, headerf, hdridx, headerv)
free(buf);
return r;
}
- /*
+/*
** SMFI_ADDRCPT -- send an additional recipient to the MTA
**
** Parameters:
@@ -135,7 +135,7 @@ smfi_addrcpt(ctx, rcpt)
len = strlen(rcpt) + 1;
return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_ADDRCPT, rcpt, len);
}
- /*
+/*
** SMFI_DELRCPT -- send a recipient to be removed to the MTA
**
** Parameters:
@@ -163,7 +163,7 @@ smfi_delrcpt(ctx, rcpt)
len = strlen(rcpt) + 1;
return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_DELRCPT, rcpt, len);
}
- /*
+/*
** SMFI_REPLACEBODY -- send a body chunk to the MTA
**
** Parameters:
@@ -206,7 +206,46 @@ smfi_replacebody(ctx, bodyp, bodylen)
}
return MI_SUCCESS;
}
- /*
+#if _FFR_QUARANTINE
+/*
+** SMFI_QUARANTINE -- quarantine an envelope
+**
+** Parameters:
+** ctx -- Opaque context structure
+** reason -- why?
+**
+** Returns:
+** MI_SUCCESS/MI_FAILURE
+*/
+
+int
+smfi_quarantine(ctx, reason)
+ SMFICTX *ctx;
+ char *reason;
+{
+ size_t len;
+ int r;
+ char *buf;
+ struct timeval timeout;
+
+ if (reason == NULL || *reason == '\0')
+ return MI_FAILURE;
+ if (!mi_sendok(ctx, SMFIF_QUARANTINE))
+ return MI_FAILURE;
+ timeout.tv_sec = ctx->ctx_timeout;
+ timeout.tv_usec = 0;
+ len = strlen(reason);
+ buf = malloc(len);
+ if (buf == NULL)
+ return MI_FAILURE;
+ (void) memcpy(buf, reason, len + 1);
+ r = mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_QUARANTINE, buf, len);
+ free(buf);
+ return r;
+}
+#endif /* _FFR_QUARANTINE */
+
+/*
** MYISENHSC -- check whether a string contains an enhanced status code
**
** Parameters:
@@ -245,7 +284,7 @@ myisenhsc(s, delim)
return 0;
return l + h;
}
- /*
+/*
** SMFI_SETREPLY -- set the reply code for the next reply to the MTA
**
** Parameters:
@@ -305,7 +344,7 @@ smfi_setreply(ctx, rcode, xcode, message)
ctx->ctx_reply = buf;
return MI_SUCCESS;
}
- /*
+/*
** SMFI_SETPRIV -- set private data
**
** Parameters:
@@ -326,7 +365,7 @@ smfi_setpriv(ctx, privatedata)
ctx->ctx_privdata = privatedata;
return MI_SUCCESS;
}
- /*
+/*
** SMFI_GETPRIV -- get private data
**
** Parameters:
@@ -344,7 +383,7 @@ smfi_getpriv(ctx)
return NULL;
return ctx->ctx_privdata;
}
- /*
+/*
** SMFI_GETSYMVAL -- get the value of a macro
**
** See explanation in mfapi.h about layout of the structures.
diff --git a/gnu/usr.sbin/sendmail/libsm/assert.c b/gnu/usr.sbin/sendmail/libsm/assert.c
index 8ffe85789ec..56438866e9f 100644
--- a/gnu/usr.sbin/sendmail/libsm/assert.c
+++ b/gnu/usr.sbin/sendmail/libsm/assert.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: assert.c,v 1.23 2001/09/04 22:41:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: assert.c,v 1.25 2001/09/11 04:04:47 gshapiro Exp $")
/*
** Abnormal program termination and assertion checking.
diff --git a/gnu/usr.sbin/sendmail/libsm/b-strcmp.c b/gnu/usr.sbin/sendmail/libsm/b-strcmp.c
index 192c884073c..f8da755e282 100644
--- a/gnu/usr.sbin/sendmail/libsm/b-strcmp.c
+++ b/gnu/usr.sbin/sendmail/libsm/b-strcmp.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: b-strcmp.c,v 1.10 2001/08/31 17:49:28 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: b-strcmp.c,v 1.12 2001/09/11 04:04:47 gshapiro Exp $")
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/b-strl.c b/gnu/usr.sbin/sendmail/libsm/b-strl.c
index 5179642f8d5..626964b8ab4 100644
--- a/gnu/usr.sbin/sendmail/libsm/b-strl.c
+++ b/gnu/usr.sbin/sendmail/libsm/b-strl.c
@@ -19,7 +19,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: b-strl.c,v 1.22 2001/04/03 01:53:10 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: b-strl.c,v 1.24 2001/09/11 04:04:47 gshapiro Exp $")
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/cf.c b/gnu/usr.sbin/sendmail/libsm/cf.c
index 9ee2bbfa218..65bb4f13471 100644
--- a/gnu/usr.sbin/sendmail/libsm/cf.c
+++ b/gnu/usr.sbin/sendmail/libsm/cf.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: cf.c,v 1.4 2001/02/01 02:40:21 dmoen Exp $")
+SM_RCSID("@(#)$Sendmail: cf.c,v 1.6 2001/09/11 04:04:47 gshapiro Exp $")
#include <ctype.h>
#include <errno.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/clock.c b/gnu/usr.sbin/sendmail/libsm/clock.c
index b3f2355eee7..540512789c4 100644
--- a/gnu/usr.sbin/sendmail/libsm/clock.c
+++ b/gnu/usr.sbin/sendmail/libsm/clock.c
@@ -12,7 +12,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: clock.c,v 1.30 2001/08/31 20:44:28 ca Exp $")
+SM_RCSID("@(#)$Sendmail: clock.c,v 1.33 2001/09/11 04:04:47 gshapiro Exp $")
#include <unistd.h>
#include <time.h>
#include <errno.h>
@@ -169,7 +169,7 @@ sm_sigsafe_seteventm(intvl, func, arg)
(void) sm_releasesignal(SIGALRM);
return ev;
}
- /*
+/*
** SM_CLREVENT -- remove an event from the event queue.
**
** Parameters:
@@ -234,7 +234,7 @@ sm_clrevent(ev)
# endif /* SM_CONF_SETITIMER */
}
}
- /*
+/*
** SM_CLEAR_EVENTS -- remove all events from the event queue.
**
** Parameters:
@@ -282,7 +282,7 @@ sm_clear_events()
if (wasblocked == 0)
(void) sm_releasesignal(SIGALRM);
}
- /*
+/*
** SM_TICK -- take a clock tick
**
** Called by the alarm clock. This routine runs events as needed.
@@ -458,7 +458,7 @@ sm_tick(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** SLEEP -- a version of sleep that works with this stuff
**
** Because Unix sleep uses the alarm facility, I must reimplement
diff --git a/gnu/usr.sbin/sendmail/libsm/clrerr.c b/gnu/usr.sbin/sendmail/libsm/clrerr.c
index 0fb699f9a07..13820cd6782 100644
--- a/gnu/usr.sbin/sendmail/libsm/clrerr.c
+++ b/gnu/usr.sbin/sendmail/libsm/clrerr.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: clrerr.c,v 1.11 2001/01/28 00:29:34 ca Exp $")
+SM_RCSID("@(#)$Sendmail: clrerr.c,v 1.13 2001/09/11 04:04:48 gshapiro Exp $")
#include <sm/io.h>
#include <sm/assert.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/config.c b/gnu/usr.sbin/sendmail/libsm/config.c
index c6c321d97ba..336d1a3b9d7 100644
--- a/gnu/usr.sbin/sendmail/libsm/config.c
+++ b/gnu/usr.sbin/sendmail/libsm/config.c
@@ -9,14 +9,14 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: config.c,v 1.19 2001/09/04 22:41:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: config.c,v 1.23 2001/09/24 20:44:07 ca Exp $")
#include <stdlib.h>
#include <sm/heap.h>
#include <sm/string.h>
#include <sm/conf.h>
- /*
+/*
** PUTENV -- emulation of putenv() in terms of setenv()
**
** Not needed on Posix-compliant systems.
@@ -126,7 +126,7 @@ putenv(env)
# endif /* NEEDPUTENV == 2 */
#endif /* NEEDPUTENV */
- /*
+/*
** UNSETENV -- remove a variable from the environment
**
** Not needed on newer systems.
@@ -173,6 +173,9 @@ char *SmCompileOptions[] =
#if SM_CONF_BROKEN_STRTOD
"SM_CONF_BROKEN_STRTOD",
#endif /* SM_CONF_BROKEN_STRTOD */
+#if SM_CONF_CANT_SETRGID
+ "SM_CONF_CANT_SETRGID",
+#endif /* SM_CONF_CANT_SETRGID */
#if SM_CONF_GETOPT
"SM_CONF_GETOPT",
#endif /* SM_CONF_GETOPT */
diff --git a/gnu/usr.sbin/sendmail/libsm/debug.c b/gnu/usr.sbin/sendmail/libsm/debug.c
index 5a201967563..787630eec95 100644
--- a/gnu/usr.sbin/sendmail/libsm/debug.c
+++ b/gnu/usr.sbin/sendmail/libsm/debug.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: debug.c,v 1.25 2001/09/04 22:41:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: debug.c,v 1.28 2001/09/25 19:57:05 gshapiro Exp $")
/*
** libsm debugging and tracing
@@ -97,6 +97,8 @@ sm_dprintf(fmt, va_alist)
{
SM_VA_LOCAL_DECL
+ if (SmDebugOutput == NULL)
+ return;
SM_VA_START(ap, fmt);
sm_io_vfprintf(SmDebugOutput, SmDebugOutput->f_timeout, fmt, ap);
SM_VA_END(ap);
diff --git a/gnu/usr.sbin/sendmail/libsm/errstring.c b/gnu/usr.sbin/sendmail/libsm/errstring.c
index a836dbaab24..0736ae6b6d3 100644
--- a/gnu/usr.sbin/sendmail/libsm/errstring.c
+++ b/gnu/usr.sbin/sendmail/libsm/errstring.c
@@ -11,7 +11,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: errstring.c,v 1.8 2001/08/27 12:59:34 ca Exp $")
+SM_RCSID("@(#)$Sendmail: errstring.c,v 1.11 2001/09/25 21:25:00 gshapiro Exp $")
#include <errno.h>
#include <stdio.h> /* sys_errlist, on some platforms */
@@ -43,6 +43,8 @@ const char *
sm_errstring(errnum)
int errnum;
{
+ char *ret;
+
switch (errnum)
{
case EPERM:
@@ -187,5 +189,13 @@ sm_errstring(errnum)
return ldap_err2string(errnum - E_LDAPBASE);
#endif /* LDAPMAP */
- return strerror(errnum);
+ ret = strerror(errnum);
+ if (ret == NULL)
+ {
+ static char buf[30];
+
+ (void) sm_snprintf(buf, sizeof buf, "Error %d", errnum);
+ return buf;
+ }
+ return ret;
}
diff --git a/gnu/usr.sbin/sendmail/libsm/exc.c b/gnu/usr.sbin/sendmail/libsm/exc.c
index 1ce07f65ad7..8924635c527 100644
--- a/gnu/usr.sbin/sendmail/libsm/exc.c
+++ b/gnu/usr.sbin/sendmail/libsm/exc.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: exc.c,v 1.43 2001/09/04 22:41:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: exc.c,v 1.45 2001/09/11 04:04:48 gshapiro Exp $")
/*
** exception handling
diff --git a/gnu/usr.sbin/sendmail/libsm/fclose.c b/gnu/usr.sbin/sendmail/libsm/fclose.c
index 7fb8785af70..c91511e2e3f 100644
--- a/gnu/usr.sbin/sendmail/libsm/fclose.c
+++ b/gnu/usr.sbin/sendmail/libsm/fclose.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fclose.c,v 1.39 2001/06/06 00:25:48 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fclose.c,v 1.41 2001/09/11 04:04:48 gshapiro Exp $")
#include <errno.h>
#include <stdlib.h>
#include <sys/time.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/feof.c b/gnu/usr.sbin/sendmail/libsm/feof.c
index 487dc07a6e7..e9f6ef8f991 100644
--- a/gnu/usr.sbin/sendmail/libsm/feof.c
+++ b/gnu/usr.sbin/sendmail/libsm/feof.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: feof.c,v 1.11 2001/04/03 01:46:40 ca Exp $")
+SM_RCSID("@(#)$Sendmail: feof.c,v 1.13 2001/09/11 04:04:48 gshapiro Exp $")
#include <sm/io.h>
#include <sm/assert.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/ferror.c b/gnu/usr.sbin/sendmail/libsm/ferror.c
index 94e9adc84ce..8f981662e44 100644
--- a/gnu/usr.sbin/sendmail/libsm/ferror.c
+++ b/gnu/usr.sbin/sendmail/libsm/ferror.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: ferror.c,v 1.11 2001/04/03 01:46:40 ca Exp $")
+SM_RCSID("@(#)$Sendmail: ferror.c,v 1.13 2001/09/11 04:04:48 gshapiro Exp $")
#include <sm/io.h>
#include <sm/assert.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/fflush.c b/gnu/usr.sbin/sendmail/libsm/fflush.c
index a65a8ec2307..d5089d18156 100644
--- a/gnu/usr.sbin/sendmail/libsm/fflush.c
+++ b/gnu/usr.sbin/sendmail/libsm/fflush.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fflush.c,v 1.41 2001/05/15 16:55:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fflush.c,v 1.43 2001/09/11 04:04:48 gshapiro Exp $")
#include <unistd.h>
#include <errno.h>
#include <sys/time.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fget.c b/gnu/usr.sbin/sendmail/libsm/fget.c
index de77a4ae03d..af3c8712741 100644
--- a/gnu/usr.sbin/sendmail/libsm/fget.c
+++ b/gnu/usr.sbin/sendmail/libsm/fget.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fget.c,v 1.22 2001/08/27 18:54:14 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: fget.c,v 1.24 2001/09/11 04:04:48 gshapiro Exp $")
#include <stdlib.h>
#include <string.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/findfp.c b/gnu/usr.sbin/sendmail/libsm/findfp.c
index 01aacacc823..4f691795f38 100644
--- a/gnu/usr.sbin/sendmail/libsm/findfp.c
+++ b/gnu/usr.sbin/sendmail/libsm/findfp.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: findfp.c,v 1.58 2001/08/31 21:02:50 ca Exp $")
+SM_RCSID("@(#)$Sendmail: findfp.c,v 1.60 2001/09/11 04:04:48 gshapiro Exp $")
#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/flags.c b/gnu/usr.sbin/sendmail/libsm/flags.c
index 54f9863913c..7cacf95e823 100644
--- a/gnu/usr.sbin/sendmail/libsm/flags.c
+++ b/gnu/usr.sbin/sendmail/libsm/flags.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: flags.c,v 1.18 2001/04/03 01:46:40 ca Exp $")
+SM_RCSID("@(#)$Sendmail: flags.c,v 1.20 2001/09/11 04:04:48 gshapiro Exp $")
#include <sys/types.h>
#include <sys/file.h>
#include <errno.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fopen.c b/gnu/usr.sbin/sendmail/libsm/fopen.c
index 081ff7aead2..81143d80e50 100644
--- a/gnu/usr.sbin/sendmail/libsm/fopen.c
+++ b/gnu/usr.sbin/sendmail/libsm/fopen.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fopen.c,v 1.55 2001/08/27 18:38:17 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: fopen.c,v 1.58 2001/09/11 04:04:48 gshapiro Exp $")
#include <errno.h>
#include <setjmp.h>
#include <sys/time.h>
@@ -54,7 +54,7 @@ openalrm(sig)
{
longjmp(OpenTimeOut, 1);
}
- /*
+/*
** REOPENALRM -- handler when timeout activated for sm_io_reopen()
**
** Returns flow of control to where setjmp(ReopenTimeOut) was set.
@@ -160,7 +160,7 @@ sm_io_open(type, timeout, info, flags, rpool)
return fp;
}
- /*
+/*
** SM_IO_DUP -- duplicate a file pointer
**
** Parameters:
@@ -196,7 +196,7 @@ sm_io_dup(fp)
fp->f_dup_cnt++;
return fp;
}
- /*
+/*
** SM_IO_REOPEN -- open a new file using the old file pointer
**
** Parameters:
@@ -312,7 +312,7 @@ sm_io_reopen(type, timeout, info, flags, rpool, fp)
return fp2;
}
- /*
+/*
** SM_IO_AUTOFLUSH -- link another file to this for auto-flushing
**
** When a read occurs on fp, fp2 will be flushed iff there is no
@@ -341,7 +341,7 @@ sm_io_autoflush(fp, fp2)
fp->f_flushfp = fp2;
return savefp;
}
- /*
+/*
** SM_IO_AUTOMODE -- link another file to this for auto-moding
**
** When the mode (blocking or non-blocking) changes for fp1 then
diff --git a/gnu/usr.sbin/sendmail/libsm/fpos.c b/gnu/usr.sbin/sendmail/libsm/fpos.c
index 279d017aba5..e20d3300379 100644
--- a/gnu/usr.sbin/sendmail/libsm/fpos.c
+++ b/gnu/usr.sbin/sendmail/libsm/fpos.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fpos.c,v 1.35 2001/06/06 00:25:48 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fpos.c,v 1.37 2001/09/11 04:04:48 gshapiro Exp $")
#include <errno.h>
#include <setjmp.h>
#include <sys/time.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fprintf.c b/gnu/usr.sbin/sendmail/libsm/fprintf.c
index d5605bb3495..0a2f4bf482e 100644
--- a/gnu/usr.sbin/sendmail/libsm/fprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/fprintf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fprintf.c,v 1.15 2001/03/02 23:53:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fprintf.c,v 1.17 2001/09/11 04:04:48 gshapiro Exp $")
#include <sm/varargs.h>
#include <sm/io.h>
#include <sm/assert.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fpurge.c b/gnu/usr.sbin/sendmail/libsm/fpurge.c
index fd18d458da2..48cd8fde137 100644
--- a/gnu/usr.sbin/sendmail/libsm/fpurge.c
+++ b/gnu/usr.sbin/sendmail/libsm/fpurge.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fpurge.c,v 1.18 2001/01/28 00:29:35 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fpurge.c,v 1.20 2001/09/11 04:04:48 gshapiro Exp $")
#include <stdlib.h>
#include <errno.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fput.c b/gnu/usr.sbin/sendmail/libsm/fput.c
index fd7dca085e2..7dd89facbfe 100644
--- a/gnu/usr.sbin/sendmail/libsm/fput.c
+++ b/gnu/usr.sbin/sendmail/libsm/fput.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fput.c,v 1.18 2001/01/28 00:29:35 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fput.c,v 1.20 2001/09/11 04:04:48 gshapiro Exp $")
#include <string.h>
#include <errno.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fread.c b/gnu/usr.sbin/sendmail/libsm/fread.c
index 0e0a97e7fba..9439f73e4cc 100644
--- a/gnu/usr.sbin/sendmail/libsm/fread.c
+++ b/gnu/usr.sbin/sendmail/libsm/fread.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fread.c,v 1.26 2001/02/28 20:54:03 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fread.c,v 1.28 2001/09/11 04:04:48 gshapiro Exp $")
#include <string.h>
#include <errno.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fscanf.c b/gnu/usr.sbin/sendmail/libsm/fscanf.c
index 71254d05c95..462c0330ae7 100644
--- a/gnu/usr.sbin/sendmail/libsm/fscanf.c
+++ b/gnu/usr.sbin/sendmail/libsm/fscanf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fscanf.c,v 1.15 2001/03/02 23:53:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fscanf.c,v 1.17 2001/09/11 04:04:48 gshapiro Exp $")
#include <sm/varargs.h>
#include <sm/assert.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fseek.c b/gnu/usr.sbin/sendmail/libsm/fseek.c
index bb7d3308573..0fac33ffdbc 100644
--- a/gnu/usr.sbin/sendmail/libsm/fseek.c
+++ b/gnu/usr.sbin/sendmail/libsm/fseek.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fseek.c,v 1.42 2001/08/27 18:54:14 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: fseek.c,v 1.45 2001/09/11 04:04:48 gshapiro Exp $")
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -31,7 +31,7 @@ SM_RCSID("@(#)$Sendmail: fseek.c,v 1.42 2001/08/27 18:54:14 gshapiro Exp $")
static jmp_buf SeekTimeOut;
- /*
+/*
** SEEKALRM -- handler when timeout activated for sm_io_seek()
**
** Returns flow of control to where setjmp(SeekTimeOut) was set.
diff --git a/gnu/usr.sbin/sendmail/libsm/fvwrite.c b/gnu/usr.sbin/sendmail/libsm/fvwrite.c
index 19e3ed0cc5f..a64e27f4882 100644
--- a/gnu/usr.sbin/sendmail/libsm/fvwrite.c
+++ b/gnu/usr.sbin/sendmail/libsm/fvwrite.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fvwrite.c,v 1.47 2001/08/27 13:02:20 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fvwrite.c,v 1.49 2001/09/11 04:04:48 gshapiro Exp $")
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/fwalk.c b/gnu/usr.sbin/sendmail/libsm/fwalk.c
index 5f52a2cf8fa..7b607fd4fec 100644
--- a/gnu/usr.sbin/sendmail/libsm/fwalk.c
+++ b/gnu/usr.sbin/sendmail/libsm/fwalk.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fwalk.c,v 1.19 2001/03/02 03:22:18 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fwalk.c,v 1.21 2001/09/11 04:04:48 gshapiro Exp $")
#include <errno.h>
#include <sm/io.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/fwrite.c b/gnu/usr.sbin/sendmail/libsm/fwrite.c
index 3e8ab5f5409..df43b64d7cc 100644
--- a/gnu/usr.sbin/sendmail/libsm/fwrite.c
+++ b/gnu/usr.sbin/sendmail/libsm/fwrite.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: fwrite.c,v 1.22 2001/04/03 01:46:40 ca Exp $")
+SM_RCSID("@(#)$Sendmail: fwrite.c,v 1.24 2001/09/11 04:04:48 gshapiro Exp $")
#include <errno.h>
#include <sm/io.h>
#include <sm/assert.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/get.c b/gnu/usr.sbin/sendmail/libsm/get.c
index 068286a6344..e7c104252f7 100644
--- a/gnu/usr.sbin/sendmail/libsm/get.c
+++ b/gnu/usr.sbin/sendmail/libsm/get.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: get.c,v 1.16 2001/01/28 00:29:35 ca Exp $")
+SM_RCSID("@(#)$Sendmail: get.c,v 1.18 2001/09/11 04:04:48 gshapiro Exp $")
#include <sm/io.h>
#include <sm/assert.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/heap.c b/gnu/usr.sbin/sendmail/libsm/heap.c
index 27ab6c767e7..e4ea5fd47b8 100644
--- a/gnu/usr.sbin/sendmail/libsm/heap.c
+++ b/gnu/usr.sbin/sendmail/libsm/heap.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: heap.c,v 1.47 2001/09/04 22:41:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: heap.c,v 1.50 2001/09/11 04:04:48 gshapiro Exp $")
/*
** debugging memory allocation package
@@ -179,7 +179,7 @@ sm_realloc_x(ptr, size)
sm_exc_raise_x(&SmHeapOutOfMemory);
return newptr;
}
- /*
+/*
** SM_FREE -- wrapper around free()
**
** Parameters:
@@ -507,7 +507,7 @@ sm_heap_register(ptr, size, tag, num, group)
SmHeapTable[i] = hi;
return true;
}
- /*
+/*
** SM_REALLOC -- wrapper for realloc(), debugging version.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libsm/ldap.c b/gnu/usr.sbin/sendmail/libsm/ldap.c
index 2c92bce45ee..2f7af53c3cd 100644
--- a/gnu/usr.sbin/sendmail/libsm/ldap.c
+++ b/gnu/usr.sbin/sendmail/libsm/ldap.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: ldap.c,v 1.8 2001/06/06 00:09:47 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: ldap.c,v 1.10 2001/09/11 04:04:48 gshapiro Exp $")
#if LDAPMAP
# include <sys/types.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/makebuf.c b/gnu/usr.sbin/sendmail/libsm/makebuf.c
index 958cb21ebb6..7b4efc24519 100644
--- a/gnu/usr.sbin/sendmail/libsm/makebuf.c
+++ b/gnu/usr.sbin/sendmail/libsm/makebuf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: makebuf.c,v 1.21 2001/08/27 13:03:48 ca Exp $")
+SM_RCSID("@(#)$Sendmail: makebuf.c,v 1.23 2001/09/11 04:04:48 gshapiro Exp $")
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/match.c b/gnu/usr.sbin/sendmail/libsm/match.c
index e195476f5b6..59213e12457 100644
--- a/gnu/usr.sbin/sendmail/libsm/match.c
+++ b/gnu/usr.sbin/sendmail/libsm/match.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: match.c,v 1.8 2001/03/02 19:57:08 ca Exp $")
+SM_RCSID("@(#)$Sendmail: match.c,v 1.10 2001/09/11 04:04:48 gshapiro Exp $")
#include <sm/string.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/mbdb.c b/gnu/usr.sbin/sendmail/libsm/mbdb.c
index 24e2135e320..eabd6098b37 100644
--- a/gnu/usr.sbin/sendmail/libsm/mbdb.c
+++ b/gnu/usr.sbin/sendmail/libsm/mbdb.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: mbdb.c,v 1.21 2001/03/16 00:38:43 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: mbdb.c,v 1.23 2001/09/11 04:04:48 gshapiro Exp $")
#include <sys/param.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/niprop.c b/gnu/usr.sbin/sendmail/libsm/niprop.c
index 68fc707d9ba..0f6d974f181 100644
--- a/gnu/usr.sbin/sendmail/libsm/niprop.c
+++ b/gnu/usr.sbin/sendmail/libsm/niprop.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: niprop.c,v 1.6 2001/09/04 22:41:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: niprop.c,v 1.8 2001/09/11 04:04:48 gshapiro Exp $")
#if NETINFO
#include <ctype.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/path.c b/gnu/usr.sbin/sendmail/libsm/path.c
index 6f0f3eff7bb..626ccb8ddf6 100644
--- a/gnu/usr.sbin/sendmail/libsm/path.c
+++ b/gnu/usr.sbin/sendmail/libsm/path.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: path.c,v 1.7 2001/08/28 16:06:59 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: path.c,v 1.9 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/path.h>
#include <sm/string.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/put.c b/gnu/usr.sbin/sendmail/libsm/put.c
index debdb0c8e48..309edb2ced0 100644
--- a/gnu/usr.sbin/sendmail/libsm/put.c
+++ b/gnu/usr.sbin/sendmail/libsm/put.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: put.c,v 1.24 2001/03/05 03:22:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: put.c,v 1.26 2001/09/11 04:04:49 gshapiro Exp $")
#include <string.h>
#include <errno.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/refill.c b/gnu/usr.sbin/sendmail/libsm/refill.c
index 0cfd64d47ac..c51f3dd355d 100644
--- a/gnu/usr.sbin/sendmail/libsm/refill.c
+++ b/gnu/usr.sbin/sendmail/libsm/refill.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: refill.c,v 1.47 2001/06/06 00:22:56 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: refill.c,v 1.49 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/rewind.c b/gnu/usr.sbin/sendmail/libsm/rewind.c
index 915d908205b..7914d44eade 100644
--- a/gnu/usr.sbin/sendmail/libsm/rewind.c
+++ b/gnu/usr.sbin/sendmail/libsm/rewind.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: rewind.c,v 1.16 2001/04/03 01:46:40 ca Exp $")
+SM_RCSID("@(#)$Sendmail: rewind.c,v 1.18 2001/09/11 04:04:49 gshapiro Exp $")
#include <errno.h>
#include <sm/io.h>
#include <sm/assert.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/rpool.c b/gnu/usr.sbin/sendmail/libsm/rpool.c
index b620e8886d1..62bb8a04d41 100644
--- a/gnu/usr.sbin/sendmail/libsm/rpool.c
+++ b/gnu/usr.sbin/sendmail/libsm/rpool.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: rpool.c,v 1.21 2001/09/04 22:41:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: rpool.c,v 1.23 2001/09/11 04:04:49 gshapiro Exp $")
/*
** resource pools
diff --git a/gnu/usr.sbin/sendmail/libsm/setvbuf.c b/gnu/usr.sbin/sendmail/libsm/setvbuf.c
index 1ae2b209ee0..b00bea387e2 100644
--- a/gnu/usr.sbin/sendmail/libsm/setvbuf.c
+++ b/gnu/usr.sbin/sendmail/libsm/setvbuf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: setvbuf.c,v 1.30 2001/02/28 20:25:18 rodney Exp $")
+SM_RCSID("@(#)$Sendmail: setvbuf.c,v 1.32 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/shm.c b/gnu/usr.sbin/sendmail/libsm/shm.c
index d368a9cddb6..d108db1b940 100644
--- a/gnu/usr.sbin/sendmail/libsm/shm.c
+++ b/gnu/usr.sbin/sendmail/libsm/shm.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: shm.c,v 1.6 2001/02/14 04:39:47 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: shm.c,v 1.8 2001/09/11 04:04:49 gshapiro Exp $")
#if SM_CONF_SHM
# include <stdlib.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/signal.c b/gnu/usr.sbin/sendmail/libsm/signal.c
index 47fa703e0b8..9cd320ac18b 100644
--- a/gnu/usr.sbin/sendmail/libsm/signal.c
+++ b/gnu/usr.sbin/sendmail/libsm/signal.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: signal.c,v 1.13 2001/08/14 16:05:47 ca Exp $")
+SM_RCSID("@(#)$Sendmail: signal.c,v 1.16 2001/09/11 04:04:49 gshapiro Exp $")
#if SM_CONF_SETITIMER
# include <sys/time.h>
@@ -25,7 +25,7 @@ SM_RCSID("@(#)$Sendmail: signal.c,v 1.13 2001/08/14 16:05:47 ca Exp $")
unsigned int volatile InCriticalSection; /* >0 if inside critical section */
int volatile PendingSignal; /* pending signal to resend */
- /*
+/*
** SM_SIGNAL -- set a signal handler
**
** This is essentially old BSD "signal(3)".
@@ -89,7 +89,7 @@ sm_signal(sig, handler)
# endif /* defined(SYS5SIGNALS) || defined(BSD4_3) */
# endif /* SA_RESTART */
}
- /*
+/*
** SM_BLOCKSIGNAL -- hold a signal to prevent delivery
**
** Parameters:
@@ -131,7 +131,7 @@ sm_blocksignal(sig)
# endif /* ALTOS_SYSTEM_V */
# endif /* BSD4_3 */
}
- /*
+/*
** SM_RELEASESIGNAL -- release a held signal
**
** Parameters:
@@ -170,7 +170,7 @@ sm_releasesignal(sig)
# endif /* ALTOS_SYSTEM_V */
# endif /* BSD4_3 */
}
- /*
+/*
** PEND_SIGNAL -- Add a signal to the pending signal list
**
** Parameters:
@@ -249,7 +249,7 @@ pend_signal(sig)
#endif /* SM_CONF_SETITIMER */
errno = save_errno;
}
- /*
+/*
** SM_ALLSIGNALS -- act on all signals
**
** Parameters:
@@ -316,7 +316,7 @@ sm_allsignals(block)
# endif /* ALTOS_SYSTEM_V */
# endif /* BSD4_3 */
}
- /*
+/*
** SM_SIGNAL_NOOP -- A signal no-op function
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libsm/smstdio.c b/gnu/usr.sbin/sendmail/libsm/smstdio.c
index a182599c293..2bf59b89504 100644
--- a/gnu/usr.sbin/sendmail/libsm/smstdio.c
+++ b/gnu/usr.sbin/sendmail/libsm/smstdio.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: smstdio.c,v 1.27 2001/03/05 03:22:41 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: smstdio.c,v 1.29 2001/09/11 04:04:49 gshapiro Exp $")
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/snprintf.c b/gnu/usr.sbin/sendmail/libsm/snprintf.c
index 9994140fff6..1165146cb6c 100644
--- a/gnu/usr.sbin/sendmail/libsm/snprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/snprintf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: snprintf.c,v 1.21 2001/03/02 23:53:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: snprintf.c,v 1.23 2001/09/11 04:04:49 gshapiro Exp $")
#include <limits.h>
#include <sm/varargs.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/sscanf.c b/gnu/usr.sbin/sendmail/libsm/sscanf.c
index a24e5cb098a..99c920f6d0f 100644
--- a/gnu/usr.sbin/sendmail/libsm/sscanf.c
+++ b/gnu/usr.sbin/sendmail/libsm/sscanf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: sscanf.c,v 1.22 2001/03/02 23:53:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: sscanf.c,v 1.24 2001/09/11 04:04:49 gshapiro Exp $")
#include <string.h>
#include <sm/varargs.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/stdio.c b/gnu/usr.sbin/sendmail/libsm/stdio.c
index 9180a5bbc7c..92007453ec6 100644
--- a/gnu/usr.sbin/sendmail/libsm/stdio.c
+++ b/gnu/usr.sbin/sendmail/libsm/stdio.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: stdio.c,v 1.49 2001/08/28 16:06:59 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: stdio.c,v 1.52 2001/09/18 21:45:23 gshapiro Exp $")
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
@@ -388,7 +388,7 @@ sm_stdfdopen(fp, info, flags, rpool)
int flags;
const void *rpool;
{
- int oflags, tmp, fdflags, fd = (int) info;
+ int oflags, tmp, fdflags, fd = *((int *) info);
switch (flags)
{
diff --git a/gnu/usr.sbin/sendmail/libsm/strcasecmp.c b/gnu/usr.sbin/sendmail/libsm/strcasecmp.c
index f2df7f00f94..fa49113b239 100644
--- a/gnu/usr.sbin/sendmail/libsm/strcasecmp.c
+++ b/gnu/usr.sbin/sendmail/libsm/strcasecmp.c
@@ -12,13 +12,13 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: strcasecmp.c,v 1.12 2001/08/27 22:09:15 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: strcasecmp.c,v 1.15 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/config.h>
#include <sm/string.h>
#include <string.h>
- /*
+/*
** SM_STRCASECMP -- 8-bit clean version of strcasecmp
**
** Thank you, vendors, for making this all necessary.
diff --git a/gnu/usr.sbin/sendmail/libsm/strdup.c b/gnu/usr.sbin/sendmail/libsm/strdup.c
index 442175edb85..43483d59f5e 100644
--- a/gnu/usr.sbin/sendmail/libsm/strdup.c
+++ b/gnu/usr.sbin/sendmail/libsm/strdup.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: strdup.c,v 1.11 2001/03/03 03:06:47 ca Exp $")
+SM_RCSID("@(#)$Sendmail: strdup.c,v 1.13 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/heap.h>
#include <sm/string.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/strerror.c b/gnu/usr.sbin/sendmail/libsm/strerror.c
index 04beae8e1bf..72e050e850d 100644
--- a/gnu/usr.sbin/sendmail/libsm/strerror.c
+++ b/gnu/usr.sbin/sendmail/libsm/strerror.c
@@ -12,7 +12,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: strerror.c,v 1.21 2001/06/17 21:31:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: strerror.c,v 1.23 2001/09/11 04:04:49 gshapiro Exp $")
/*
** define strerror for platforms that lack it.
diff --git a/gnu/usr.sbin/sendmail/libsm/strexit.c b/gnu/usr.sbin/sendmail/libsm/strexit.c
index 241996e3800..ce591a13b69 100644
--- a/gnu/usr.sbin/sendmail/libsm/strexit.c
+++ b/gnu/usr.sbin/sendmail/libsm/strexit.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: strexit.c,v 1.3 2001/01/15 18:39:11 ca Exp $")
+SM_RCSID("@(#)$Sendmail: strexit.c,v 1.5 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/string.h>
#include <sm/sysexits.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/string.c b/gnu/usr.sbin/sendmail/libsm/string.c
index 9948f52b703..9bc1bc38a47 100644
--- a/gnu/usr.sbin/sendmail/libsm/string.c
+++ b/gnu/usr.sbin/sendmail/libsm/string.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: string.c,v 1.1 2001/02/15 21:04:50 ca Exp $")
+SM_RCSID("@(#)$Sendmail: string.c,v 1.3 2001/09/11 04:04:49 gshapiro Exp $")
#include <ctype.h>
#include <errno.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/stringf.c b/gnu/usr.sbin/sendmail/libsm/stringf.c
index 271aa4a9380..e7d64a66b86 100644
--- a/gnu/usr.sbin/sendmail/libsm/stringf.c
+++ b/gnu/usr.sbin/sendmail/libsm/stringf.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: stringf.c,v 1.13 2001/03/03 03:40:43 ca Exp $")
+SM_RCSID("@(#)$Sendmail: stringf.c,v 1.15 2001/09/11 04:04:49 gshapiro Exp $")
#include <errno.h>
#include <stdio.h>
#include <sm/exc.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/strio.c b/gnu/usr.sbin/sendmail/libsm/strio.c
index 4883816e123..47d9816f96d 100644
--- a/gnu/usr.sbin/sendmail/libsm/strio.c
+++ b/gnu/usr.sbin/sendmail/libsm/strio.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: strio.c,v 1.38 2001/03/06 17:27:06 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: strio.c,v 1.40 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/strl.c b/gnu/usr.sbin/sendmail/libsm/strl.c
index 1ccd97cb812..225b156a248 100644
--- a/gnu/usr.sbin/sendmail/libsm/strl.c
+++ b/gnu/usr.sbin/sendmail/libsm/strl.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: strl.c,v 1.25 2001/08/27 13:08:22 ca Exp $")
+SM_RCSID("@(#)$Sendmail: strl.c,v 1.28 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/config.h>
#include <sm/string.h>
@@ -115,7 +115,7 @@ sm_strlcat(dst, src, size)
else
return j + strlen(src + i);
}
- /*
+/*
** SM_STRLCAT2 -- append two strings to dst obeying length and
** '\0' terminate it
**
@@ -181,7 +181,7 @@ sm_strlcat2(dst, src1, src2, len)
return j + strlen(src2 + i);
}
- /*
+/*
** SM_STRLCPYN -- concatenate n strings and assign the result to dst
** while obeying length and '\0' terminate it
**
diff --git a/gnu/usr.sbin/sendmail/libsm/strrevcmp.c b/gnu/usr.sbin/sendmail/libsm/strrevcmp.c
index 122ac82e088..6ba6b268492 100644
--- a/gnu/usr.sbin/sendmail/libsm/strrevcmp.c
+++ b/gnu/usr.sbin/sendmail/libsm/strrevcmp.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: strrevcmp.c,v 1.2 2001/08/27 22:21:51 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: strrevcmp.c,v 1.5 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/config.h>
#include <sm/string.h>
@@ -60,7 +60,7 @@ sm_strrevcasecmp(s1, s2)
charmap[(unsigned char) s2[i2]]);
}
}
- /*
+/*
** SM_STRREVCMP -- compare two strings starting at the end
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libsm/strto.c b/gnu/usr.sbin/sendmail/libsm/strto.c
index 0b44d169d1a..d719e100816 100644
--- a/gnu/usr.sbin/sendmail/libsm/strto.c
+++ b/gnu/usr.sbin/sendmail/libsm/strto.c
@@ -10,7 +10,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: strto.c,v 1.14 2001/08/27 22:27:14 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: strto.c,v 1.16 2001/09/11 04:04:49 gshapiro Exp $")
#include <sys/types.h>
#include <stdlib.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/syslogio.c b/gnu/usr.sbin/sendmail/libsm/syslogio.c
index d428f28a996..99e8644af34 100644
--- a/gnu/usr.sbin/sendmail/libsm/syslogio.c
+++ b/gnu/usr.sbin/sendmail/libsm/syslogio.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: syslogio.c,v 1.27 2001/03/04 17:55:32 ca Exp $")
+SM_RCSID("@(#)$Sendmail: syslogio.c,v 1.29 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-cf.c b/gnu/usr.sbin/sendmail/libsm/t-cf.c
index 63e000f6e44..cecc961199b 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-cf.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-cf.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-cf.c,v 1.5 2001/03/21 18:30:41 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-cf.c,v 1.7 2001/09/11 04:04:49 gshapiro Exp $")
#include <errno.h>
#include <stdio.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-event.c b/gnu/usr.sbin/sendmail/libsm/t-event.c
index 8cb0790284d..01bf1c97256 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-event.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-event.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: t-event.c,v 1.5 2001/09/05 20:02:02 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: t-event.c,v 1.7 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdio.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-exc.c b/gnu/usr.sbin/sendmail/libsm/t-exc.c
index 0194d87b95d..cabf56cfaa3 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-exc.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-exc.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-exc.c,v 1.18 2001/07/05 22:46:35 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-exc.c,v 1.20 2001/09/11 04:04:49 gshapiro Exp $")
#include <string.h>
#include <sm/heap.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-float.c b/gnu/usr.sbin/sendmail/libsm/t-float.c
index 0cbbf758d76..87bd76c3aaf 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-float.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-float.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-float.c,v 1.16 2001/02/02 23:11:46 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-float.c,v 1.18 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/limits.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-fopen.c b/gnu/usr.sbin/sendmail/libsm/t-fopen.c
index 0420e729634..ecc9de75f90 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-fopen.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-fopen.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-fopen.c,v 1.6 2001/03/05 03:21:28 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-fopen.c,v 1.8 2001/09/11 04:04:49 gshapiro Exp $")
#include <fcntl.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-heap.c b/gnu/usr.sbin/sendmail/libsm/t-heap.c
index e4fea360966..6d8a9533f95 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-heap.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-heap.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-heap.c,v 1.8 2001/03/06 17:27:36 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-heap.c,v 1.10 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/debug.h>
#include <sm/heap.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-match.c b/gnu/usr.sbin/sendmail/libsm/t-match.c
index 44a7e6b7c57..a8bf1b98511 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-match.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-match.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-match.c,v 1.7 2000/12/18 18:12:12 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-match.c,v 1.9 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/string.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-path.c b/gnu/usr.sbin/sendmail/libsm/t-path.c
index 9037434136f..3fb6023a1c7 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-path.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-path.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-path.c,v 1.6 2001/07/05 22:47:29 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-path.c,v 1.8 2001/09/11 04:04:49 gshapiro Exp $")
#include <string.h>
#include <sm/path.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-rpool.c b/gnu/usr.sbin/sendmail/libsm/t-rpool.c
index 65dd3df3e28..8927f0fe013 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-rpool.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-rpool.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-rpool.c,v 1.16 2001/03/04 18:38:47 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-rpool.c,v 1.18 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/debug.h>
#include <sm/heap.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-scanf.c b/gnu/usr.sbin/sendmail/libsm/t-scanf.c
index fe2d916dae0..55e7be2fd11 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-scanf.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-scanf.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-scanf.c,v 1.2 2001/08/21 20:36:46 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-scanf.c,v 1.4 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/limits.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-shm.c b/gnu/usr.sbin/sendmail/libsm/t-shm.c
index ff0d84af1a1..dcbe2b78f91 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-shm.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-shm.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: t-shm.c,v 1.15 2001/08/27 23:00:05 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: t-shm.c,v 1.17 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdio.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-smstdio.c b/gnu/usr.sbin/sendmail/libsm/t-smstdio.c
index f7e4c078c47..75616965b3a 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-smstdio.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-smstdio.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-smstdio.c,v 1.9 2001/03/21 18:30:41 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-smstdio.c,v 1.11 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/io.h>
#include <sm/string.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-string.c b/gnu/usr.sbin/sendmail/libsm/t-string.c
index 8a5073a938c..8d5bc00dd34 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-string.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-string.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-string.c,v 1.9 2001/01/26 03:28:43 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-string.c,v 1.11 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/exc.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-strio.c b/gnu/usr.sbin/sendmail/libsm/t-strio.c
index ea3a50f21ce..5fb68d7582b 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-strio.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-strio.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-strio.c,v 1.9 2001/03/03 04:00:53 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-strio.c,v 1.11 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/string.h>
#include <sm/io.h>
#include <sm/test.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-strl.c b/gnu/usr.sbin/sendmail/libsm/t-strl.c
index 3ec903173d0..623781ec210 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-strl.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-strl.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-strl.c,v 1.13 2001/08/27 23:00:05 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-strl.c,v 1.15 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <stdio.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-strrevcmp.c b/gnu/usr.sbin/sendmail/libsm/t-strrevcmp.c
index 41c4d98470b..74093d27e72 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-strrevcmp.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-strrevcmp.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-strrevcmp.c,v 1.1 2001/07/16 21:35:28 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-strrevcmp.c,v 1.3 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/exc.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/t-types.c b/gnu/usr.sbin/sendmail/libsm/t-types.c
index b5901b64fa1..8e336d58b88 100644
--- a/gnu/usr.sbin/sendmail/libsm/t-types.c
+++ b/gnu/usr.sbin/sendmail/libsm/t-types.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: t-types.c,v 1.14 2001/07/30 00:01:42 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: t-types.c,v 1.16 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/limits.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/test.c b/gnu/usr.sbin/sendmail/libsm/test.c
index 5a186c638ad..852e5386dc4 100644
--- a/gnu/usr.sbin/sendmail/libsm/test.c
+++ b/gnu/usr.sbin/sendmail/libsm/test.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(Id, "@(#)$Sendmail: test.c,v 1.12 2001/03/05 03:22:41 ca Exp $")
+SM_IDSTR(Id, "@(#)$Sendmail: test.c,v 1.14 2001/09/11 04:04:49 gshapiro Exp $")
/*
** Abstractions for writing libsm test programs.
diff --git a/gnu/usr.sbin/sendmail/libsm/ungetc.c b/gnu/usr.sbin/sendmail/libsm/ungetc.c
index 2d8f260d1f1..5c6288f5fed 100644
--- a/gnu/usr.sbin/sendmail/libsm/ungetc.c
+++ b/gnu/usr.sbin/sendmail/libsm/ungetc.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: ungetc.c,v 1.26 2001/03/05 02:18:16 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: ungetc.c,v 1.28 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <string.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/vasprintf.c b/gnu/usr.sbin/sendmail/libsm/vasprintf.c
index 5e2020fcf58..fbe1849ccbf 100644
--- a/gnu/usr.sbin/sendmail/libsm/vasprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vasprintf.c
@@ -35,7 +35,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: vasprintf.c,v 1.24 2001/03/06 17:28:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: vasprintf.c,v 1.26 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <errno.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/vfprintf.c b/gnu/usr.sbin/sendmail/libsm/vfprintf.c
index 9e6e0b23a76..cae9cddf965 100644
--- a/gnu/usr.sbin/sendmail/libsm/vfprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vfprintf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: vfprintf.c,v 1.50 2001/06/24 04:22:03 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: vfprintf.c,v 1.52 2001/09/11 04:04:49 gshapiro Exp $")
/*
** Overall:
diff --git a/gnu/usr.sbin/sendmail/libsm/vfscanf.c b/gnu/usr.sbin/sendmail/libsm/vfscanf.c
index 044807c6f41..046ad1d7366 100644
--- a/gnu/usr.sbin/sendmail/libsm/vfscanf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vfscanf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_IDSTR(id, "@(#)$Sendmail: vfscanf.c,v 1.49 2001/08/14 18:07:18 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: vfscanf.c,v 1.51 2001/09/11 04:04:49 gshapiro Exp $")
#include <ctype.h>
#include <stdlib.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/vprintf.c b/gnu/usr.sbin/sendmail/libsm/vprintf.c
index cc10e50d4f5..9b1b2827abb 100644
--- a/gnu/usr.sbin/sendmail/libsm/vprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vprintf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: vprintf.c,v 1.12 2001/01/24 01:27:26 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: vprintf.c,v 1.14 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/io.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/vsnprintf.c b/gnu/usr.sbin/sendmail/libsm/vsnprintf.c
index 63c5c85bce7..98a62d2fe5e 100644
--- a/gnu/usr.sbin/sendmail/libsm/vsnprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vsnprintf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: vsnprintf.c,v 1.21 2001/03/04 23:28:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: vsnprintf.c,v 1.23 2001/09/11 04:04:49 gshapiro Exp $")
#include <limits.h>
#include <sm/io.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/vsprintf.c b/gnu/usr.sbin/sendmail/libsm/vsprintf.c
index bf514ea1c85..3afe8ef8cc0 100644
--- a/gnu/usr.sbin/sendmail/libsm/vsprintf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vsprintf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: vsprintf.c,v 1.19 2001/03/05 03:22:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: vsprintf.c,v 1.21 2001/09/11 04:04:49 gshapiro Exp $")
#include <limits.h>
#include <sm/io.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/vsscanf.c b/gnu/usr.sbin/sendmail/libsm/vsscanf.c
index ee298f40dbb..d2ce488175c 100644
--- a/gnu/usr.sbin/sendmail/libsm/vsscanf.c
+++ b/gnu/usr.sbin/sendmail/libsm/vsscanf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: vsscanf.c,v 1.20 2001/03/04 23:28:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: vsscanf.c,v 1.22 2001/09/11 04:04:49 gshapiro Exp $")
#include <string.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/wbuf.c b/gnu/usr.sbin/sendmail/libsm/wbuf.c
index e72db9a8d3a..646f4687b13 100644
--- a/gnu/usr.sbin/sendmail/libsm/wbuf.c
+++ b/gnu/usr.sbin/sendmail/libsm/wbuf.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: wbuf.c,v 1.19 2001/03/05 03:22:41 ca Exp $")
+SM_RCSID("@(#)$Sendmail: wbuf.c,v 1.21 2001/09/11 04:04:49 gshapiro Exp $")
#include <errno.h>
#include <sm/io.h>
#include "local.h"
diff --git a/gnu/usr.sbin/sendmail/libsm/wsetup.c b/gnu/usr.sbin/sendmail/libsm/wsetup.c
index 67bf8b8bb1c..968476eff45 100644
--- a/gnu/usr.sbin/sendmail/libsm/wsetup.c
+++ b/gnu/usr.sbin/sendmail/libsm/wsetup.c
@@ -13,7 +13,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: wsetup.c,v 1.17 2001/02/28 16:56:45 ca Exp $")
+SM_RCSID("@(#)$Sendmail: wsetup.c,v 1.19 2001/09/11 04:04:49 gshapiro Exp $")
#include <stdlib.h>
#include <errno.h>
#include <sm/io.h>
diff --git a/gnu/usr.sbin/sendmail/libsm/xtrap.c b/gnu/usr.sbin/sendmail/libsm/xtrap.c
index 7d47209f086..bdd948a128e 100644
--- a/gnu/usr.sbin/sendmail/libsm/xtrap.c
+++ b/gnu/usr.sbin/sendmail/libsm/xtrap.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: xtrap.c,v 1.3 2000/12/08 08:03:09 rodney Exp $")
+SM_RCSID("@(#)$Sendmail: xtrap.c,v 1.5 2001/09/11 04:04:49 gshapiro Exp $")
#include <sm/xtrap.h>
diff --git a/gnu/usr.sbin/sendmail/libsmdb/smdb.c b/gnu/usr.sbin/sendmail/libsmdb/smdb.c
index da694d07fe1..740f967b9c8 100644
--- a/gnu/usr.sbin/sendmail/libsmdb/smdb.c
+++ b/gnu/usr.sbin/sendmail/libsmdb/smdb.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: smdb.c,v 8.49 2001/09/04 22:43:45 ca Exp $")
+SM_RCSID("@(#)$Sendmail: smdb.c,v 8.52 2001/09/11 04:04:52 gshapiro Exp $")
#include <fcntl.h>
#include <stdlib.h>
@@ -18,7 +18,7 @@ SM_RCSID("@(#)$Sendmail: smdb.c,v 8.49 2001/09/04 22:43:45 ca Exp $")
#include <sendmail/sendmail.h>
#include <libsmdb/smdb.h>
- /*
+/*
** SMDB_MALLOC_DATABASE -- Allocates a database structure.
**
** Parameters:
@@ -43,7 +43,7 @@ smdb_malloc_database()
}
- /*
+/*
** SMDB_FREE_DATABASE -- Unallocates a database structure.
**
** Parameters:
@@ -60,7 +60,7 @@ smdb_free_database(database)
if (database != NULL)
free(database);
}
- /*
+/*
** SMDB_LOCKFILE -- lock a file using flock or (shudder) fcntl locking
**
** Parameters:
@@ -155,7 +155,7 @@ smdb_lockfile(fd, type)
errno = save_errno;
return false;
}
- /*
+/*
** SMDB_OPEN_DATABASE -- Opens a database.
**
** This opens a database. If type is SMDB_DEFAULT it tries to
@@ -246,7 +246,7 @@ smdb_open_database(database, db_name, mode, mode_mask, sff, type, user_info,
return SMDBE_UNKNOWN_DB_TYPE;
}
- /*
+/*
** SMDB_ADD_EXTENSION -- Adds an extension to a file name.
**
** Just adds a . followed by a string to a db_name if there
@@ -293,7 +293,7 @@ smdb_add_extension(full_name, max_full_name_len, db_name, extension)
return SMDBE_OK;
}
- /*
+/*
** SMDB_LOCK_FILE -- Locks the database file.
**
** Locks the actual database file.
@@ -331,7 +331,7 @@ smdb_lock_file(lock_fd, db_name, mode, sff, extension)
return SMDBE_OK;
}
- /*
+/*
** SMDB_UNLOCK_FILE -- Unlocks a file
**
** Unlocks a file.
@@ -355,7 +355,7 @@ smdb_unlock_file(lock_fd)
return SMDBE_OK;
}
- /*
+/*
** SMDB_LOCK_MAP -- Locks a database.
**
** Parameters:
@@ -382,7 +382,7 @@ smdb_lock_map(database, type)
return SMDBE_LOCK_NOT_GRANTED;
return SMDBE_OK;
}
- /*
+/*
** SMDB_UNLOCK_MAP -- Unlocks a database
**
** Parameters:
@@ -405,7 +405,7 @@ smdb_unlock_map(database)
return SMDBE_LOCK_NOT_HELD;
return SMDBE_OK;
}
- /*
+/*
** SMDB_SETUP_FILE -- Gets db file ready for use.
**
** Makes sure permissions on file are safe and creates it if it
@@ -449,7 +449,7 @@ smdb_setup_file(db_name, extension, mode_mask, sff, user_info, stat_info)
return SMDBE_OK;
}
- /*
+/*
** SMDB_FILECHANGED -- Checks to see if a file changed.
**
** Compares the passed in stat_info with a current stat on
@@ -481,7 +481,7 @@ smdb_filechanged(db_name, extension, db_fd, stat_info)
return result;
return filechanged(db_file_name, db_fd, stat_info);
}
- /*
+/*
** SMDB_PRINT_AVAILABLE_TYPES -- Prints the names of the available types.
**
** Parameters:
@@ -502,7 +502,7 @@ smdb_print_available_types()
printf("btree\n");
#endif /* NEWDB */
}
- /*
+/*
** SMDB_DB_DEFINITION -- Given a database type, return database definition
**
** Reads though a structure making an association with the database
diff --git a/gnu/usr.sbin/sendmail/libsmdb/smdb1.c b/gnu/usr.sbin/sendmail/libsmdb/smdb1.c
index 7349c00414f..79ca6bb7532 100644
--- a/gnu/usr.sbin/sendmail/libsmdb/smdb1.c
+++ b/gnu/usr.sbin/sendmail/libsmdb/smdb1.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: smdb1.c,v 8.51 2001/05/10 01:23:58 ca Exp $")
+SM_RCSID("@(#)$Sendmail: smdb1.c,v 8.55 2001/09/12 21:19:12 gshapiro Exp $")
#include <unistd.h>
#include <stdlib.h>
@@ -35,7 +35,7 @@ struct smdb_db1_cursor
};
typedef struct smdb_db1_cursor SMDB_DB1_CURSOR;
- /*
+/*
** SMDB_TYPE_TO_DB1_TYPE -- Translates smdb database type to db1 type.
**
** Parameters:
@@ -63,7 +63,7 @@ smdb_type_to_db1_type(type)
/* Should never get here thanks to test in smdb_db_open() */
return DB_HASH;
}
- /*
+/*
** SMDB_PUT_FLAGS_TO_DB1_FLAGS -- Translates smdb put flags to db1 put flags.
**
** Parameters:
@@ -90,7 +90,7 @@ smdb_put_flags_to_db1_flags(flags)
return return_flags;
}
- /*
+/*
** SMDB_CURSOR_GET_FLAGS_TO_SMDB1
**
** Parameters:
@@ -151,16 +151,18 @@ int
smdb1_close(database)
SMDB_DATABASE *database;
{
+ int result;
SMDB_DB1_DATABASE *db1 = (SMDB_DB1_DATABASE *) database->smdb_impl;
DB *db = ((SMDB_DB1_DATABASE *) database->smdb_impl)->smdb1_db;
+ result = db->close(db);
if (db1->smdb1_lock_fd != -1)
(void) close(db1->smdb1_lock_fd);
free(db1);
database->smdb_impl = NULL;
- return db->close(db);
+ return result;
}
int
@@ -395,7 +397,7 @@ smdb1_cursor(database, cursor, flags)
return SMDBE_OK;
}
- /*
+/*
** SMDB_DB_OPEN -- Opens a db1 database.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libsmdb/smdb2.c b/gnu/usr.sbin/sendmail/libsmdb/smdb2.c
index f4c3b17db1f..57f58d1fe61 100644
--- a/gnu/usr.sbin/sendmail/libsmdb/smdb2.c
+++ b/gnu/usr.sbin/sendmail/libsmdb/smdb2.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: smdb2.c,v 8.65 2001/05/10 01:23:58 ca Exp $")
+SM_RCSID("@(#)$Sendmail: smdb2.c,v 8.69 2001/09/12 21:19:12 gshapiro Exp $")
#include <fcntl.h>
#include <stdlib.h>
@@ -29,7 +29,7 @@ struct smdb_db2_database
};
typedef struct smdb_db2_database SMDB_DB2_DATABASE;
- /*
+/*
** SMDB_TYPE_TO_DB2_TYPE -- Translates smdb database type to db2 type.
**
** Parameters:
@@ -56,7 +56,7 @@ smdb_type_to_db2_type(type)
return DB_UNKNOWN;
}
- /*
+/*
** DB2_ERROR_TO_SMDB -- Translates db2 errors to smdbe errors
**
** Parameters:
@@ -139,7 +139,7 @@ db2_error_to_smdb(error)
}
return result;
}
- /*
+/*
** SMDB_PUT_FLAGS_TO_DB2_FLAGS -- Translates smdb put flags to db2 put flags.
**
** Parameters:
@@ -166,7 +166,7 @@ smdb_put_flags_to_db2_flags(flags)
return return_flags;
}
- /*
+/*
** SMDB_CURSOR_GET_FLAGS_TO_DB2 -- Translates smdb cursor get flags to db2
** getflags.
**
@@ -225,16 +225,18 @@ int
smdb2_close(database)
SMDB_DATABASE *database;
{
+ int result;
SMDB_DB2_DATABASE *db2 = (SMDB_DB2_DATABASE *) database->smdb_impl;
DB *db = ((SMDB_DB2_DATABASE *) database->smdb_impl)->smdb2_db;
+ result = db2_error_to_smdb(db->close(db, 0));
if (db2->smdb2_lock_fd != -1)
close(db2->smdb2_lock_fd);
free(db2);
database->smdb_impl = NULL;
- return db2_error_to_smdb(db->close(db, 0));
+ return result;
}
int
@@ -530,7 +532,7 @@ smdb_db_open_internal(db_name, db_type, db_flags, db_params, db)
return db2_error_to_smdb(result);
}
# endif /* DB_VERSION_MAJOR > 2 */
- /*
+/*
** SMDB_DB_OPEN -- Opens a db database.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libsmdb/smndbm.c b/gnu/usr.sbin/sendmail/libsmdb/smndbm.c
index 388936e93ea..b5b3934039d 100644
--- a/gnu/usr.sbin/sendmail/libsmdb/smndbm.c
+++ b/gnu/usr.sbin/sendmail/libsmdb/smndbm.c
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: smndbm.c,v 8.47 2001/05/10 01:23:58 ca Exp $")
+SM_RCSID("@(#)$Sendmail: smndbm.c,v 8.50 2001/09/11 04:04:53 gshapiro Exp $")
#include <fcntl.h>
#include <stdlib.h>
@@ -37,7 +37,7 @@ struct smdb_dbm_cursor_struct
};
typedef struct smdb_dbm_cursor_struct SMDB_DBM_CURSOR;
- /*
+/*
** SMDB_PUT_FLAGS_TO_NDBM_FLAGS -- Translates smdb put flags to ndbm put flags.
**
** Parameters:
@@ -455,7 +455,7 @@ smdbm_cursor(database, cursor, flags)
return SMDBE_OK;
}
- /*
+/*
** SMDB_NDBM_OPEN -- Opens a ndbm database.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libsmutil/cf.c b/gnu/usr.sbin/sendmail/libsmutil/cf.c
index 6d4f000ba65..337ac80e8ae 100644
--- a/gnu/usr.sbin/sendmail/libsmutil/cf.c
+++ b/gnu/usr.sbin/sendmail/libsmutil/cf.c
@@ -9,7 +9,7 @@
*/
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: cf.c,v 8.14 2001/05/02 00:42:46 ca Exp $")
+SM_RCSID("@(#)$Sendmail: cf.c,v 8.16 2001/09/11 04:04:55 gshapiro Exp $")
#include <sendmail/pathnames.h>
/*
diff --git a/gnu/usr.sbin/sendmail/libsmutil/debug.c b/gnu/usr.sbin/sendmail/libsmutil/debug.c
index b043c0e1715..012a1e683fe 100644
--- a/gnu/usr.sbin/sendmail/libsmutil/debug.c
+++ b/gnu/usr.sbin/sendmail/libsmutil/debug.c
@@ -10,6 +10,6 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: debug.c,v 8.7 2001/06/27 21:46:54 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: debug.c,v 8.9 2001/09/11 04:04:55 gshapiro Exp $")
unsigned char tTdvect[100]; /* trace vector */
diff --git a/gnu/usr.sbin/sendmail/libsmutil/err.c b/gnu/usr.sbin/sendmail/libsmutil/err.c
index 6ae078715dc..449bccdea72 100644
--- a/gnu/usr.sbin/sendmail/libsmutil/err.c
+++ b/gnu/usr.sbin/sendmail/libsmutil/err.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: err.c,v 8.3 2001/01/24 01:27:30 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: err.c,v 8.5 2001/09/11 04:04:55 gshapiro Exp $")
#include <ctype.h>
diff --git a/gnu/usr.sbin/sendmail/libsmutil/lockfile.c b/gnu/usr.sbin/sendmail/libsmutil/lockfile.c
index f72d0fa284b..9b6eb4df596 100644
--- a/gnu/usr.sbin/sendmail/libsmutil/lockfile.c
+++ b/gnu/usr.sbin/sendmail/libsmutil/lockfile.c
@@ -13,10 +13,10 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: lockfile.c,v 8.16 2001/01/24 00:34:54 ca Exp $")
+SM_RCSID("@(#)$Sendmail: lockfile.c,v 8.19 2001/09/11 04:04:55 gshapiro Exp $")
- /*
+/*
** LOCKFILE -- lock a file using flock or (shudder) fcntl locking
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/libsmutil/safefile.c b/gnu/usr.sbin/sendmail/libsmutil/safefile.c
index 9a046038250..fbddc2de527 100644
--- a/gnu/usr.sbin/sendmail/libsmutil/safefile.c
+++ b/gnu/usr.sbin/sendmail/libsmutil/safefile.c
@@ -15,10 +15,10 @@
#include <sm/io.h>
#include <sm/errstring.h>
-SM_RCSID("@(#)$Sendmail: safefile.c,v 8.114 2001/09/08 01:21:03 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: safefile.c,v 8.118 2001/09/18 21:45:27 gshapiro Exp $")
- /*
+/*
** SAFEFILE -- return 0 if a file exists and is safe for a user.
**
** Parameters:
@@ -365,7 +365,7 @@ safefile(fn, uid, gid, user, flags, mode, st)
sm_dprintf("\tEACCES\n");
return EACCES;
}
- /*
+/*
** SAFEDIRPATH -- check to make sure a path to a directory is safe
**
** Safe means not writable and owned by the right folks.
@@ -654,7 +654,7 @@ safedirpath(fn, uid, gid, user, flags, level, offset)
ret == 0 ? "OK" : sm_errstring(ret));
return ret;
}
- /*
+/*
** SAFEOPEN -- do a file open with extra checking
**
** Parameters:
@@ -737,7 +737,7 @@ safeopen(fn, omode, cmode, sff)
}
return fd;
}
- /*
+/*
** SAFEFOPEN -- do a file open with extra checking
**
** Parameters:
@@ -798,7 +798,8 @@ safefopen(fn, omode, cmode, sff)
errno = save_errno;
return NULL;
}
- fp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *) fd, fmode, NULL);
+ fp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
+ (void *) &fd, fmode, NULL);
if (fp != NULL)
return fp;
@@ -812,7 +813,7 @@ safefopen(fn, omode, cmode, sff)
errno = save_errno;
return NULL;
}
- /*
+/*
** FILECHANGED -- check to see if file changed after being opened
**
** Parameters:
@@ -879,7 +880,7 @@ filechanged(fn, fd, stb)
return false;
}
- /*
+/*
** DFOPEN -- determined file open
**
** This routine has the semantics of open, except that it will
diff --git a/gnu/usr.sbin/sendmail/libsmutil/snprintf.c b/gnu/usr.sbin/sendmail/libsmutil/snprintf.c
index 5c6c3d44f34..6d4fbf6956c 100644
--- a/gnu/usr.sbin/sendmail/libsmutil/snprintf.c
+++ b/gnu/usr.sbin/sendmail/libsmutil/snprintf.c
@@ -13,9 +13,9 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: snprintf.c,v 8.41 2001/08/28 23:07:01 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: snprintf.c,v 8.44 2001/09/11 04:04:56 gshapiro Exp $")
- /*
+/*
** SHORTENSTRING -- return short version of a string
**
** If the string is already short, just return it. If it is too
diff --git a/gnu/usr.sbin/sendmail/mail.local/mail.local.c b/gnu/usr.sbin/sendmail/mail.local/mail.local.c
index 4b5b9ce350f..2b10e2f27fc 100644
--- a/gnu/usr.sbin/sendmail/mail.local/mail.local.c
+++ b/gnu/usr.sbin/sendmail/mail.local/mail.local.c
@@ -18,7 +18,7 @@ SM_IDSTR(copyright,
Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: mail.local.c,v 8.232 2001/09/08 01:21:04 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: mail.local.c,v 8.234 2001/09/11 04:04:59 gshapiro Exp $")
#include <stdlib.h>
#include <sm/errstring.h>
diff --git a/gnu/usr.sbin/sendmail/mailstats/mailstats.c b/gnu/usr.sbin/sendmail/mailstats/mailstats.c
index ba5749edea2..52a98b980ae 100644
--- a/gnu/usr.sbin/sendmail/mailstats/mailstats.c
+++ b/gnu/usr.sbin/sendmail/mailstats/mailstats.c
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: mailstats.c,v 8.89 2001/09/04 22:44:22 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: mailstats.c,v 8.91 2001/09/11 04:05:02 gshapiro Exp $")
#include <unistd.h>
#include <stddef.h>
diff --git a/gnu/usr.sbin/sendmail/makemap/makemap.c b/gnu/usr.sbin/sendmail/makemap/makemap.c
index f8c7bc28404..4637e2f4ad7 100644
--- a/gnu/usr.sbin/sendmail/makemap/makemap.c
+++ b/gnu/usr.sbin/sendmail/makemap/makemap.c
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: makemap.c,v 8.170 2001/08/28 23:07:04 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: makemap.c,v 8.173 2001/09/26 22:18:21 ca Exp $")
#include <sys/types.h>
@@ -50,7 +50,7 @@ uid_t TrustedUid = 0;
BITMAP256 DontBlameSendmail;
#define BUFSIZE 1024
-#define ISSEP(c) ((sep == '\0' && isascii(c) && isspace(c)) || (c) == sep)
+#define ISSEP(c) (sep == '\0' ? isascii(c) && isspace(c) : (c) == sep)
static void
usage(progname)
@@ -428,7 +428,7 @@ main(argc, argv)
if (*p != '\0')
*p++ = '\0';
- while (ISSEP(*p))
+ while (*p != '\0' && ISSEP(*p))
p++;
if (!allowempty && *p == '\0')
{
@@ -510,6 +510,7 @@ main(argc, argv)
smdb_free_database(database);
exit(exitstat);
+
/* NOTREACHED */
return exitstat;
}
diff --git a/gnu/usr.sbin/sendmail/praliases/praliases.c b/gnu/usr.sbin/sendmail/praliases/praliases.c
index 7e473a23ae8..5ac7a3fdec0 100644
--- a/gnu/usr.sbin/sendmail/praliases/praliases.c
+++ b/gnu/usr.sbin/sendmail/praliases/praliases.c
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: praliases.c,v 8.91 2001/03/29 21:15:53 rodney Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: praliases.c,v 8.93 2001/09/11 04:05:07 gshapiro Exp $")
#include <sys/types.h>
#include <ctype.h>
diff --git a/gnu/usr.sbin/sendmail/rmail/rmail.c b/gnu/usr.sbin/sendmail/rmail/rmail.c
index 0148124cf26..50339ec4977 100644
--- a/gnu/usr.sbin/sendmail/rmail/rmail.c
+++ b/gnu/usr.sbin/sendmail/rmail/rmail.c
@@ -18,7 +18,7 @@ SM_IDSTR(copyright,
Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: rmail.c,v 8.58 2001/09/04 22:44:31 ca Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: rmail.c,v 8.61 2001/09/18 21:45:29 gshapiro Exp $")
/*
* RMAIL -- UUCP mail server.
@@ -369,7 +369,7 @@ main(argc, argv)
/* NOTREACHED */
}
- if ((fp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *)pdes[1],
+ if ((fp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *) &(pdes[1]),
SM_IO_WRONLY, NULL)) == NULL)
err(EX_OSERR, "sm_io_open failed");
(void) close(pdes[0]);
diff --git a/gnu/usr.sbin/sendmail/sendmail/README b/gnu/usr.sbin/sendmail/sendmail/README
index ef74b7720e6..323935674bf 100644
--- a/gnu/usr.sbin/sendmail/sendmail/README
+++ b/gnu/usr.sbin/sendmail/sendmail/README
@@ -9,7 +9,7 @@
# the sendmail distribution.
#
#
-# $Sendmail: README,v 8.333 2001/09/08 01:21:08 gshapiro Exp $
+# $Sendmail: README,v 8.335 2001/09/24 23:52:12 ca Exp $
#
This directory contains the source files for sendmail(TM).
@@ -251,6 +251,17 @@ USESETEUID Define this to 1 if you have a seteuid(2) system call that
Posix.1. The test program ../test/t_seteuid.c will try
this out on your system. If you define both HASSETREUID
and USESETEUID, the former is ignored.
+HASSETEGID Define this if you have setegid(2) and it can be
+ used to set the saved gid. Please run t_dropgid in
+ test/ if you are not sure whether the call works.
+HASSETREGID Define this if you have setregid(2) and it can be
+ used to set the saved gid. Please run t_dropgid in
+ test/ if you are not sure whether the call works.
+HASSETRESGID Define this if you have setresgid(2) and it can be
+ used to set the saved gid. Please run t_dropgid in
+ test/ if you are not sure whether the call works.
+SM_CONF_CANT_SETRGID Define this if your OS does not have a system
+ call that can set the real gid for a set-group-ID program.
HASLSTAT Define this if you have symbolic links (and thus the
lstat(2) system call). This improves security. Unlike
most other options, this one is on by default, so you
@@ -1664,4 +1675,4 @@ util.c Some general purpose routines used by sendmail.
version.c The version number and information about this
version of sendmail.
-(Version $Revision: 1.9 $, last update $Date: 2001/09/11 19:02:49 $ )
+(Version $Revision: 1.10 $, last update $Date: 2001/10/01 17:18:29 $ )
diff --git a/gnu/usr.sbin/sendmail/sendmail/SECURITY b/gnu/usr.sbin/sendmail/sendmail/SECURITY
index b49a1d5b456..69e0457d796 100644
--- a/gnu/usr.sbin/sendmail/sendmail/SECURITY
+++ b/gnu/usr.sbin/sendmail/sendmail/SECURITY
@@ -5,7 +5,7 @@
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
-# $Sendmail: SECURITY,v 1.46 2001/09/08 01:21:09 gshapiro Exp $
+# $Sendmail: SECURITY,v 1.47 2001/09/23 02:29:05 ca Exp $
#
This file gives some hints how to configure and run sendmail for
@@ -64,12 +64,14 @@ drwx------ root wheel ... /var/spool/mqueue
That is, the owner of sendmail is root, the group is smmsp, and
the binary is set-group-ID. The client mail queue is owned by
smmsp with group smmsp and is group writable. The client mail
-queue directory must be writable by smmsp, in submit.cf the option
-UseMSP must be set, and QueueFileMode must be set to 0660. submit.cf
-is available in cf/cf/, which has been built from cf/cf/submit.mc.
-The file can be used as-is, if you want to add more options,
-use cf/cf/submit.mc as starting point and read cf/README:
-MESSAGE SUBMISSION PROGRAM carefully.
+queue directory must be writable by smmsp, but it must not be
+accessible for others. That is, do not use world read or execute
+permissions. In submit.cf the option UseMSP must be set, and
+QueueFileMode must be set to 0660. submit.cf is available in
+cf/cf/, which has been built from cf/cf/submit.mc. The file can
+be used as-is, if you want to add more options, use cf/cf/submit.mc
+as starting point and read cf/README: MESSAGE SUBMISSION PROGRAM
+carefully.
The .cf file is chosen based on the operation mode. For -bm (default),
-bs, and -t it is submit.cf (if it exists) for all others it is
diff --git a/gnu/usr.sbin/sendmail/sendmail/alias.c b/gnu/usr.sbin/sendmail/sendmail/alias.c
index 609ae197d89..7bf287b2479 100644
--- a/gnu/usr.sbin/sendmail/sendmail/alias.c
+++ b/gnu/usr.sbin/sendmail/sendmail/alias.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: alias.c,v 8.203 2001/09/04 22:43:02 ca Exp $")
+SM_RCSID("@(#)$Sendmail: alias.c,v 8.206 2001/09/11 04:05:11 gshapiro Exp $")
# define SEPARATOR ':'
# define ALIAS_SPEC_SEPARATORS " ,/:"
@@ -23,7 +23,7 @@ static int NAliasFileMaps; /* the number of entries in AliasFileMap */
static char *aliaslookup __P((char *, int *));
- /*
+/*
** ALIAS -- Compute aliases.
**
** Scans the alias file for an alias for the given address.
@@ -183,7 +183,7 @@ alias(a, sendq, aliaslevel, e)
e->e_flags |= EF_SENDRECEIPT;
a->q_flags |= QDELIVERED|QEXPANDED;
}
- /*
+/*
** ALIASLOOKUP -- look up a name in the alias file.
**
** Parameters:
@@ -224,7 +224,7 @@ aliaslookup(name, pstat)
return (*map->map_class->map_lookup)(map, name, NULL, pstat);
}
- /*
+/*
** SETALIAS -- set up an alias map
**
** Called when reading configuration file.
@@ -346,7 +346,7 @@ setalias(spec)
}
}
}
- /*
+/*
** ALIASWAIT -- wait for distinguished @:@ token to appear.
**
** This can decide to reopen or rebuild the alias file
@@ -448,7 +448,7 @@ aliaswait(map, ext, isopen)
map->map_mflags &= ~MF_ALIASWAIT;
return isopen;
}
- /*
+/*
** REBUILDALIASES -- rebuild the alias database.
**
** Parameters:
@@ -582,7 +582,7 @@ rebuildaliases(map, automatic)
# endif /* SIGTSTP */
return success;
}
- /*
+/*
** READALIASES -- read and process the alias file.
**
** This routine implements the part of initaliases that occurs
@@ -833,7 +833,7 @@ readaliases(map, af, announcestats, logstats)
"%s: %ld aliases, longest %ld bytes, %ld bytes total",
map->map_file, naliases, longest, bytes);
}
- /*
+/*
** FORWARD -- Try to forward mail
**
** This is similar but not identical to aliasing.
diff --git a/gnu/usr.sbin/sendmail/sendmail/arpadate.c b/gnu/usr.sbin/sendmail/sendmail/arpadate.c
index c984f3ad125..20808886c0a 100644
--- a/gnu/usr.sbin/sendmail/sendmail/arpadate.c
+++ b/gnu/usr.sbin/sendmail/sendmail/arpadate.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: arpadate.c,v 8.28 2001/02/14 14:45:47 ca Exp $")
+SM_RCSID("@(#)$Sendmail: arpadate.c,v 8.30 2001/09/11 04:05:12 gshapiro Exp $")
/*
** ARPADATE -- Create date in ARPANET format
diff --git a/gnu/usr.sbin/sendmail/sendmail/bf.c b/gnu/usr.sbin/sendmail/sendmail/bf.c
index 69ef0095162..638b478fd7d 100644
--- a/gnu/usr.sbin/sendmail/sendmail/bf.c
+++ b/gnu/usr.sbin/sendmail/sendmail/bf.c
@@ -18,7 +18,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: bf.c,v 8.45 2001/09/04 22:43:02 ca Exp $")
+SM_RCSID("@(#)$Sendmail: bf.c,v 8.47 2001/09/11 04:05:12 gshapiro Exp $")
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/gnu/usr.sbin/sendmail/sendmail/collect.c b/gnu/usr.sbin/sendmail/sendmail/collect.c
index 8471ef42b8c..91b7773185e 100644
--- a/gnu/usr.sbin/sendmail/sendmail/collect.c
+++ b/gnu/usr.sbin/sendmail/sendmail/collect.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: collect.c,v 8.228 2001/09/04 22:43:02 ca Exp $")
+SM_RCSID("@(#)$Sendmail: collect.c,v 8.232 2001/09/11 04:05:12 gshapiro Exp $")
static void collecttimeout __P((time_t));
static void dferror __P((SM_FILE_T *volatile, char *, ENVELOPE *));
@@ -209,7 +209,7 @@ collect_dfopen(e)
if (!setnewqueue(e))
return NULL;
- dfname = queuename(e, 'd');
+ dfname = queuename(e, DATAFL_LETTER);
if (bitset(S_IWGRP, QueueFileMode))
oldumask = umask(002);
df = bfopen(dfname, QueueFileMode, DataFileBufferSize,
@@ -237,7 +237,7 @@ collect_dfopen(e)
return df;
}
- /*
+/*
** COLLECT -- read & parse message header & make temp file.
**
** Creates a temporary file name and copies the standard
@@ -705,7 +705,7 @@ readerr:
struct stat st;
int dfd;
- dfile = queuename(e, 'd');
+ dfile = queuename(e, DATAFL_LETTER);
if (stat(dfile, &st) < 0)
st.st_size = -1;
errno = EEXIST;
@@ -828,7 +828,7 @@ readerr:
if (SuperSafe == SAFE_REALLY && !bitset(EF_FATALERRS, e->e_flags))
{
- char *dfname = queuename(e, 'd');
+ char *dfname = queuename(e, DATAFL_LETTER);
if ((e->e_dfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, dfname,
SM_IO_RDONLY, NULL)) == NULL)
{
@@ -875,7 +875,7 @@ collecttimeout(timeout)
}
errno = save_errno;
}
- /*
+/*
** DFERROR -- signal error on writing the data file.
**
** Called by collect(). Collect() always terminates the process
@@ -904,7 +904,7 @@ dferror(df, msg, e)
{
char *dfname;
- dfname = queuename(e, 'd');
+ dfname = queuename(e, DATAFL_LETTER);
setstat(EX_IOERR);
if (errno == ENOSPC)
{
@@ -967,7 +967,7 @@ dferror(df, msg, e)
"dferror: sm_io_reopen(\"/dev/null\") failed: %s",
sm_errstring(errno));
}
- /*
+/*
** EATFROM -- chew up a UNIX style from line and process
**
** This does indeed make some assumptions about the format
diff --git a/gnu/usr.sbin/sendmail/sendmail/conf.c b/gnu/usr.sbin/sendmail/sendmail/conf.c
index 4f4b7b1fcd8..7d0151adfaa 100644
--- a/gnu/usr.sbin/sendmail/sendmail/conf.c
+++ b/gnu/usr.sbin/sendmail/sendmail/conf.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: conf.c,v 8.907 2001/09/04 22:43:02 ca Exp $")
+SM_RCSID("@(#)$Sendmail: conf.c,v 8.914 2001/09/23 03:05:34 ca Exp $")
#include <sendmail/pathnames.h>
@@ -216,7 +216,7 @@ struct dbsval DontBlameSendmailValues[] =
*/
int DtableSize = 50; /* max open files; reset in 4.2bsd */
- /*
+/*
** SETDEFAULTS -- set default values
**
** Some of these must be initialized using direct code since they
@@ -257,6 +257,9 @@ setdefaults(e)
WkClassFact = 1800L; /* option z */
WkTimeFact = 90000L; /* option Z */
QueueFactor = WkRecipFact * 20; /* option q */
+#if _FFR_QUARANTINE
+ QueueMode = QM_NORMAL; /* what queue items to act upon */
+#endif /* _FFR_QUARANTINE */
FileMode = (RealUid != geteuid()) ? 0644 : 0600;
/* option F */
QueueFileMode = (RealUid != geteuid()) ? 0644 : 0600;
@@ -388,7 +391,7 @@ setdefuser()
sm_dprintf("setdefuser: DefUid=%d, DefUser=%s\n",
(int) DefUid, DefUser);
}
- /*
+/*
** SETUPQUEUES -- initialize default queues
**
** The mqueue QUEUE structure gets filled in after readcf() but
@@ -405,7 +408,7 @@ setupqueues()
(void) sm_strlcpy(buf, "mqueue, P=/var/spool/mqueue", sizeof buf);
makequeue(buf, false);
}
- /*
+/*
** SETUPMAILERS -- initialize default mailers
*/
@@ -427,7 +430,7 @@ setupmailers()
makemailer(buf);
initerrmailers();
}
- /*
+/*
** SETUPMAPS -- set up map classes
*/
@@ -618,7 +621,7 @@ setupmaps()
}
#undef MAPDEF
- /*
+/*
** INITHOSTMAPS -- initial host-dependent maps
**
** This should act as an interface to any local service switch
@@ -821,7 +824,7 @@ inithostmaps()
}
#endif /* 0 */
}
- /*
+/*
** SWITCH_MAP_FIND -- find the list of types associated with a map
**
** This is the system-dependent interface to the service switch.
@@ -1100,7 +1103,7 @@ switch_map_find(service, maptype, mapreturn)
return -1;
#endif /* !defined(_USE_SUN_NSSWITCH_) */
}
- /*
+/*
** USERNAME -- return the user id of the logged in user.
**
** Parameters:
@@ -1157,7 +1160,7 @@ username()
}
return myname;
}
- /*
+/*
** TTYPATH -- Get the path of the user's tty
**
** Returns the pathname of the user's tty. Returns NULL if
@@ -1211,7 +1214,7 @@ ttypath()
/* looks good */
return pathn;
}
- /*
+/*
** CHECKCOMPAT -- check for From and To person compatible.
**
** This routine can be supplied on a per-installation basis
@@ -1264,7 +1267,7 @@ checkcompat(to, e)
#endif /* EXAMPLE_CODE */
return EX_OK;
}
- /*
+/*
** INIT_MD -- do machine dependent initializations
**
** Systems that have global modes that should be set should do
@@ -1327,7 +1330,7 @@ init_md(argc, argv)
VendorCode = VENDOR_BERKELEY;
#endif /* VENDOR_DEFAULT */
}
- /*
+/*
** INIT_VENDOR_MACROS -- vendor-dependent macro initializations
**
** Called once, on startup.
@@ -1347,7 +1350,7 @@ init_vendor_macros(e)
register ENVELOPE *e;
{
}
- /*
+/*
** GETLA -- get the current load average
**
** This code stolen from la.c.
@@ -2054,7 +2057,7 @@ int getloadavg( call_data )
return 0;
}
#endif /* apollo */
- /*
+/*
** SM_GETLA -- get the current load average
**
** Parameters:
@@ -2077,7 +2080,7 @@ sm_getla()
(void) sm_snprintf(labuf, sizeof labuf, "%d", CurrentLA);
macdefine(&GlobalMacros, A_TEMP, macid("{load_avg}"), labuf);
}
- /*
+/*
** SHOULDQUEUE -- should this message be queued or sent?
**
** Compares the message cost to the load average to decide.
@@ -2128,7 +2131,7 @@ shouldqueue(pri, ct)
sm_dprintf("%s (by calculation)\n", rval ? "true" : "false");
return rval;
}
- /*
+/*
** REFUSECONNECTIONS -- decide if connections should be refused
**
** Parameters:
@@ -2233,7 +2236,7 @@ refuseconnections(name, e, d, active)
}
return false;
}
- /*
+/*
** SETPROCTITLE -- set process title for ps
**
** Parameters:
@@ -2465,7 +2468,7 @@ 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
@@ -2514,7 +2517,7 @@ sm_setproctitle(status, e, fmt, va_alist)
else
setproctitle("%s", buf);
}
- /*
+/*
** WAITFOR -- wait for a particular process id.
**
** Parameters:
@@ -2564,7 +2567,7 @@ waitfor(pid)
return st;
# endif /* WAITUNION */
}
- /*
+/*
** SM_WAIT -- wait
**
** Parameters:
@@ -2603,7 +2606,7 @@ sm_wait(status)
# endif /* WAITUNION */
return i;
}
- /*
+/*
** REAPCHILD -- pick up the body of my child, lest it become a zombie
**
** Parameters:
@@ -2626,7 +2629,8 @@ SIGFUNC_DECL
reapchild(sig)
int sig;
{
- int m = 0, pld, wgrp;
+ int m = 0;
+ int pld, wgrp;
int save_errno = errno;
int st;
pid_t pid;
@@ -2685,7 +2689,7 @@ reapchild(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** GETDTABLESIZE -- return number of file descriptors
**
** Only on non-BSD systems
@@ -2724,7 +2728,7 @@ getdtsize()
# endif /* _SC_OPEN_MAX */
# endif /* HASGETDTABLESIZE */
}
- /*
+/*
** UNAME -- get the UUCP name of this system.
*/
@@ -2793,7 +2797,7 @@ uname(name)
return -1;
}
#endif /* !HASUNAME */
- /*
+/*
** INITGROUPS -- initialize groups
**
** Stub implementation for System V style systems
@@ -2809,7 +2813,7 @@ initgroups(name, basegid)
}
#endif /* !HASINITGROUPS */
- /*
+/*
** SETGROUPS -- set group list
**
** Stub implementation for systems that don't have group lists
@@ -2826,7 +2830,7 @@ setgroups(ngroups, grouplist)
}
#endif /* ! NGROUPS_MAX */
- /*
+/*
** SETSID -- set session id (for non-POSIX systems)
*/
@@ -2853,7 +2857,7 @@ setsid __P ((void))
}
#endif /* !HASSETSID */
- /*
+/*
** FSYNC -- dummy fsync
*/
@@ -2871,7 +2875,7 @@ fsync(fd)
}
#endif /* NEEDFSYNC */
- /*
+/*
** DGUX_INET_ADDR -- inet_addr for DG/UX
**
** Data General DG/UX version of inet_addr returns a struct in_addr
@@ -2894,7 +2898,7 @@ dgux_inet_addr(host)
}
#endif /* DGUX_5_4_2 */
- /*
+/*
** GETOPT -- for old systems or systems with bogus implementations
*/
@@ -2985,7 +2989,7 @@ getopt(nargc,nargv,ostr)
}
#endif /* !SM_CONF_GETOPT */
- /*
+/*
** USERSHELLOK -- tell if a user's shell is ok for unrestricted use
**
** Parameters:
@@ -3161,7 +3165,7 @@ usershellok(user, shell)
return false;
# endif /* HASGETUSERSHELL */
}
- /*
+/*
** FREEDISKSPACE -- see how much free space is on the queue filesystem
**
** Only implemented if you have statfs.
@@ -3268,7 +3272,7 @@ freediskspace(dir, bsize)
# endif /* SFS_TYPE != SFS_NONE */
return -1;
}
- /*
+/*
** ENOUGHDISKSPACE -- is there enough free space on the queue file systems?
**
** Parameters:
@@ -3309,7 +3313,7 @@ enoughdiskspace(msize, e)
}
return true;
}
- /*
+/*
** TRANSIENTERROR -- tell if an error code indicates a transient failure
**
** This looks at an errno value and tells if this is likely to
@@ -3414,7 +3418,7 @@ transienterror(err)
/* nope, must be permanent */
return false;
}
- /*
+/*
** LOCKFILE -- lock a file using flock or (shudder) fcntl locking
**
** Parameters:
@@ -3542,7 +3546,7 @@ lockfile(fd, filename, ext, type)
errno = save_errno;
return false;
}
- /*
+/*
** CHOWNSAFE -- tell if chown is "safe" (executable only by root)
**
** Unfortunately, given that we can't predict other systems on which
@@ -3629,7 +3633,7 @@ chownsafe(fd, safedir)
return bitnset(DBS_ASSUMESAFECHOWN, DontBlameSendmail);
# endif /* (!defined(_POSIX_CHOWN_RESTRICTED) || _POSIX_CHOWN_RESTRICTED != -1) && ... */
}
- /*
+/*
** RESETLIMITS -- reset system controlled resource limits
**
** This is to avoid denial-of-service attacks
@@ -3672,7 +3676,7 @@ resetlimits()
#endif /* HASSETRLIMIT */
errno = 0;
}
- /*
+/*
** SETVENDOR -- process vendor code from V configuration line
**
** Parameters:
@@ -3719,7 +3723,7 @@ setvendor(vendor)
return false;
}
- /*
+/*
** GETVENDOR -- return vendor name based on vendor code
**
** Parameters:
@@ -3765,7 +3769,7 @@ getvendor(vendorcode)
return "Unknown";
}
}
- /*
+/*
** VENDOR_PRE_DEFAULTS, VENDOR_POST_DEFAULTS -- set vendor-specific defaults
**
** Vendor_pre_defaults is called before reading the configuration
@@ -3820,7 +3824,7 @@ vendor_post_defaults(e)
sun_post_defaults(e);
#endif /* defined(SUN_EXTENSIONS) && defined(SUN_DEFAULT_VALUES) */
}
- /*
+/*
** VENDOR_DAEMON_SETUP -- special vendor setup needed for daemon mode
*/
@@ -3839,7 +3843,7 @@ vendor_daemon_setup(e)
}
#endif /* SECUREWARE */
}
- /*
+/*
** VENDOR_SET_UID -- do setup for setting a user id
**
** This is called when we are still root.
@@ -3868,7 +3872,7 @@ vendor_set_uid(uid)
(void) setup_secure(uid);
#endif /* SECUREWARE */
}
- /*
+/*
** VALIDATE_CONNECTION -- check connection for rationality
**
** If the connection is rejected, this routine should log an
@@ -3954,7 +3958,7 @@ validate_connection(sap, hostname, e)
return NULL;
}
- /*
+/*
** STRTOL -- convert string to long integer
**
** For systems that don't have it in the C library.
@@ -4057,7 +4061,7 @@ strtol(nptr, endptr, base)
}
#endif /* NEEDSTRTOL */
- /*
+/*
** STRSTR -- find first substring in string
**
** Parameters:
@@ -4094,7 +4098,7 @@ strstr(big, little)
}
#endif /* NEEDSTRSTR */
- /*
+/*
** SM_GETHOSTBY{NAME,ADDR} -- compatibility routines for gethostbyXXX
**
** Some operating systems have wierd problems with the gethostbyXXX
@@ -4359,7 +4363,7 @@ sm_gethostbyaddr(addr, len, type)
#endif /* (SOLARIS > 10000 && SOLARIS < 20400) || (defined(SOLARIS) && SOLARIS < 204) */
return hp;
}
- /*
+/*
** SM_GETPW{NAM,UID} -- wrapper for getpwnam and getpwuid
*/
@@ -4388,7 +4392,7 @@ sm_getpwuid(uid)
return getpwuid(uid);
#endif /* defined(_AIX4) && 0 */
}
- /*
+/*
** SECUREWARE_SETUP_SECURE -- Convex SecureWare setup
**
** Set up the trusted computing environment for C2 level security
@@ -4454,7 +4458,7 @@ secureware_setup_secure(uid)
}
}
#endif /* SECUREWARE */
- /*
+/*
** ADD_HOSTNAMES -- Add a hostname to class 'w' based on IP address
**
** Add hostnames to class 'w' based on the IP address read from
@@ -4568,7 +4572,7 @@ add_hostnames(sa)
#endif /* NETINET6 */
return 0;
}
- /*
+/*
** LOAD_IF_NAMES -- load interface-specific names into $=w
**
** Parameters:
@@ -4991,7 +4995,7 @@ load_if_names()
# endif /* defined(SIOCGIFCONF) && !SIOCGIFCONF_IS_BROKEN */
# endif /* NETINET6 && defined(SIOCGLIFCONF) */
}
- /*
+/*
** ISLOOPBACK -- is socket address in the loopback net?
**
** Parameters:
@@ -5018,7 +5022,7 @@ isloopback(sa)
#endif /* NETINET6 */
return false;
}
- /*
+/*
** GET_NUM_PROCS_ONLINE -- return the number of processors currently online
**
** Parameters:
@@ -5061,7 +5065,7 @@ get_num_procs_online()
nproc = 1;
return nproc;
}
- /*
+/*
** SEED_RANDOM -- seed the random number generator
**
** Parameters:
@@ -5091,7 +5095,7 @@ seed_random()
# endif /* HASRANDOM */
#endif /* HASSRANDOMDEV */
}
- /*
+/*
** SM_SYSLOG -- syslog wrapper to keep messages under SYSLOG_BUFSIZE
**
** Parameters:
@@ -5256,7 +5260,7 @@ sm_syslog(level, id, fmt, va_alist)
buf = NULL;
errno = save_errno;
}
- /*
+/*
** HARD_SYSLOG -- call syslog repeatedly until it works
**
** Needed on HP-UX, which apparently doesn't guarantee that
@@ -5300,7 +5304,7 @@ hard_syslog(pri, msg, va_alist)
# undef CAST
#endif /* defined(__hpux) && !defined(HPUX11) */
#if NEEDLOCAL_HOSTNAME_LENGTH
- /*
+/*
** LOCAL_HOSTNAME_LENGTH
**
** This is required to get sendmail to compile against BIND 4.9.x
@@ -5331,7 +5335,7 @@ local_hostname_length(hostname)
}
#endif /* NEEDLOCAL_HOSTNAME_LENGTH */
- /*
+/*
** Compile-Time options
*/
@@ -5514,9 +5518,18 @@ char *OsCompileOptions[] =
#if HASRANDOM
"HASRANDOM",
#endif /* HASRANDOM */
+#if HASSETEGID
+ "HASSETEGID",
+#endif /* HASSETEGID */
#if HASSETLOGIN
"HASSETLOGIN",
#endif /* HASSETLOGIN */
+#if HASSETREGID
+ "HASSETREGID",
+#endif /* HASSETREGID */
+#if HASSETRESGID
+ "HASSETRESGID",
+#endif /* HASSETRESGID */
#if HASSETREUID
"HASSETREUID",
#endif /* HASSETREUID */
@@ -5720,6 +5733,9 @@ char *FFRCompileOptions[] =
#if _FFR_NO_PIPE
"_FFR_NO_PIPE",
#endif /* _FFR_NO_PIPE */
+#if _FFR_QUARANTINE
+ "_FFR_QUARANTINE",
+#endif /* _FFR_QUARANTINE */
#if _FFR_QUEUEDELAY
"_FFR_QUEUEDELAY",
#endif /* _FFR_QUEUEDELAY */
diff --git a/gnu/usr.sbin/sendmail/sendmail/conf.h b/gnu/usr.sbin/sendmail/sendmail/conf.h
index fab43849ca3..4b2027ae272 100644
--- a/gnu/usr.sbin/sendmail/sendmail/conf.h
+++ b/gnu/usr.sbin/sendmail/sendmail/conf.h
@@ -10,7 +10,7 @@
* the sendmail distribution.
*
*
- * $Sendmail: conf.h,v 8.555 2001/09/03 17:21:30 gshapiro Exp $
+ * $Sendmail: conf.h,v 8.556 2001/09/21 23:01:46 ca Exp $
*/
/*
diff --git a/gnu/usr.sbin/sendmail/sendmail/control.c b/gnu/usr.sbin/sendmail/sendmail/control.c
index 31409f7f9c7..e71bd917269 100644
--- a/gnu/usr.sbin/sendmail/sendmail/control.c
+++ b/gnu/usr.sbin/sendmail/sendmail/control.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: control.c,v 8.110 2001/08/27 16:59:13 ca Exp $")
+SM_RCSID("@(#)$Sendmail: control.c,v 8.115 2001/09/21 22:20:40 ca Exp $")
/* values for cmd_code */
#define CMDERROR 0 /* bad command */
@@ -46,7 +46,7 @@ static struct cmd CmdTab[] =
int ControlSocket = -1;
- /*
+/*
** OPENCONTROLSOCKET -- create/open the daemon control named socket
**
** Creates and opens a named socket for external control over
@@ -150,7 +150,7 @@ opencontrolsocket()
# endif /* NETUNIX */
return 0;
}
- /*
+/*
** CLOSECONTROLSOCKET -- close the daemon control named socket
**
** Close a named socket.
@@ -198,7 +198,7 @@ closecontrolsocket(fullclose)
# endif /* NETUNIX */
return;
}
- /*
+/*
** CLRCONTROL -- reset the control connection
**
** Parameters:
@@ -220,7 +220,7 @@ clrcontrol()
ControlSocket = -1;
# endif /* NETUNIX */
}
- /*
+/*
** CONTROL_COMMAND -- read and process command from named socket
**
** Read and process the command from the opened socket.
@@ -283,8 +283,8 @@ control_command(sock, e)
TimeOuts.to_control);
}
- s = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *) sock, SM_IO_RDWR,
- NULL);
+ s = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *) &sock,
+ SM_IO_RDWR, NULL);
if (s == NULL)
{
int save_errno = errno;
diff --git a/gnu/usr.sbin/sendmail/sendmail/convtime.c b/gnu/usr.sbin/sendmail/sendmail/convtime.c
index ae2064f243e..aaf50f2207f 100644
--- a/gnu/usr.sbin/sendmail/sendmail/convtime.c
+++ b/gnu/usr.sbin/sendmail/sendmail/convtime.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: convtime.c,v 8.36 2001/02/13 22:32:08 ca Exp $")
+SM_RCSID("@(#)$Sendmail: convtime.c,v 8.39 2001/09/11 04:05:13 gshapiro Exp $")
/*
** CONVTIME -- convert time
@@ -98,7 +98,7 @@ convtime(p, units)
return pos ? r : -r;
}
- /*
+/*
** PINTVL -- produce printable version of a time interval
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/daemon.c b/gnu/usr.sbin/sendmail/sendmail/daemon.c
index 9697f7a1563..d137c878bf6 100644
--- a/gnu/usr.sbin/sendmail/sendmail/daemon.c
+++ b/gnu/usr.sbin/sendmail/sendmail/daemon.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: daemon.c,v 8.588 2001/09/05 15:08:00 ca Exp $")
+SM_RCSID("@(#)$Sendmail: daemon.c,v 8.595 2001/09/25 05:03:54 gshapiro Exp $")
#if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__)
# define USE_SOCK_STREAM 1
@@ -121,7 +121,7 @@ static int NDaemons = 0; /* actual number of daemons */
static time_t NextDiskSpaceCheck = 0;
- /*
+/*
** GETREQUESTS -- open mail IPC port and get requests.
**
** Parameters:
@@ -759,14 +759,15 @@ getrequests(e)
if ((inchannel = sm_io_open(SmFtStdiofd,
SM_TIME_DEFAULT,
- (void *) t,
- SM_IO_RDONLY, NULL)) == NULL
- || (t = dup(t)) < 0 ||
+ (void *) &t,
+ SM_IO_RDONLY,
+ NULL)) == NULL ||
+ (t = dup(t)) < 0 ||
(outchannel = sm_io_open(SmFtStdiofd,
SM_TIME_DEFAULT,
- (void *) t,
- SM_IO_WRONLY, NULL))
- == NULL)
+ (void *) &t,
+ SM_IO_WRONLY,
+ NULL)) == NULL)
{
syserr("cannot open SMTP server channel, fd=%d",
t);
@@ -972,7 +973,7 @@ getrequests_checkdiskspace(e)
NextDiskSpaceCheck = now + 60;
}
- /*
+/*
** OPENDAEMONSOCKET -- open SMTP socket
**
** Deals with setting all appropriate options.
@@ -1166,7 +1167,7 @@ opendaemonsocket(d, firsttime)
/* NOTREACHED */
return -1; /* avoid compiler warning on IRIX */
}
- /*
+/*
** SETUPDAEMON -- setup socket for daemon
**
** Parameters:
@@ -1258,7 +1259,7 @@ setupdaemon(daemonaddr)
}
return port;
}
- /*
+/*
** CLRDAEMON -- reset the daemon connection
**
** Parameters:
@@ -1284,7 +1285,7 @@ clrdaemon()
}
}
- /*
+/*
** GETMODIFIERS -- get modifier flags
**
** Parameters:
@@ -1308,12 +1309,21 @@ getmodifiers(v, modifiers)
/* maximum length of flags: upper case Option -> "OO " */
l = 3 * strlen(v) + 3;
+
+ /* is someone joking? */
+ if (l < 0 || l > 256)
+ {
+ if (LogLevel > 2)
+ sm_syslog(LOG_ERR, NOQID,
+ "getmodifiers too long, ignored");
+ return NULL;
+ }
flags = xalloc(l);
f = flags;
clrbitmap(modifiers);
for (h = v; *h != '\0'; h++)
{
- if (!(isascii(*h) && isspace(*h)))
+ if (isascii(*h) && !isspace(*h) && isprint(*h))
{
setbitn(*h, modifiers);
if (flags != f)
@@ -1327,7 +1337,7 @@ getmodifiers(v, modifiers)
return f;
}
- /*
+/*
** CHKDAEMONMODIFIERS -- check whether all daemons have set a flag.
**
** Parameters:
@@ -1349,7 +1359,7 @@ chkdaemonmodifiers(flag)
return true;
}
- /*
+/*
** SETSOCKADDROPTIONS -- set options for SOCKADDR (daemon or client)
**
** Parameters:
@@ -1665,7 +1675,7 @@ setsockaddroptions(p, d)
}
}
}
- /*
+/*
** SETDAEMONOPTIONS -- set options for running the MTA daemon
**
** Parameters:
@@ -1720,7 +1730,7 @@ setdaemonoptions(p)
++NDaemons;
return true;
}
- /*
+/*
** INITDAEMON -- initialize daemon if not yet done.
**
** Parameters:
@@ -1744,7 +1754,7 @@ initdaemon()
NDaemons = 1;
}
}
- /*
+/*
** SETCLIENTOPTIONS -- set options for running the client
**
** Parameters:
@@ -1780,7 +1790,7 @@ setclientoptions(p)
ClientSettings[family].d_name = newstr(num);
}
}
- /*
+/*
** ADDR_FAMILY -- determine address family from address
**
** Parameters:
@@ -1832,7 +1842,7 @@ addr_family(addr)
return AF_UNSPEC;
}
- /*
+/*
** CHKCLIENTMODIFIERS -- check whether all clients have set a flag.
**
** Parameters:
@@ -1864,7 +1874,7 @@ chkclientmodifiers(flag)
#if MILTER
# if _FFR_MILTER_PERDAEMON
- /*
+/*
** SETUP_DAEMON_FILTERS -- Parse per-socket filters
**
** Parameters:
@@ -1897,7 +1907,7 @@ setup_daemon_milters()
}
# endif /* _FFR_MILTER_PERDAEMON */
#endif /* MILTER */
- /*
+/*
** MAKECONNECTION -- make a connection to an SMTP socket on a machine.
**
** Parameters:
@@ -1930,7 +1940,7 @@ makeconnection(host, port, mci, e, enough)
time_t enough;
{
register volatile int addrno = 0;
- register volatile int s;
+ volatile int s;
register struct hostent *volatile hp = (struct hostent *) NULL;
SOCKADDR addr;
SOCKADDR clt_addr;
@@ -2167,13 +2177,33 @@ gothostent:
{
#if NAMED_BIND
/* check for name server timeouts */
- if (errno == ETIMEDOUT || h_errno == TRY_AGAIN ||
- (errno == ECONNREFUSED && UseNameServer))
+# if NETINET6
+ if (WorkAroundBrokenAAAA && family == AF_INET6 &&
+ errno == ETIMEDOUT)
{
- save_errno = errno;
- mci_setstat(mci, EX_TEMPFAIL, "4.4.3", NULL);
- errno = save_errno;
- return EX_TEMPFAIL;
+ /*
+ ** An attempt with family AF_INET may
+ ** succeed By skipping the next section
+ ** of code, we will try AF_INET before
+ ** failing.
+ */
+
+ if (tTd(16, 10))
+ sm_dprintf("makeconnection: WorkAroundBrokenAAAA: Trying AF_INET lookup (AF_INET6 failed)\n");
+ }
+ else
+# endif /* NETINET6 */
+ {
+ if (errno == ETIMEDOUT ||
+ h_errno == TRY_AGAIN ||
+ (errno == ECONNREFUSED && UseNameServer))
+ {
+ save_errno = errno;
+ mci_setstat(mci, EX_TEMPFAIL,
+ "4.4.3", NULL);
+ errno = save_errno;
+ return EX_TEMPFAIL;
+ }
}
#endif /* NAMED_BIND */
#if NETINET6
@@ -2325,7 +2355,7 @@ gothostent:
if (tTd(16, 1))
sm_dprintf("makeconnection (%s [%s].%d (%d))\n",
host, anynet_ntoa(&addr), ntohs(port),
- addr.sa.sa_family);
+ (int) addr.sa.sa_family);
/* save for logging */
CurHostAddr = addr;
@@ -2583,10 +2613,12 @@ nextaddr:
/* connection ok, put it into canonical form */
mci->mci_out = NULL;
- if ((mci->mci_out = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *) s,
+ if ((mci->mci_out = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
+ (void *) &s,
SM_IO_WRONLY, NULL)) == NULL ||
(s = dup(s)) < 0 ||
- (mci->mci_in = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *) s,
+ (mci->mci_in = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
+ (void *) &s,
SM_IO_RDONLY, NULL)) == NULL)
{
save_errno = errno;
@@ -2672,7 +2704,7 @@ connecttimeout()
errno = ETIMEDOUT;
longjmp(CtxConnectTimeout, 1);
}
- /*
+/*
** MAKECONNECTION_DS -- make a connection to a domain socket.
**
** Parameters:
@@ -2753,11 +2785,11 @@ makeconnection_ds(mux_path, mci)
/* connection ok, put it into canonical form */
mci->mci_out = NULL;
if ((mci->mci_out = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) sock, SM_IO_WRONLY, NULL))
+ (void *) &sock, SM_IO_WRONLY, NULL))
== NULL
|| (sock = dup(sock)) < 0 ||
(mci->mci_in = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) sock, SM_IO_RDONLY, NULL))
+ (void *) &sock, SM_IO_RDONLY, NULL))
== NULL)
{
save_errno = errno;
@@ -2776,7 +2808,7 @@ makeconnection_ds(mux_path, mci)
return EX_OK;
}
#endif /* NETUNIX */
- /*
+/*
** SHUTDOWN_DAEMON -- Performs a clean shutdown of the daemon
**
** Parameters:
@@ -2812,7 +2844,7 @@ shutdown_daemon()
finis(false, EX_OK);
}
- /*
+/*
** RESTART_DAEMON -- Performs a clean restart of the daemon
**
** Parameters:
@@ -2938,7 +2970,7 @@ restart_daemon()
finis(false, EX_OSFILE);
/* NOTREACHED */
}
- /*
+/*
** MYHOSTNAME -- return the name of this host.
**
** Parameters:
@@ -3041,7 +3073,7 @@ myhostname(hostbuf, size)
}
return hp;
}
- /*
+/*
** ADDRCMP -- compare two host addresses
**
** Parameters:
@@ -3090,7 +3122,7 @@ addrcmp(hp, ha, sa)
}
return -1;
}
- /*
+/*
** GETAUTHINFO -- get the real host name associated with a file descriptor
**
** Uses RFC1413 protocol to try to get info from the other end.
@@ -3612,7 +3644,7 @@ postipsr:
sm_dprintf("getauthinfo: %s\n", hbuf);
return hbuf;
}
- /*
+/*
** HOST_MAP_LOOKUP -- turn a hostname into canonical form
**
** Parameters:
@@ -3861,7 +3893,7 @@ host_map_lookup(map, name, av, statp)
s->s_namecanon.nc_stat = *statp;
return NULL;
}
- /*
+/*
** HOST_MAP_INIT -- initialize host class structures
**
** Parameters:
@@ -3943,7 +3975,7 @@ host_map_init(map, args)
map->map_tapp = newstr(map->map_tapp);
return true;
}
-
+
#if NETINET6
/*
** ANYNET_NTOP -- convert an IPv6 network address to printable form.
@@ -3992,7 +4024,7 @@ anynet_ntop(s6a, dst, dst_len)
return ap;
}
- /*
+/*
** ANYNET_PTON -- convert printed form to network address.
**
** Wrapper for inet_pton() which handles IPv6: labels.
@@ -4019,7 +4051,7 @@ anynet_pton(family, src, dst)
return inet_pton(family, src, dst);
}
#endif /* NETINET6 */
- /*
+/*
** ANYNET_NTOA -- convert a network address to printable form.
**
** Parameters:
@@ -4100,7 +4132,7 @@ anynet_ntoa(sap)
*--bp = '\0';
return buf;
}
- /*
+/*
** HOSTNAMEBYANYADDR -- return name of host based on address
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/deliver.c b/gnu/usr.sbin/sendmail/sendmail/deliver.c
index 6bd1e8143fd..1fecda16ced 100644
--- a/gnu/usr.sbin/sendmail/sendmail/deliver.c
+++ b/gnu/usr.sbin/sendmail/sendmail/deliver.c
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <sys/time.h>
-SM_RCSID("@(#)$Sendmail: deliver.c,v 8.899 2001/09/08 01:21:09 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: deliver.c,v 8.907 2001/09/18 21:45:33 gshapiro Exp $")
#if HASSETUSERCONTEXT
# include <login_cap.h>
@@ -354,6 +354,17 @@ sendall(e, mode)
q->q_state = QS_QUEUEUP;
expensive = true;
}
+#if _FFR_QUARANTINE
+ else if (QueueMode != QM_HELD &&
+ e->e_holdmsg != NULL)
+ {
+ if (tTd(13, 30))
+ sm_dprintf(" ... quarantine: %s\n",
+ e->e_holdmsg);
+ q->q_state = QS_QUEUEUP;
+ expensive = true;
+ }
+#endif /* _FFR_QUARANTINE */
else
{
if (tTd(13, 30))
@@ -435,7 +446,7 @@ sendall(e, mode)
}
if (mode != SM_VERIFY && bitset(EF_HAS_DF, e->e_flags))
- dup_queue_file(e, ee, 'd');
+ dup_queue_file(e, ee, DATAFL_LETTER);
/*
** Give the split envelope access to the parent
@@ -903,7 +914,7 @@ sendenvelope(e, mode)
}
#if REQUIRES_DIR_FSYNC
- /*
+/*
** SYNC_DIR -- fsync a directory based on a filename
**
** Parameters:
@@ -954,13 +965,13 @@ sync_dir(filename, panic)
}
}
#endif /* REQUIRES_DIR_FSYNC */
- /*
+/*
** DUP_QUEUE_FILE -- duplicate a queue file into a split queue
**
** Parameters:
** e -- the existing envelope
** ee -- the new envelope
-** type -- the queue file type (e.g., 'd')
+** type -- the queue file type (e.g., DATAFL_LETTER)
**
** Returns:
** none
@@ -1005,7 +1016,7 @@ dup_queue_file(e, ee, type)
}
SYNC_DIR(f2buf, true);
}
- /*
+/*
** DOFORK -- do a fork, retrying a couple of times on failure.
**
** This MUST be a macro, since after a vfork we are running
@@ -1046,7 +1057,7 @@ dup_queue_file(e, ee, type)
(void) sleep((unsigned) NFORKTRIES - i);\
}\
}
- /*
+/*
** DOFORK -- simple fork interface to DOFORK.
**
** Parameters:
@@ -1070,7 +1081,7 @@ dofork()
return pid;
}
- /*
+/*
** COLONCMP -- compare host-signatures up to first ':' or EOS
**
** This takes two strings which happen to be host-signatures and
@@ -1135,7 +1146,7 @@ coloncmp(a, b)
return ret;
}
- /*
+/*
** DELIVER -- Deliver a message to a list of addresses.
**
** This routine delivers to everyone on the same host as the
@@ -1215,9 +1226,9 @@ deliver(e, firstto)
register char *p;
register MAILER *m; /* mailer for this recipient */
ADDRESS *volatile ctladdr;
-# if HASSETUSERCONTEXT
+#if HASSETUSERCONTEXT
ADDRESS *volatile contextaddr = NULL;
-# endif /* HASSETUSERCONTEXT */
+#endif /* HASSETUSERCONTEXT */
register MCI *volatile mci;
register ADDRESS *SM_NONVOLATILE to = firstto;
volatile bool clever = false; /* running user smtp to this mailer */
@@ -2628,7 +2639,7 @@ tryhost:
mci->mci_pid = pid;
(void) close(mpvect[0]);
mci->mci_out = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) mpvect[1], SM_IO_WRONLY,
+ (void *) &(mpvect[1]), SM_IO_WRONLY,
NULL);
if (mci->mci_out == NULL)
{
@@ -2643,7 +2654,7 @@ tryhost:
(void) close(rpvect[1]);
mci->mci_in = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) rpvect[0], SM_IO_RDONLY,
+ (void *) &(rpvect[0]), SM_IO_RDONLY,
NULL);
if (mci->mci_in == NULL)
{
@@ -2696,22 +2707,41 @@ tryhost:
dotpos = -1;
}
}
+ else if (mci->mci_mailer != NULL)
+ {
+ srvname = mci->mci_mailer->m_name;
+ dotpos = -1;
+ }
else
{
- srvname = "";
+ srvname = "local";
dotpos = -1;
}
+
+ /* don't set {server_name} to NULL or "": see getauth() */
macdefine(&mci->mci_macro, A_TEMP, macid("{server_name}"),
srvname);
/* CurHostAddr is set by makeconnection() and mci_get() */
if (CurHostAddr.sa.sa_family != 0)
+ {
macdefine(&mci->mci_macro, A_TEMP,
macid("{server_addr}"),
anynet_ntoa(&CurHostAddr));
+ }
+ else if (mci->mci_mailer != NULL)
+ {
+ /* mailer name is unique, use it as address */
+ macdefine(&mci->mci_macro, A_PERM,
+ macid("{server_addr}"),
+ mci->mci_mailer->m_name);
+ }
else
+ {
+ /* don't set it to NULL or "": see getauth() */
macdefine(&mci->mci_macro, A_PERM,
- macid("{server_addr}"), NULL);
+ macid("{server_addr}"), "0");
+ }
/* undo change of srvname (mci->mci_host) */
if (dotpos >= 0)
@@ -3394,7 +3424,7 @@ cleanup: ;
return rcode;
}
- /*
+/*
** MARKFAILURE -- mark a failure on a specific address.
**
** Parameters:
@@ -3522,7 +3552,7 @@ markfailure(e, q, mci, rcode, ovr)
mci != NULL && !bitset(M_LOCALMAILER, mci->mci_flags))
q->q_statmta = sm_rpool_strdup_x(e->e_rpool, CurHostName);
}
- /*
+/*
** ENDMAILER -- Wait for mailer to terminate.
**
** We should never get fatal errors (e.g., segmentation
@@ -3666,7 +3696,7 @@ endmailer(mci, e, pv)
ExitStat = EX_TEMPFAIL;
return EX_TEMPFAIL;
}
- /*
+/*
** GIVERESPONSE -- Interpret an error response from a mailer
**
** Parameters:
@@ -3907,7 +3937,7 @@ giveresponse(status, dsn, m, mci, ctladdr, xstart, e, to)
errno = 0;
SM_SET_H_ERRNO(0);
}
- /*
+/*
** LOGDELIVERY -- log the delivery in the system log
**
** Care is taken to avoid logging lines that are too long, because
@@ -4155,7 +4185,7 @@ logdelivery(m, mci, dsn, status, ctladdr, xstart, e)
sm_syslog(LOG_INFO, e->e_id, "stat=%s", shortenstring(status, 63));
#endif /* (SYSLOG_BUFSIZE) >= 256 */
}
- /*
+/*
** PUTFROMLINE -- output a UNIX-style from line (or whatever)
**
** This can be made an arbitrary message separator by changing $l
@@ -4229,7 +4259,7 @@ putfromline(mci, e)
expand(template, buf, sizeof buf, e);
putxline(buf, strlen(buf), mci, PXLF_HEADER);
}
- /*
+/*
** PUTBODY -- put the body of a message.
**
** Parameters:
@@ -4268,7 +4298,7 @@ putbody(mci, e, separator)
if (e->e_dfp == NULL && bitset(EF_HAS_DF, e->e_flags))
{
- char *df = queuename(e, 'd');
+ char *df = queuename(e, DATAFL_LETTER);
e->e_dfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, df,
SM_IO_RDONLY, NULL);
@@ -4307,7 +4337,7 @@ putbody(mci, e, separator)
}
}
- /* paranoia: the df file should always be in a rewound state */
+ /* paranoia: the data file should always be in a rewound state */
(void) bfrewind(e->e_dfp);
#if MIME8TO7
@@ -4723,8 +4753,9 @@ putch:
if (sm_io_error(e->e_dfp))
{
- syserr("putbody: %s/df%s: read error",
- qid_printqueue(e->e_dfqgrp, e->e_dfqdir), e->e_id);
+ syserr("putbody: %s/%cf%s: read error",
+ qid_printqueue(e->e_dfqgrp, e->e_dfqdir),
+ DATAFL_LETTER, e->e_id);
ExitStat = EX_IOERR;
}
@@ -4757,7 +4788,7 @@ endofmessage:
errno = 0;
}
- /*
+/*
** MAILFILE -- Send a message to a file.
**
** If the file has the set-user-ID/set-group-ID bits set, but NO
@@ -4969,10 +5000,10 @@ mailfile(filename, mailer, ctladdr, sfflags, e)
sm_dprintf("mailfile: ignoring set-user-ID/set-group-ID bits\n");
}
- /* we have to open the dfile BEFORE setuid() */
+ /* we have to open the data file BEFORE setuid() */
if (e->e_dfp == NULL && bitset(EF_HAS_DF, e->e_flags))
{
- char *df = queuename(e, 'd');
+ char *df = queuename(e, DATAFL_LETTER);
e->e_dfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, df,
SM_IO_RDONLY, NULL);
@@ -5326,7 +5357,7 @@ mailfiletimeout()
errno = ETIMEDOUT;
longjmp(CtxMailfileTimeout, 1);
}
- /*
+/*
** HOSTSIGNATURE -- return the "signature" for a host.
**
** The signature describes how we are going to send this -- it
@@ -5569,7 +5600,7 @@ hostsignature(m, host)
sm_dprintf("hostsignature(%s) = %s\n", host, s->s_hostsig.hs_sig);
return s->s_hostsig.hs_sig;
}
- /*
+/*
** PARSE_HOSTSIGNATURE -- parse the "signature" and return MX host array.
**
** The signature describes how we are going to send this -- it
@@ -5687,7 +5718,7 @@ parse_hostsignature(sig, mxhosts, mailer)
static SSL_CTX *clt_ctx = NULL;
static bool tls_ok_clt = true;
- /*
+/*
** SETCLTTLS -- client side TLS: allow/disallow.
**
** Parameters:
@@ -5707,7 +5738,7 @@ setclttls(tls_ok)
tls_ok_clt = tls_ok;
return;
}
- /*
+/*
** INITCLTTLS -- initialize client side TLS
**
** Parameters:
@@ -5736,7 +5767,7 @@ initclttls(tls_ok)
return tls_ok_clt;
}
- /*
+/*
** STARTTLS -- try to start secure connection (client side)
**
** Parameters:
@@ -5900,7 +5931,7 @@ ssl_retry:
clt_ssl = NULL;
return EX_SOFTWARE;
}
- /*
+/*
** ENDTLSCLT -- shutdown secure connection (client side)
**
** Parameters:
@@ -5924,7 +5955,7 @@ endtlsclt(mci)
}
# endif /* STARTTLS */
# if STARTTLS || SASL
- /*
+/*
** ISCLTFLGSET -- check whether client flag is set.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/domain.c b/gnu/usr.sbin/sendmail/sendmail/domain.c
index 45a059ba319..c69a838060d 100644
--- a/gnu/usr.sbin/sendmail/sendmail/domain.c
+++ b/gnu/usr.sbin/sendmail/sendmail/domain.c
@@ -14,9 +14,9 @@
#include <sendmail.h>
#if NAMED_BIND
-SM_RCSID("@(#)$Sendmail: domain.c,v 8.172 2001/09/04 22:43:03 ca Exp $ (with name server)")
+SM_RCSID("@(#)$Sendmail: domain.c,v 8.176 2001/09/22 17:52:42 gshapiro Exp $ (with name server)")
#else /* NAMED_BIND */
-SM_RCSID("@(#)$Sendmail: domain.c,v 8.172 2001/09/04 22:43:03 ca Exp $ (without name server)")
+SM_RCSID("@(#)$Sendmail: domain.c,v 8.176 2001/09/22 17:52:42 gshapiro Exp $ (without name server)")
#endif /* NAMED_BIND */
#if NAMED_BIND
@@ -80,7 +80,7 @@ static char *gethostalias __P((char *));
static int mxrand __P((char *));
static int fallbackmxrr __P((int, unsigned short *, char **));
- /*
+/*
** GETFALLBACKMXRR -- get MX resource records for fallback MX host.
**
** We have to initialize this once before doing anything else.
@@ -139,7 +139,7 @@ getfallbackmxrr(host)
return NumFallBackMXHosts;
}
- /*
+/*
** FALLBACKMXRR -- add MX resource records for fallback MX host to list.
**
** Parameters:
@@ -174,7 +174,7 @@ fallbackmxrr(nmx, prefs, mxhosts)
return nmx;
}
- /*
+/*
** GETMXRR -- get MX resource records for a domain
**
** Parameters:
@@ -586,7 +586,7 @@ punt:
}
return nmx;
}
- /*
+/*
** MXRAND -- create a randomizer for equal MX preferences
**
** If two MX hosts have equal preferences we want to randomize
@@ -635,7 +635,7 @@ mxrand(host)
sm_dprintf(" = %d\n", hfunc);
return hfunc;
}
- /*
+/*
** BESTMX -- find the best MX for a name
**
** This is really a hack, but I don't see any obvious way
@@ -747,7 +747,7 @@ bestmx_map_lookup(map, name, av, statp)
#endif /* _FFR_BESTMX_BETTER_TRUNCATION */
return result;
}
- /*
+/*
** DNS_GETCANONNAME -- get the canonical name for named host using DNS
**
** This algorithm tries to be smart about wildcard MX records.
@@ -918,11 +918,13 @@ cnameloop:
answer.qb2, sizeof(answer.qb2));
if (ret <= 0)
{
+ int save_errno = errno;
+
if (tTd(8, 7))
sm_dprintf("\tNO: errno=%d, h_errno=%d\n",
- errno, h_errno);
+ save_errno, h_errno);
- if (errno == ECONNREFUSED || h_errno == TRY_AGAIN)
+ if (save_errno == ECONNREFUSED || h_errno == TRY_AGAIN)
{
/*
** the name server seems to be down or broken.
@@ -943,7 +945,7 @@ cnameloop:
** didn't give an answer).
*/
- if (errno != ETIMEDOUT)
+ if (save_errno != ETIMEDOUT)
return false;
}
else
diff --git a/gnu/usr.sbin/sendmail/sendmail/envelope.c b/gnu/usr.sbin/sendmail/sendmail/envelope.c
index fcb2e5a56bb..3f0c79a3e63 100644
--- a/gnu/usr.sbin/sendmail/sendmail/envelope.c
+++ b/gnu/usr.sbin/sendmail/sendmail/envelope.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: envelope.c,v 8.264 2001/08/31 23:03:13 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: envelope.c,v 8.274 2001/09/17 20:39:57 gshapiro Exp $")
/*
** NEWENVELOPE -- fill in a new envelope
@@ -64,7 +64,24 @@ newenvelope(e, parent, rpool)
assign_queueid(e);
e->e_ctime = curtime();
if (parent != NULL)
+ {
e->e_msgpriority = parent->e_msgsize;
+#if _FFR_QUARANTINE
+ if (parent->e_holdmsg == NULL)
+ {
+ e->e_holdmsg = NULL;
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), "");
+ }
+ else
+ {
+ e->e_holdmsg = sm_rpool_strdup_x(rpool,
+ parent->e_holdmsg);
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), e->e_holdmsg);
+ }
+#endif /* _FFR_QUARANTINE */
+ }
e->e_puthdr = putheader;
e->e_putbody = putbody;
if (CurEnv->e_xfp != NULL)
@@ -86,7 +103,7 @@ newenvelope(e, parent, rpool)
#define IS_IMM_RET(x) (((x) & (MSG_T_O_NOW|MSG_NOT_BY)) != 0)
#define IS_MSG_WARN(x) (((x) & 0xf0) != 0) /* return a warning */
- /*
+/*
** DROPENVELOPE -- deallocate an envelope.
**
** Parameters:
@@ -449,13 +466,13 @@ simpledrop:
{
if (tTd(50, 1))
{
- sm_dprintf("\n===== Dropping [dq]f%s... queueit=%d, e_flags=",
+ sm_dprintf("\n===== Dropping queue files for %s... queueit=%d, e_flags=",
e->e_id, queueit);
printenvflags(e);
}
if (!savedf)
- (void) xunlink(queuename(e, 'd'));
- if (xunlink(queuename(e, 'q')) == 0)
+ (void) xunlink(queuename(e, DATAFL_LETTER));
+ if (xunlink(queuename(e, ANYQFL_LETTER)) == 0)
{
/* add to available space in filesystem */
updfs(e, true, !savedf);
@@ -528,7 +545,7 @@ simpledrop:
e->e_id = NULL;
e->e_flags &= ~EF_HAS_DF;
}
- /*
+/*
** CLEARENVELOPE -- clear an envelope without unlocking
**
** This is normally used by a child process to get a clean
@@ -585,6 +602,12 @@ clearenvelope(e, fullclear, rpool)
*e = BlankEnvelope;
e->e_message = NULL;
+#if _FFR_QUARANTINE
+ e->e_qfletter = '\0';
+ e->e_holdmsg = NULL;
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), "");
+#endif /* _FFR_QUARANTINE */
/*
** Copy the macro table.
@@ -621,7 +644,7 @@ clearenvelope(e, fullclear, rpool)
nhp = &(*nhp)->h_link;
}
}
- /*
+/*
** INITSYS -- initialize instantiation of system
**
** In Daemon mode, this is done in the child.
@@ -657,6 +680,9 @@ initsys(e)
openxscript(e);
e->e_ctime = curtime();
+#if _FFR_QUARANTINE
+ e->e_qfletter = '\0';
+#endif /* _FFR_QUARANTINE */
#if _FFR_QUEUEDELAY
e->e_queuealg = QueueAlg;
e->e_queuedelay = QueueInitDelay;
@@ -706,7 +732,7 @@ initsys(e)
}
#endif /* TTYNAME */
}
- /*
+/*
** SETTIME -- set the current time.
**
** Parameters:
@@ -743,7 +769,7 @@ settime(e)
if (macvalue('a', e) == NULL)
macdefine(&e->e_macro, A_PERM, 'a', macvalue('b', e));
}
- /*
+/*
** OPENXSCRIPT -- Open transcript file
**
** Creates a transcript file for possible eventual mailing or
@@ -777,7 +803,7 @@ openxscript(e)
syserr("openxscript: job not locked");
#endif /* 0 */
- p = queuename(e, 'x');
+ p = queuename(e, XSCRPT_LETTER);
e->e_xfp = bfopen(p, FileMode, XscriptFileBufferSize,
SFF_NOTEXCL|SFF_OPENASROOT);
@@ -797,7 +823,7 @@ openxscript(e)
false);
}
}
- /*
+/*
** CLOSEXSCRIPT -- close the transcript file.
**
** Parameters:
@@ -823,7 +849,7 @@ closexscript(e)
(void) sm_io_close(e->e_xfp, SM_TIME_DEFAULT);
e->e_xfp = NULL;
}
- /*
+/*
** SETSENDER -- set the person who this message is from
**
** Under certain circumstances allow the user to say who
@@ -1107,7 +1133,7 @@ setsender(from, e, delimptr, delimchar, internal)
}
}
}
- /*
+/*
** PRINTENVFLAGS -- print envelope flags for debugging
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/err.c b/gnu/usr.sbin/sendmail/sendmail/err.c
index 978a8c37f00..c5409e59402 100644
--- a/gnu/usr.sbin/sendmail/sendmail/err.c
+++ b/gnu/usr.sbin/sendmail/sendmail/err.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: err.c,v 8.184 2001/09/04 22:43:03 ca Exp $")
+SM_RCSID("@(#)$Sendmail: err.c,v 8.187 2001/09/11 04:05:14 gshapiro Exp $")
#if LDAPMAP
# include <lber.h>
@@ -255,7 +255,7 @@ syserr(fmt, va_alist)
if (QuickAbort)
sm_exc_raisenew_x(&EtypeQuickAbort, 2);
}
- /*
+/*
** USRERR -- Signal user error.
**
** This is much like syserr except it is for user errors.
@@ -340,7 +340,7 @@ usrerr(fmt, va_alist)
if (QuickAbort)
sm_exc_raisenew_x(&EtypeQuickAbort, 1);
}
- /*
+/*
** USRERRENH -- Signal user error.
**
** Same as usrerr but with enhanced status code.
@@ -427,7 +427,7 @@ usrerrenh(enhsc, fmt, va_alist)
if (QuickAbort)
sm_exc_raisenew_x(&EtypeQuickAbort, 1);
}
- /*
+/*
** MESSAGE -- print message (not necessarily an error)
**
** Parameters:
@@ -478,7 +478,7 @@ message(msg, va_alist)
break;
}
}
- /*
+/*
** NMESSAGE -- print message (not necessarily an error)
**
** Just like "message" except it never puts the to... tag on.
@@ -533,7 +533,7 @@ nmessage(msg, va_alist)
break;
}
}
- /*
+/*
** PUTOUTMSG -- output error message to transcript and channel
**
** Parameters:
@@ -656,7 +656,7 @@ putoutmsg(msg, holdmsg, heldmsg)
shortenstring(msg, MAXSHORTSTR), sm_errstring(errno));
#endif /* !PIPELINING */
}
- /*
+/*
** PUTERRMSG -- like putoutmsg, but does special processing for error messages
**
** Parameters:
@@ -699,7 +699,7 @@ puterrmsg(msg)
CurEnv->e_flags |= EF_FATALERRS;
}
}
- /*
+/*
** ISENHSC -- check whether a string contains an enhanced status code
**
** Parameters:
@@ -738,7 +738,7 @@ isenhsc(s, delim)
return 0;
return l + h;
}
- /*
+/*
** EXTENHSC -- check and extract an enhanced status code
**
** Parameters:
@@ -792,7 +792,7 @@ extenhsc(s, delim, e)
e[l + h] = '\0';
return l + h;
}
- /*
+/*
** FMTMSG -- format a message into buffer.
**
** Parameters:
@@ -925,7 +925,7 @@ fmtmsg(eb, to, num, enhsc, eno, fmt, ap)
return errtxt;
}
- /*
+/*
** BUFFER_ERRORS -- arrange to buffer future error messages
**
** Parameters:
@@ -941,7 +941,7 @@ buffer_errors()
HeldMessageBuf[0] = '\0';
HoldErrs = true;
}
- /*
+/*
** FLUSH_ERRORS -- flush the held error message buffer
**
** Parameters:
@@ -961,7 +961,7 @@ flush_errors(print)
HeldMessageBuf[0] = '\0';
HoldErrs = false;
}
- /*
+/*
** SM_ERRSTRING -- return string description of error code
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/headers.c b/gnu/usr.sbin/sendmail/sendmail/headers.c
index 2ed6c1c4deb..ab8334b974c 100644
--- a/gnu/usr.sbin/sendmail/sendmail/headers.c
+++ b/gnu/usr.sbin/sendmail/sendmail/headers.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: headers.c,v 8.262 2001/09/04 22:43:03 ca Exp $")
+SM_RCSID("@(#)$Sendmail: headers.c,v 8.265 2001/09/11 04:05:14 gshapiro Exp $")
static size_t fix_mime_header __P((char *));
static int priencode __P((char *));
@@ -42,7 +42,7 @@ setupheaders()
s->s_header.hi_ruleset = NULL;
}
}
- /*
+/*
** CHOMPHEADER -- process and save a header line.
**
** Called by collect, readcf, and readqf to deal with header lines.
@@ -457,7 +457,7 @@ hse:
return h->h_flags;
}
- /*
+/*
** ADDHEADER -- add a header entry to the end of the queue.
**
** This bypasses the special checking of chompheader.
@@ -509,7 +509,7 @@ addheader(field, value, flags, e)
h->h_macro = '\0';
*hp = h;
}
- /*
+/*
** HVALUE -- return value of a header.
**
** Only "real" fields (i.e., ones that have not been supplied
@@ -542,7 +542,7 @@ hvalue(field, header)
}
return NULL;
}
- /*
+/*
** ISHEADER -- predicate telling if argument is a header.
**
** A line is a header if it has a single word followed by
@@ -586,7 +586,7 @@ isheader(h)
return (*s == ':');
}
- /*
+/*
** EATHEADER -- run through the stored header and extract info.
**
** Parameters:
@@ -830,7 +830,7 @@ eatheader(e, full, log)
e->e_flags &= ~EF_LOGSENDER;
}
}
- /*
+/*
** LOGSENDER -- log sender information
**
** Parameters:
@@ -959,7 +959,7 @@ logsender(e, msgid)
"%.400srelay=%.100s", sbuf, name);
#endif /* (SYSLOG_BUFSIZE) >= 256 */
}
- /*
+/*
** PRIENCODE -- encode external priority names into internal values.
**
** Parameters:
@@ -987,7 +987,7 @@ priencode(p)
/* unknown priority */
return 0;
}
- /*
+/*
** CRACKADDR -- parse an address and turn it into a macro
**
** This doesn't actually parse the address -- it just extracts
@@ -1346,7 +1346,7 @@ crackaddr(addr)
return buf;
}
- /*
+/*
** PUTHEADER -- put the header part of a message from the in-core copy
**
** Parameters:
@@ -1590,7 +1590,7 @@ putheader(mci, hdr, e, flags)
}
#endif /* MIME8TO7 */
}
- /*
+/*
** PUT_VANILLA_HEADER -- output a fairly ordinary header
**
** Parameters:
@@ -1637,7 +1637,7 @@ put_vanilla_header(h, v, mci)
(int) (SPACELEFT(obuf, obp) - 1), v);
putxline(obuf, strlen(obuf), mci, putflags);
}
- /*
+/*
** COMMAIZE -- output a header field, making a comma-translated list.
**
** Parameters:
@@ -1807,7 +1807,7 @@ commaize(h, p, oldstyle, mci, e)
*obp = '\0';
putxline(obuf, strlen(obuf), mci, putflags);
}
- /*
+/*
** COPYHEADER -- copy header list
**
** This routine is the equivalent of newstr for header lists
@@ -1844,7 +1844,7 @@ copyheader(header, rpool)
return ret;
}
- /*
+/*
** FIX_MIME_HEADER -- possibly truncate/rebalance parameters in a MIME header
**
** Run through all of the parameters of a MIME header and
diff --git a/gnu/usr.sbin/sendmail/sendmail/macro.c b/gnu/usr.sbin/sendmail/sendmail/macro.c
index ce96274b4a3..c594252acdf 100644
--- a/gnu/usr.sbin/sendmail/sendmail/macro.c
+++ b/gnu/usr.sbin/sendmail/sendmail/macro.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: macro.c,v 8.83 2001/09/04 22:43:03 ca Exp $")
+SM_RCSID("@(#)$Sendmail: macro.c,v 8.86 2001/09/11 04:05:14 gshapiro Exp $")
#if MAXMACROID != (BITMAPBITS - 1)
ERROR Read the comment in conf.h
@@ -94,7 +94,7 @@ initmacros(e)
MACBINDING("opMode", MID_OPMODE);
/*XXX should probably add equivalents for all short macros here XXX*/
}
- /*
+/*
** EXPAND -- macro expand a string using $x escapes.
**
** Parameters:
@@ -383,7 +383,7 @@ macset(mac, i, value)
mac->mac_table[i] = value;
}
- /*
+/*
** MACVALUE -- return uninterpreted value of a macro.
**
** Does fancy path searching.
@@ -425,7 +425,7 @@ macvalue(n, e)
}
return GlobalMacros.mac_table[n];
}
- /*
+/*
** MACNAME -- return the name of a macro given its internal id
**
** Parameter:
@@ -457,7 +457,7 @@ macname(n)
mbuf[1] = '\0';
return mbuf;
}
- /*
+/*
** MACID_PARSE -- return id of macro identified by its name
**
** Parameters:
@@ -570,7 +570,7 @@ macid_parse(p, ep)
sm_dprintf("0x%x\n", mid);
return mid;
}
- /*
+/*
** WORDINCLASS -- tell if a word is in a specific class
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/main.c b/gnu/usr.sbin/sendmail/sendmail/main.c
index cad28848a98..5d6252dc4b2 100644
--- a/gnu/usr.sbin/sendmail/sendmail/main.c
+++ b/gnu/usr.sbin/sendmail/sendmail/main.c
@@ -25,7 +25,7 @@ SM_UNUSED(static char copyright[]) =
The Regents of the University of California. All rights reserved.\n";
#endif /* ! lint */
-SM_RCSID("@(#)$Sendmail: main.c,v 8.804 2001/09/08 01:21:09 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: main.c,v 8.831 2001/09/25 22:25:58 ca Exp $")
#if NETINET || NETINET6
@@ -123,6 +123,27 @@ int SyslogPrefixLen; /* estimated length of syslog prefix */
#define SLDLL 8 /* est. length of default syslog label */
+/* Some options are dangerous to allow users to use in non-submit mode */
+#define CHECK_AGAINST_OPMODE(cmd) \
+{ \
+ if (extraprivs && \
+ OpMode != MD_DELIVER && OpMode != MD_SMTP && \
+ OpMode != MD_VERIFY && OpMode != MD_TEST) \
+ { \
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, \
+ "WARNING: Ignoring submission mode -%c option (not in submission mode)\n", \
+ (cmd)); \
+ break; \
+ } \
+ if (extraprivs && queuerun) \
+ { \
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, \
+ "WARNING: Ignoring submission mode -%c option with -q\n", \
+ (cmd)); \
+ break; \
+ } \
+}
+
int
main(argc, argv, envp)
int argc;
@@ -137,12 +158,14 @@ main(argc, argv, envp)
register int i;
int j;
int dp;
+ int save_errno;
bool safecf = true;
BITMAP256 *p_flags = NULL; /* daemon flags */
bool warn_C_flag = false;
bool auth = true; /* whether to set e_auth_param */
char warn_f_flag = '\0';
bool run_in_foreground = false; /* -bD mode */
+ bool queuerun = false, debug = false;
struct passwd *pw;
struct hostent *hp;
char *nullserver = NULL;
@@ -150,6 +173,7 @@ main(argc, argv, envp)
char *sysloglabel = NULL; /* label for syslog */
char *conffile = NULL; /* name of .cf file */
char *runqueuegroup = NULL; /* queue group to process */
+ bool extraprivs;
bool forged, negate;
bool queuepersistent = false; /* queue runner process runs forever */
bool foregroundqueue = false; /* queue run in foreground */
@@ -196,6 +220,13 @@ main(argc, argv, envp)
/* avoid null pointer dereferences */
TermEscape.te_rv_on = TermEscape.te_rv_off = "";
+ RealUid = getuid();
+ RealGid = getgid();
+
+ /* Check if sendmail is running with extra privs */
+ extraprivs = (RealUid != 0 &&
+ (geteuid() != getuid() || getegid() != getgid()));
+
/*
** Seed the random number generator.
** Used for queue file names, picking a queue directory, and
@@ -222,9 +253,17 @@ main(argc, argv, envp)
** But also be sure that 0, 1, & 2 are open.
*/
+ /* reset errno and save_errno; the latter is used down below */
+ errno = save_errno = 0;
fill_fd(STDIN_FILENO, NULL);
+ if (errno != 0)
+ save_errno = errno;
fill_fd(STDOUT_FILENO, NULL);
+ if (errno != 0)
+ save_errno = errno;
fill_fd(STDERR_FILENO, NULL);
+ if (errno != 0)
+ save_errno = errno;
i = DtableSize;
while (--i > 0)
@@ -258,6 +297,19 @@ main(argc, argv, envp)
(void) sm_strlcat(mbuf, ", stdout", sizeof mbuf);
if (bitset(1 << STDERR_FILENO, MissingFds))
(void) sm_strlcat(mbuf, ", stderr", sizeof mbuf);
+
+ /*
+ ** hack for syserr(), otherwise nothing is logged because
+ ** LogLevel is set later on (setdefaults()).
+ ** XXX should this really be syserr()?
+ ** For example, arpwatch closes std{in,out,err} as daemon
+ ** and only reassigns stdin to the file it wants to mail.
+ ** This causes "bogus" syserrors and dumpfd output without
+ ** any explanation why this happened.
+ */
+
+ errno = save_errno;
+ LogLevel = 1;
syserr("File descriptors missing on startup: %s", &mbuf[2]);
}
@@ -276,7 +328,10 @@ main(argc, argv, envp)
/* save initial group set for future checks */
i = getgroups(NGROUPS_MAX, InitialGidSet);
if (i <= 0)
+ {
InitialGidSet[0] = (GID_T) -1;
+ i = 0;
+ }
while (i < NGROUPS_MAX)
InitialGidSet[i++] = InitialGidSet[0];
#endif /* NGROUPS_MAX */
@@ -306,6 +361,23 @@ main(argc, argv, envp)
*/
+ /* find initial opMode */
+ OpMode = MD_DELIVER;
+ av = argv;
+ p = strrchr(*av, '/');
+ if (p++ == NULL)
+ p = *av;
+ if (strcmp(p, "newaliases") == 0)
+ OpMode = MD_INITALIAS;
+ else if (strcmp(p, "mailq") == 0)
+ OpMode = MD_PRINT;
+ else if (strcmp(p, "smtpd") == 0)
+ OpMode = MD_DAEMON;
+ else if (strcmp(p, "hoststat") == 0)
+ OpMode = MD_HOSTSTAT;
+ else if (strcmp(p, "purgestat") == 0)
+ OpMode = MD_PURGESTAT;
+
#if defined(__osf__) || defined(_AIX3)
# define OPTIONS "A:B:b:C:cd:e:F:f:Gh:IiL:M:mN:nO:o:p:q:R:r:sTtV:vX:x"
#endif /* defined(__osf__) || defined(_AIX3) */
@@ -320,7 +392,38 @@ main(argc, argv, envp)
{
switch (j)
{
+ case 'b': /* operations mode */
+ switch (j = *optarg)
+ {
+ case MD_DAEMON:
+ case MD_FGDAEMON:
+ case MD_SMTP:
+ case MD_INITALIAS:
+ case MD_DELIVER:
+ case MD_VERIFY:
+ case MD_TEST:
+ case MD_PRINT:
+ case MD_PRINTNQE:
+ case MD_HOSTSTAT:
+ case MD_PURGESTAT:
+ case MD_ARPAFTP:
+ OpMode = j;
+ break;
+
+ case MD_FREEZE:
+ usrerr("Frozen configurations unsupported");
+ ExitStat = EX_USAGE;
+ break;
+
+ default:
+ usrerr("Invalid operation mode %c", j);
+ ExitStat = EX_USAGE;
+ break;
+ }
+ break;
+
case 'd':
+ debug = true;
tTflag(optarg);
(void) sm_io_setvbuf(smioout, SM_TIME_DEFAULT,
(char *) NULL, SM_IO_NBF,
@@ -339,10 +442,23 @@ main(argc, argv, envp)
SL_FUDGE + j;
break;
+ case 'q':
+ /* just check if it is there */
+ queuerun = true;
+ break;
}
}
opterr = 1;
+ /* Don't leak queue information via debug flags */
+ if (extraprivs && queuerun && debug)
+ {
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
+ "WARNING: Can not use -d with -q. Disabling debugging.\n");
+ sm_debug_setfile(NULL);
+ (void) memset(tTdvect, '\0', sizeof tTdvect);
+ }
+
#if LOG
if (sysloglabel != NULL)
{
@@ -376,10 +492,9 @@ main(argc, argv, envp)
setdefaults(&BlankEnvelope);
initmacros(&BlankEnvelope);
- set_op_mode(MD_DELIVER);
- RealUid = getuid();
- RealGid = getgid();
+ /* reset macro */
+ set_op_mode(OpMode);
pw = sm_getpwuid(RealUid);
if (pw != NULL)
@@ -470,12 +585,13 @@ main(argc, argv, envp)
sm_dprintf("Kernel symbols:\t%s\n", _PATH_UNIX);
#endif /* _PATH_UNIX */
- /* XXX This doesn't work because OpMode isn't set correctly */
- sm_dprintf(" Def Conf file:\t%s\n", getcfname(OpMode,
- SubmitMode,
- SM_GET_RIGHT_CF,
- conffile));
- sm_dprintf(" Def Pid file:\t%s\n", PidFile);
+ sm_dprintf(" Conf file:\t%s (default for MSP)\n",
+ getcfname(OpMode, SubmitMode, SM_GET_SUBMIT_CF,
+ conffile));
+ sm_dprintf(" Conf file:\t%s (default for MTA)\n",
+ getcfname(OpMode, SubmitMode, SM_GET_SENDMAIL_CF,
+ conffile));
+ sm_dprintf(" Pid file:\t%s (default)\n", PidFile);
}
if (tTd(0, 12))
@@ -512,9 +628,12 @@ main(argc, argv, envp)
char *tz;
int tzlen;
+ /* XXX check for reasonable length? */
tzlen = strlen(p) + 4;
tz = xalloc(tzlen);
(void) sm_strlcpyn(tz, tzlen, 2, "TZ=", p);
+
+ /* XXX check return code? */
(void) putenv(tz);
}
@@ -565,7 +684,7 @@ main(argc, argv, envp)
struct utsname utsname;
if (tTd(0, 4))
- sm_dprintf("canonical name: %s\n", jbuf);
+ sm_dprintf("Canonical name: %s\n", jbuf);
macdefine(&BlankEnvelope.e_macro, A_TEMP, 'w', jbuf);
macdefine(&BlankEnvelope.e_macro, A_TEMP, 'j', jbuf);
setclass('w', jbuf);
@@ -676,59 +795,21 @@ main(argc, argv, envp)
QueueLimitRecipient = (QUEUE_CHAR *) NULL;
QueueLimitSender = (QUEUE_CHAR *) NULL;
QueueLimitId = (QUEUE_CHAR *) NULL;
+#if _FFR_QUARANTINE
+ QueueLimitReason = (QUEUE_CHAR *) NULL;
+#endif /* _FFR_QUARANTINE */
/*
** Crack argv.
*/
- av = argv;
- p = strrchr(*av, '/');
- if (p++ == NULL)
- p = *av;
- if (strcmp(p, "newaliases") == 0)
- set_op_mode(MD_INITALIAS);
- else if (strcmp(p, "mailq") == 0)
- set_op_mode(MD_PRINT);
- else if (strcmp(p, "smtpd") == 0)
- set_op_mode(MD_DAEMON);
- else if (strcmp(p, "hoststat") == 0)
- set_op_mode(MD_HOSTSTAT);
- else if (strcmp(p, "purgestat") == 0)
- set_op_mode(MD_PURGESTAT);
-
optind = 1;
while ((j = getopt(argc, argv, OPTIONS)) != -1)
{
switch (j)
{
case 'b': /* operations mode */
- switch (j = *optarg)
- {
- case MD_DAEMON:
- case MD_FGDAEMON:
- case MD_SMTP:
- case MD_INITALIAS:
- case MD_DELIVER:
- case MD_VERIFY:
- case MD_TEST:
- case MD_PRINT:
- case MD_PRINTNQE:
- case MD_HOSTSTAT:
- case MD_PURGESTAT:
- case MD_ARPAFTP:
- set_op_mode(j);
- break;
-
- case MD_FREEZE:
- usrerr("Frozen configurations unsupported");
- ExitStat = EX_USAGE;
- break;
-
- default:
- usrerr("Invalid operation mode %c", j);
- ExitStat = EX_USAGE;
- break;
- }
+ /* already done */
break;
case 'A': /* use Alternate sendmail/submit.cf */
@@ -737,6 +818,7 @@ main(argc, argv, envp)
break;
case 'B': /* body type */
+ CHECK_AGAINST_OPMODE(j);
BlankEnvelope.e_bodytype = newstr(optarg);
break;
@@ -749,11 +831,13 @@ main(argc, argv, envp)
safecf = false;
break;
- case 'd': /* debugging -- already done */
+ case 'd': /* debugging */
+ /* already done */
break;
case 'f': /* from address */
case 'r': /* obsolete -f flag */
+ CHECK_AGAINST_OPMODE(j);
if (from != NULL)
{
usrerr("More than one \"from\" person");
@@ -766,14 +850,17 @@ main(argc, argv, envp)
break;
case 'F': /* set full name */
+ CHECK_AGAINST_OPMODE(j);
FullName = newstr(optarg);
break;
case 'G': /* relay (gateway) submission */
/* already set */
+ CHECK_AGAINST_OPMODE(j);
break;
case 'h': /* hop count */
+ CHECK_AGAINST_OPMODE(j);
BlankEnvelope.e_hopcount = (short) strtol(optarg, &ep,
10);
(void) sm_snprintf(buf, sizeof buf, "%d",
@@ -792,10 +879,12 @@ main(argc, argv, envp)
break;
case 'n': /* don't alias */
+ CHECK_AGAINST_OPMODE(j);
NoAlias = true;
break;
case 'N': /* delivery status notifications */
+ CHECK_AGAINST_OPMODE(j);
DefaultNotify |= QHASNOTIFY;
macdefine(&BlankEnvelope.e_macro, A_TEMP,
macid("{dsn_notify}"), optarg);
@@ -830,6 +919,7 @@ main(argc, argv, envp)
break;
case 'p': /* set protocol */
+ CHECK_AGAINST_OPMODE(j);
p = strchr(optarg, ':');
if (p != NULL)
{
@@ -870,7 +960,6 @@ main(argc, argv, envp)
set_op_mode(MD_QUEUERUN);
FullName = NULL;
-
negate = optarg[0] == '!';
if (negate)
{
@@ -918,6 +1007,24 @@ main(argc, argv, envp)
foregroundqueue = true;
break;
+#if _FFR_QUARANTINE
+ case 'H': /* Limit by recipient */
+ if (optarg[1] != '\0')
+ {
+ new = (QUEUE_CHAR *) xalloc(sizeof *new);
+ new->queue_match = newstr(&optarg[1]);
+ new->queue_negate = negate;
+ new->queue_next = QueueLimitReason;
+ QueueLimitReason = new;
+ }
+ QueueMode = QM_HELD;
+ break;
+
+ case 'L': /* act on lost items */
+ QueueMode = QM_LOST;
+ break;
+#endif /* _FFR_QUARANTINE */
+
case 'p': /* Persistent queue */
queuepersistent = true;
if (QueueIntvl == 0)
@@ -925,7 +1032,8 @@ main(argc, argv, envp)
if (optarg[1] == '\0')
break;
++optarg;
- /* FALL THRU */
+ /* FALLTHROUGH */
+
default:
i = Errors;
QueueIntvl = convtime(optarg, 'm');
@@ -938,6 +1046,7 @@ main(argc, argv, envp)
break;
case 'R': /* DSN RET: what to return */
+ CHECK_AGAINST_OPMODE(j);
if (bitset(EF_RET_PARAM, BlankEnvelope.e_flags))
{
usrerr("Duplicate -R flag");
@@ -957,10 +1066,12 @@ main(argc, argv, envp)
break;
case 't': /* read recipients from message */
+ CHECK_AGAINST_OPMODE(j);
GrabTo = true;
break;
case 'V': /* DSN ENVID: set "original" envelope id */
+ CHECK_AGAINST_OPMODE(j);
if (!xtextok(optarg))
{
usrerr("Invalid syntax in -V flag");
@@ -1039,7 +1150,14 @@ main(argc, argv, envp)
break;
}
}
- av += optind;
+
+ /* if we've had errors so far, exit now */
+ if ((ExitStat != EX_OK && OpMode != MD_TEST) ||
+ ExitStat == EX_OSERR)
+ {
+ finis(false, ExitStat);
+ /* NOTREACHED */
+ }
if (bitset(SUBMIT_MTA, SubmitMode))
{
@@ -1125,7 +1243,8 @@ main(argc, argv, envp)
if (SuperSafe == SAFE_INTERACTIVE && CurEnv->e_sendmode != SM_DELIVER)
{
- printf("WARNING: SuperSafe=interactive should only be used with\n DeliveryMode=interactive\n");
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
+ "WARNING: SuperSafe=interactive should only be used with\n DeliveryMode=interactive\n");
}
if (UseMSP && (OpMode == MD_DAEMON || OpMode == MD_FGDAEMON))
@@ -1213,6 +1332,15 @@ main(argc, argv, envp)
if (DontProbeInterfaces != DPI_PROBENONE)
load_if_names();
+ if (tTd(0, 10))
+ {
+ /* Now we know which .cf file we use */
+ sm_dprintf(" Conf file:\t%s (selected)\n",
+ getcfname(OpMode, SubmitMode, SM_GET_RIGHT_CF,
+ conffile));
+ sm_dprintf(" Pid file:\t%s (selected)\n", PidFile);
+ }
+
if (tTd(0, 1))
{
sm_dprintf("\n============ SYSTEM IDENTITY (after readcf) ============");
@@ -1245,18 +1373,16 @@ main(argc, argv, envp)
(int) RealUid);
/* check body type for legality */
- if (BlankEnvelope.e_bodytype == NULL)
+ i = check_bodytype(BlankEnvelope.e_bodytype);
+ if (i == BODYTYPE_NONE)
/* EMPTY */
/* nothing */ ;
- else if (sm_strcasecmp(BlankEnvelope.e_bodytype, "7BIT") == 0)
- SevenBitInput = true;
- else if (sm_strcasecmp(BlankEnvelope.e_bodytype, "8BITMIME") == 0)
- SevenBitInput = false;
- else
+ else if (i == BODYTYPE_ILLEGAL)
{
usrerr("Illegal body type %s", BlankEnvelope.e_bodytype);
BlankEnvelope.e_bodytype = NULL;
}
+ else SevenBitInput = (i == BODYTYPE_7BIT);
/* tweak default DSN notifications */
if (DefaultNotify == 0)
@@ -1657,7 +1783,7 @@ main(argc, argv, envp)
setclass(macid("{checkMIMEHeaders}"), "content-type");
setclass(macid("{checkMIMEHeaders}"), "mime-version");
- /* Macros to save in the qf file -- don't remove any */
+ /* Macros to save in the queue file -- don't remove any */
setclass(macid("{persistentMacros}"), "r");
setclass(macid("{persistentMacros}"), "s");
setclass(macid("{persistentMacros}"), "_");
@@ -2375,6 +2501,7 @@ main(argc, argv, envp)
if (macvalue('s', &MainEnvelope) == NULL)
macdefine(&MainEnvelope.e_macro, A_PERM, 's', RealHostName);
+ av = argv + optind;
if (*av == NULL && !GrabTo)
{
MainEnvelope.e_to = NULL;
@@ -2507,7 +2634,7 @@ main(argc, argv, envp)
/* NOTREACHED */
return ExitStat;
}
- /*
+/*
** STOP_SENDMAIL -- Stop the running program
**
** Parameters:
@@ -2528,7 +2655,7 @@ stop_sendmail()
(void) setuid(RealUid);
exit(EX_OK);
}
- /*
+/*
** FINIS -- Clean up and exit.
**
** Parameters:
@@ -2633,7 +2760,7 @@ finis(drop, exitstat)
exit(exitstat);
SM_END_TRY
}
- /*
+/*
** INTINDEBUG -- signal handler for SIGINT in -bt mode
**
** Parameters:
@@ -2675,7 +2802,7 @@ intindebug(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** SIGTERM -- SIGTERM handler for the daemon
**
** Parameters:
@@ -2705,7 +2832,7 @@ sigterm(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** SIGHUP -- handle a SIGHUP signal
**
** Parameters:
@@ -2735,7 +2862,7 @@ sighup(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** SIGPIPE -- signal handler for SIGPIPE
**
** Parameters:
@@ -2765,7 +2892,7 @@ sigpipe(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** INTSIG -- clean up on interrupt
**
** This just arranges to exit. It pessimizes in that it
@@ -2835,7 +2962,7 @@ intsig(sig)
finis(drop, EX_OK);
/* NOTREACHED */
}
- /*
+/*
** DISCONNECT -- remove our connection with any foreground process
**
** Parameters:
@@ -3012,7 +3139,7 @@ obsolete(argv)
#endif /* defined(sony_news) */
}
}
- /*
+/*
** AUTH_WARNING -- specify authorization warning
**
** Parameters:
@@ -3068,7 +3195,7 @@ auth_warning(e, msg, va_alist)
buf);
}
}
- /*
+/*
** GETEXTENV -- get from external environment
**
** Parameters:
@@ -3093,7 +3220,7 @@ getextenv(envar)
}
return NULL;
}
- /*
+/*
** SETUSERENV -- set an environment in the propagated environment
**
** Parameters:
@@ -3123,6 +3250,7 @@ setuserenv(envar, value)
return;
}
+ /* XXX enforce reasonable size? */
i = strlen(envar) + 1;
l = strlen(value) + i + 1;
p = (char *) xalloc(l);
@@ -3144,7 +3272,7 @@ setuserenv(envar, value)
if (putenv(p) < 0)
syserr("setuserenv: putenv(%s) failed", p);
}
- /*
+/*
** DUMPSTATE -- dump state
**
** For debugging.
@@ -3194,7 +3322,7 @@ dumpstate(when)
}
#ifdef SIGUSR1
- /*
+/*
** SIGUSR1 -- Signal a request to dump state.
**
** Parameters:
@@ -3231,7 +3359,8 @@ sigusr1(sig)
return SIGFUNC_RETURN;
}
#endif /* SIGUSR1 */
- /*
+
+/*
** DROP_PRIVILEGES -- reduce privileges to those of the RunAsUser option
**
** Parameters:
@@ -3288,12 +3417,60 @@ drop_privileges(to_real_uid)
rval = EX_OSERR;
}
- /* reset primary group and user id */
- if ((to_real_uid || RunAsGid != 0) && EffGid != RunAsGid &&
- setgid(RunAsGid) < 0)
+ /* reset primary group id */
+ if (to_real_uid || RunAsGid != 0)
{
- syserr("drop_privileges: setgid(%d) failed", (int) RunAsGid);
- rval = EX_OSERR;
+ /*
+ ** On some OS we must reset the effective[/real[/saved]] gid,
+ ** and then use setgid() to finally drop all group privileges.
+ ** Later on we check whether we can get back the
+ ** effective gid.
+ */
+
+#if HASSETEGID
+ if (setegid(RunAsGid) < 0)
+ {
+ syserr("drop_privileges: setegid(%d) failed",
+ (int) RunAsGid);
+ rval = EX_OSERR;
+ }
+ else
+#else /* HASSETEGID */
+# if HASSETREGID
+ if (setregid(RunAsGid, RunAsGid) < 0)
+ {
+ syserr("drop_privileges: setregid(%d, %d) failed",
+ (int) RunAsGid, (int) RunAsGid);
+ rval = EX_OSERR;
+ }
+ else
+# else /* HASSETREGID */
+# if HASSETRESGID
+ if (setresgid(RunAsGid, RunAsGid, RunAsGid) < 0)
+ {
+ syserr("drop_privileges: setresgid(%d, %d, %d) failed",
+ (int) RunAsGid, (int) RunAsGid, (int) RunAsGid);
+ rval = EX_OSERR;
+ }
+ else
+# endif /* HASSETRESGID */
+# endif /* HASSETREGID */
+#endif /* HASSETEGID */
+ if (setgid(RunAsGid) < 0)
+ {
+ syserr("drop_privileges: setgid(%d) failed",
+ (int) RunAsGid);
+ rval = EX_OSERR;
+ }
+ else if (getegid() != RunAsGid
+#if !SM_CONF_CANT_SETRGID
+ || getgid() != RunAsGid
+#endif /* !SM_CONF_CANT_SETRGID */
+ )
+ {
+ syserr("drop_privileges: Unable to drop set-group-ID privileges");
+ rval = EX_OSERR;
+ }
}
if (to_real_uid || RunAsUid != 0)
{
@@ -3356,6 +3533,20 @@ drop_privileges(to_real_uid)
rval = EX_OSERR;
}
}
+
+ if ((to_real_uid || RunAsGid != 0) &&
+ rval == EX_OK && RunAsGid != EffGid &&
+ getuid() != 0 && geteuid() != 0)
+ {
+ errno = 0;
+ if (setgid(EffGid) == 0)
+ {
+ syserr("drop_privileges: setgid(%d) succeeded (when it should not)",
+ (int) EffGid);
+ rval = EX_OSERR;
+ }
+ }
+
if (tTd(47, 5))
{
sm_dprintf("drop_privileges: e/ruid = %d/%d e/rgid = %d/%d\n",
@@ -3368,7 +3559,7 @@ drop_privileges(to_real_uid)
}
return rval;
}
- /*
+/*
** FILL_FD -- make sure a file descriptor has been properly allocated
**
** Used to make sure that stdin/out/err are allocated on startup
@@ -3413,7 +3604,7 @@ fill_fd(fd, where)
(void) close(i);
}
}
- /*
+/*
** SM_PRINTOPTIONS -- print options
**
** Parameters:
@@ -3448,7 +3639,7 @@ sm_printoptions(options)
}
sm_dprintf("\n");
}
- /*
+/*
** TESTMODELINE -- process a test mode input line
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/map.c b/gnu/usr.sbin/sendmail/sendmail/map.c
index 8f6c303141c..615d4073484 100644
--- a/gnu/usr.sbin/sendmail/sendmail/map.c
+++ b/gnu/usr.sbin/sendmail/sendmail/map.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: map.c,v 8.601 2001/09/04 22:43:03 ca Exp $")
+SM_RCSID("@(#)$Sendmail: map.c,v 8.606 2001/09/25 18:32:36 gshapiro Exp $")
#if LDAPMAP
# include <sm/ldap.h>
@@ -129,7 +129,7 @@ static bool text_getcanonname __P((char *, int, int *));
# define LOCK_ON_OPEN 0 /* no such luck -- bend over backwards */
#endif /* O_EXLOCK && HASFLOCK && !BOGUS_O_EXCL */
- /*
+/*
** MAP_PARSEARGS -- parse config line arguments for database lookup
**
** This is a generic version of the map_parse method.
@@ -293,7 +293,7 @@ map_parseargs(map, ap)
}
return true;
}
- /*
+/*
** MAP_REWRITE -- rewrite a database key, interpolating %n indications.
**
** It also adds the map_app string. It can be used as a utility
@@ -421,7 +421,7 @@ map_rewrite(map, s, slen, av)
sm_dprintf("map_rewrite => %s\n", buf);
return buf;
}
- /*
+/*
** INITMAPS -- rebuild alias maps
**
** Parameters:
@@ -442,7 +442,7 @@ initmaps()
checkfd012("exiting initmaps");
#endif /* XDEBUG */
}
- /*
+/*
** MAP_INIT -- rebuild a map
**
** Parameters:
@@ -498,7 +498,7 @@ map_init(s, unused)
(void) rebuildaliases(map, false);
return;
}
- /*
+/*
** OPENMAP -- open a map
**
** Parameters:
@@ -584,7 +584,7 @@ openmap(map)
return bitset(MF_OPEN, map->map_mflags);
}
- /*
+/*
** CLOSEMAPS -- close all open maps opened by the current pid.
**
** Parameters:
@@ -600,7 +600,7 @@ closemaps(bogus)
{
stabapply(map_close, bogus);
}
- /*
+/*
** MAP_CLOSE -- close a map opened by the current pid.
**
** Parameters:
@@ -657,7 +657,7 @@ map_close(s, bogus)
}
map->map_mflags &= ~(MF_OPEN|MF_WRITABLE|MF_OPENBOGUS|MF_CLOSING);
}
- /*
+/*
** GETCANONNAME -- look up name using service switch
**
** Parameters:
@@ -798,7 +798,7 @@ getcanonname(host, hbsize, trymx, pttl)
return false;
}
- /*
+/*
** EXTRACT_CANONNAME -- extract canonical name from /etc/hosts entry
**
** Parameters:
@@ -870,7 +870,7 @@ extract_canonname(name, dot, line, cbuf, cbuflen)
return found;
}
- /*
+/*
** DNS modules
*/
@@ -928,15 +928,21 @@ dns_map_open(map, mode)
# endif /* _FFR_DNSMAP_MULTILIMIT */
# endif /* _FFR_DNSMAP_MULTI */
+struct dns_map
+{
+ int dns_m_type;
+};
+
bool
dns_map_parseargs(map,args)
MAP *map;
char *args;
{
register char *p = args;
- int dns_m_type;
+ struct dns_map *map_p;
- dns_m_type = -1;
+ map_p = (struct dns_map *) xalloc(sizeof *map_p);
+ map_p->dns_m_type = -1;
map->map_mflags |= MF_TRY0NULL|MF_TRY1NULL;
for (;;)
@@ -1049,10 +1055,10 @@ dns_map_parseargs(map,args)
h = strchr(p, ' ');
if (h != NULL)
*h = '\0';
- dns_m_type = dns_string_to_type(p);
+ map_p->dns_m_type = dns_string_to_type(p);
if (h != NULL)
*h = ' ';
- if (dns_m_type < 0)
+ if (map_p->dns_m_type < 0)
syserr("dns map %s: wrong type %s",
map->map_mname, p);
}
@@ -1087,7 +1093,7 @@ dns_map_parseargs(map,args)
if (*p != '\0')
*p++ = '\0';
}
- if (dns_m_type < 0)
+ if (map_p->dns_m_type < 0)
syserr("dns map %s: missing -R type", map->map_mname);
if (map->map_app != NULL)
map->map_app = newstr(map->map_app);
@@ -1100,7 +1106,7 @@ dns_map_parseargs(map,args)
** so it doesn't really matter.
*/
- map->map_db1 = (ARBPTR_T) dns_m_type;
+ map->map_db1 = (ARBPTR_T) map_p;
return true;
}
@@ -1130,9 +1136,9 @@ dns_map_lookup(map, name, av, statp)
int resnum = 0;
# endif /* _FFR_DNSMAP_MULTILIMIT */
# endif /* _FFR_DNSMAP_MULTI */
- int dns_m_type = (int) map->map_db1;
char *vp = NULL, *result = NULL;
size_t vsize;
+ struct dns_map *map_p;
RESOURCE_RECORD_T *rr = NULL;
DNS_REPLY_T *r = NULL;
# if NETINET6
@@ -1143,6 +1149,7 @@ dns_map_lookup(map, name, av, statp)
sm_dprintf("dns_map_lookup(%s, %s)\n",
map->map_mname, name);
+ map_p = (struct dns_map *)(map->map_db1);
# if _FFR_DNSMAP_BASE
if (map->map_file != NULL && *map->map_file != '\0')
{
@@ -1157,15 +1164,15 @@ dns_map_lookup(map, name, av, statp)
return NULL;
}
(void) sm_strlcpyn(appdomain, len, 3, name, ".", map->map_file);
- r = dns_lookup_int(appdomain, C_IN, dns_m_type,
+ r = dns_lookup_int(appdomain, C_IN, map_p->dns_m_type,
map->map_timeout, map->map_retry);
sm_free(appdomain);
}
else
# endif /* _FFR_DNSMAP_BASE */
{
- r = dns_lookup_int(name, C_IN, dns_m_type, map->map_timeout,
- map->map_retry);
+ r = dns_lookup_int(name, C_IN, map_p->dns_m_type,
+ map->map_timeout, map->map_retry);
}
if (r == NULL)
@@ -1229,7 +1236,7 @@ dns_map_lookup(map, name, av, statp)
# endif /* NETINET6 */
}
- if (dns_m_type != rr->rr_type)
+ if (map_p->dns_m_type != rr->rr_type)
{
if (tTd(38, 40))
sm_dprintf("\tskipping type %s (%d) value %s\n",
@@ -1330,7 +1337,7 @@ dns_map_lookup(map, name, av, statp)
# endif /* DNSMAP */
#endif /* NAMED_BIND */
- /*
+/*
** NDBM modules
*/
@@ -1822,7 +1829,7 @@ ndbm_map_close(map)
}
#endif /* NDBM */
- /*
+/*
** NEWDB (Hash and BTree) Modules
*/
@@ -2531,7 +2538,7 @@ db_map_close(map)
map->map_mname, map->map_file, map->map_mflags);
}
#endif /* NEWDB */
- /*
+/*
** NIS Modules
*/
@@ -2764,6 +2771,9 @@ nis_getcanonname(name, hbsize, statp)
sm_free(vp);
if (tTd(38, 44))
sm_dprintf("got record `%s'\n", host_record);
+ vp = strpbrk(host_record, "#\n");
+ if (vp != NULL)
+ *vp = '\0';
if (!extract_canonname(nbuf, NULL, host_record, cbuf, sizeof cbuf))
{
/* this should not happen, but.... */
@@ -2780,7 +2790,7 @@ nis_getcanonname(name, hbsize, statp)
}
#endif /* NIS */
- /*
+/*
** NISPLUS Modules
**
** This code donated by Sun Microsystems.
@@ -3211,7 +3221,7 @@ nisplus_default_domain()
}
#endif /* NISPLUS */
- /*
+/*
** LDAP Modules
*/
@@ -3962,7 +3972,7 @@ ldapmap_findconn(lmap)
SM_END_TRY
return s;
}
- /*
+/*
** LDAPMAP_PARSEARGS -- parse ldap map definition args.
*/
@@ -4557,7 +4567,7 @@ ldapmap_parseargs(map, args)
return true;
}
- /*
+/*
** LDAPMAP_SET_DEFAULTS -- Read default map spec from LDAPDefaults in .cf
**
** Parameters:
@@ -4620,7 +4630,7 @@ ldapmap_set_defaults(spec)
}
}
#endif /* LDAPMAP */
- /*
+/*
** PH map
*/
@@ -4856,7 +4866,7 @@ ph_map_recv_debug(text)
sm_dprintf("ph_map_recv_debug: <== %s\n", text);
}
- /*
+/*
** PH_MAP_OPEN -- sub for opening PH map
*/
bool
@@ -5032,7 +5042,7 @@ ph_map_lookup(map, key, args, pstat)
return NULL;
}
#endif /* PH_MAP */
- /*
+/*
** syslog map
*/
@@ -5170,7 +5180,7 @@ syslog_map_lookup(map, string, args, statp)
return "";
}
- /*
+/*
** HESIOD Modules
*/
@@ -5335,7 +5345,7 @@ hes_map_close(map)
}
#endif /* HESIOD */
- /*
+/*
** NeXT NETINFO Modules
*/
@@ -5461,7 +5471,7 @@ ni_getcanonname(name, hbsize, statp)
return false;
}
#endif /* NETINFO */
- /*
+/*
** TEXT (unindexed text file) Modules
**
** This code donated by Sun Microsystems.
@@ -5712,7 +5722,7 @@ text_getcanonname(name, hbsize, statp)
*statp = EX_OK;
return true;
}
- /*
+/*
** STAB (Symbol Table) Modules
*/
@@ -5804,7 +5814,7 @@ stab_map_open(map, mode)
return true;
}
- /*
+/*
** Implicit Modules
**
** Tries several types. For back compatibility of aliases.
@@ -5941,7 +5951,7 @@ impl_map_close(map)
}
#endif /* NDBM */
}
- /*
+/*
** User map class.
**
** Provides access to the system password file.
@@ -6063,7 +6073,7 @@ user_map_lookup(map, key, av, statp)
return map_rewrite(map, rwval, strlen(rwval), av);
}
}
- /*
+/*
** Program map type.
**
** This provides access to arbitrary programs. It should be used
@@ -6187,7 +6197,7 @@ prog_map_lookup(map, name, av, statp)
}
return rval;
}
- /*
+/*
** Sequenced map type.
**
** Tries each map in order until something matches, much like
@@ -6434,7 +6444,7 @@ seq_map_store(map, key, val)
syserr("seq_map_store(%s, %s, %s): no writable map",
map->map_mname, key, val);
}
- /*
+/*
** NULL stubs
*/
@@ -6497,7 +6507,7 @@ MAPCLASS BogusMapClass =
NULL, bogus_map_lookup, null_map_store,
null_map_open, null_map_close,
};
- /*
+/*
** MACRO modules
*/
@@ -6530,7 +6540,7 @@ macro_map_lookup(map, name, av, statp)
*statp = EX_OK;
return "";
}
- /*
+/*
** REGEX modules
*/
@@ -6907,7 +6917,7 @@ regex_map_lookup(map, name, av, statp)
return regex_map_rewrite(map, "", (size_t)0, av);
}
#endif /* MAP_REGEX */
- /*
+/*
** NSD modules
*/
#if MAP_NSD
diff --git a/gnu/usr.sbin/sendmail/sendmail/mci.c b/gnu/usr.sbin/sendmail/sendmail/mci.c
index 4ae5f6db929..5b5629b9567 100644
--- a/gnu/usr.sbin/sendmail/sendmail/mci.c
+++ b/gnu/usr.sbin/sendmail/sendmail/mci.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: mci.c,v 8.196 2001/09/04 22:43:04 ca Exp $")
+SM_RCSID("@(#)$Sendmail: mci.c,v 8.200 2001/09/21 20:01:42 ca Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@@ -61,7 +61,7 @@ static int mci_read_persistent __P((SM_FILE_T *, MCI *));
static MCI **MciCache; /* the open connection cache */
- /*
+/*
** MCI_CACHE -- enter a connection structure into the open connection cache
**
** This may cause something else to be flushed.
@@ -114,7 +114,7 @@ mci_cache(mci)
*mcislot = mci;
mci->mci_flags |= MCIF_CACHED;
}
- /*
+/*
** MCI_SCAN -- scan the cache, flush junk, and return best slot
**
** Parameters:
@@ -177,7 +177,7 @@ mci_scan(savemci)
}
return bestmci;
}
- /*
+/*
** MCI_UNCACHE -- remove a connection from a slot.
**
** May close a connection.
@@ -262,7 +262,7 @@ mci_uncache(mcislot, doquit)
mci->mci_rpool = NULL;
}
}
- /*
+/*
** MCI_FLUSH -- flush the entire cache
**
** Parameters:
@@ -290,7 +290,7 @@ mci_flush(doquit, allbut)
mci_uncache(&MciCache[i], doquit);
}
}
- /*
+/*
** MCI_GET -- get information about a particular host
**
** Parameters:
@@ -398,7 +398,7 @@ mci_get(host, m)
return mci;
}
- /*
+/*
** MCI_NEW -- allocate new MCI structure
**
** Parameters:
@@ -423,7 +423,7 @@ mci_new(rpool)
mci->mci_macro.mac_rpool = mci->mci_rpool;
return mci;
}
- /*
+/*
** MCI_MATCH -- check connection cache for a particular host
**
** Parameters:
@@ -451,7 +451,7 @@ mci_match(host, m)
mci = &s->s_mci;
return mci->mci_state == MCIS_OPEN;
}
- /*
+/*
** MCI_SETSTAT -- set status codes in MCI structure.
**
** Parameters:
@@ -483,7 +483,7 @@ mci_setstat(mci, xstat, dstat, rstat)
if (rstat != NULL)
mci->mci_rstatus = sm_strdup_x(rstat);
}
- /*
+/*
** MCI_DUMP -- dump the contents of an MCI structure.
**
** Parameters:
@@ -590,7 +590,7 @@ printit:
else
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "%s\n", buf);
}
- /*
+/*
** MCI_DUMP_ALL -- print the entire MCI cache
**
** Parameters:
@@ -613,7 +613,7 @@ mci_dump_all(logit)
for (i = 0; i < MaxMciCache; i++)
mci_dump(MciCache[i], logit);
}
- /*
+/*
** MCI_LOCK_HOST -- Lock host while sending.
**
** If we are contacting a host, we'll need to
@@ -704,7 +704,7 @@ cleanup:
errno = save_errno;
return retVal;
}
- /*
+/*
** MCI_UNLOCK_HOST -- unlock host
**
** Clean up the lock on a host, close the file, let
@@ -753,7 +753,7 @@ mci_unlock_host(mci)
errno = save_errno;
}
- /*
+/*
** MCI_LOAD_PERSISTENT -- load persistent host info
**
** Load information about host that is kept
@@ -830,7 +830,7 @@ cleanup:
errno = save_errno;
return locked;
}
- /*
+/*
** MCI_READ_PERSISTENT -- read persistent host status file
**
** Parameters:
@@ -932,7 +932,7 @@ mci_read_persistent(fp, mci)
return -1;
return 0;
}
- /*
+/*
** MCI_STORE_PERSISTENT -- Store persistent MCI information
**
** Store information about host that is kept
@@ -1002,7 +1002,7 @@ mci_store_persistent(mci)
errno = save_errno;
return;
}
- /*
+/*
** MCI_TRAVERSE_PERSISTENT -- walk persistent status tree
**
** Recursively find all the mci host files in `pathname'. Default to
@@ -1174,7 +1174,7 @@ mci_traverse_persistent(action, pathname)
return ret;
}
- /*
+/*
** MCI_PRINT_PERSISTENT -- print persistent info
**
** Dump the persistent information in the file 'pathname'
@@ -1234,7 +1234,7 @@ mci_print_persistent(pathname, hostname)
}
locked = !lockfile(sm_io_getinfo(fp, SM_IO_WHAT_FD, NULL), pathname,
- "", LOCK_EX|LOCK_NB);
+ "", LOCK_SH|LOCK_NB);
(void) sm_io_close(fp, SM_TIME_DEFAULT);
FileName = NULL;
@@ -1274,7 +1274,7 @@ mci_print_persistent(pathname, hostname)
return 0;
}
- /*
+/*
** MCI_PURGE_PERSISTENT -- Remove a persistence status file.
**
** Parameters:
@@ -1340,7 +1340,7 @@ mci_purge_persistent(pathname, hostname)
return 0;
}
- /*
+/*
** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
**
** Given `host', convert from a.b.c to $QueueDir/.hoststat/c./b./a,
diff --git a/gnu/usr.sbin/sendmail/sendmail/milter.c b/gnu/usr.sbin/sendmail/sendmail/milter.c
index 4ece61ff1e7..d1606540f70 100644
--- a/gnu/usr.sbin/sendmail/sendmail/milter.c
+++ b/gnu/usr.sbin/sendmail/sendmail/milter.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: milter.c,v 8.173 2001/09/04 22:43:04 ca Exp $")
+SM_RCSID("@(#)$Sendmail: milter.c,v 8.180 2001/09/17 20:39:57 gshapiro Exp $")
#if MILTER
# include <libmilter/mfapi.h>
@@ -199,7 +199,7 @@ static char *MilterEnvRcptMacros[MAXFILTERMACROS + 1];
** Low level functions
*/
- /*
+/*
** MILTER_READ -- read from a remote milter filter
**
** Parameters:
@@ -382,7 +382,7 @@ milter_read(m, cmd, rlen, to, e)
*rlen = expl;
return buf;
}
- /*
+/*
** MILTER_WRITE -- write to a remote milter filter
**
** Parameters:
@@ -517,7 +517,7 @@ milter_write(m, cmd, buf, len, to, e)
** Utility functions
*/
- /*
+/*
** MILTER_OPEN -- connect to remote milter filter
**
** Parameters:
@@ -1084,7 +1084,7 @@ milter_connect_timeout()
errno = ETIMEDOUT;
longjmp(MilterConnectTimeout, 1);
}
- /*
+/*
** MILTER_SETUP -- setup structure for a mail filter
**
** Parameters:
@@ -1189,7 +1189,7 @@ milter_setup(line)
else
s->s_milter = m;
}
- /*
+/*
** MILTER_CONFIG -- parse option list into an array and check config
**
** Called when reading configuration file.
@@ -1255,7 +1255,7 @@ milter_config(spec, list, max)
if (MilterLogLevel == -1)
MilterLogLevel = LogLevel;
}
- /*
+/*
** MILTER_PARSE_TIMEOUTS -- parse timeout list
**
** Called when reading configuration file.
@@ -1348,7 +1348,7 @@ milter_parse_timeouts(spec, m)
p = delimptr;
}
}
- /*
+/*
** MILTER_SET_OPTION -- set an individual milter option
**
** Parameters:
@@ -1488,8 +1488,8 @@ milter_set_option(name, val, sticky)
if (sticky)
setbitn(mo->mo_code, StickyMilterOpt);
}
- /*
-** MILTER_REOPEN_DF -- open & truncate the df file (for replbody)
+/*
+** MILTER_REOPEN_DF -- open & truncate the data file (for replbody)
**
** Parameters:
** e -- current envelope.
@@ -1504,7 +1504,7 @@ milter_reopen_df(e)
{
char dfname[MAXPATHLEN];
- (void) sm_strlcpy(dfname, queuename(e, 'd'), sizeof dfname);
+ (void) sm_strlcpy(dfname, queuename(e, DATAFL_LETTER), sizeof dfname);
/*
** In SuperSafe == SAFE_REALLY mode, e->e_dfp is a read-only FP so
@@ -1519,7 +1519,7 @@ milter_reopen_df(e)
if (SuperSafe == SAFE_REALLY)
{
- /* close read-only df */
+ /* close read-only data file */
if (bitset(EF_HAS_DF, e->e_flags) && e->e_dfp != NULL)
{
(void) sm_io_close(e->e_dfp, SM_TIME_DEFAULT);
@@ -1543,8 +1543,8 @@ milter_reopen_df(e)
}
return 0;
}
- /*
-** MILTER_RESET_DF -- re-open read-only the df file (for replbody)
+/*
+** MILTER_RESET_DF -- re-open read-only the data file (for replbody)
**
** Parameters:
** e -- current envelope.
@@ -1560,7 +1560,7 @@ milter_reset_df(e)
int afd;
char dfname[MAXPATHLEN];
- (void) sm_strlcpy(dfname, queuename(e, 'd'), sizeof dfname);
+ (void) sm_strlcpy(dfname, queuename(e, DATAFL_LETTER), sizeof dfname);
if (sm_io_flush(e->e_dfp, SM_TIME_DEFAULT) != 0 ||
sm_io_error(e->e_dfp))
@@ -1594,7 +1594,7 @@ milter_reset_df(e)
e->e_flags |= EF_HAS_DF;
return 0;
}
- /*
+/*
** MILTER_CAN_DELRCPTS -- can any milter filters delete recipients?
**
** Parameters:
@@ -1628,7 +1628,7 @@ milter_can_delrcpts()
return can;
}
- /*
+/*
** MILTER_QUIT_FILTER -- close down a single filter
**
** Parameters:
@@ -1673,7 +1673,7 @@ milter_quit_filter(m, e)
if (m->mf_state != SMFS_ERROR)
m->mf_state = SMFS_CLOSED;
}
- /*
+/*
** MILTER_ABORT_FILTER -- tell filter to abort current message
**
** Parameters:
@@ -1704,7 +1704,7 @@ milter_abort_filter(m, e)
if (m->mf_state != SMFS_ERROR)
m->mf_state = SMFS_DONE;
}
- /*
+/*
** MILTER_SEND_MACROS -- provide macros to the filters
**
** Parameters:
@@ -1776,7 +1776,7 @@ milter_send_macros(m, macros, cmd, e)
sm_free(buf); /* XXX */
}
- /*
+/*
** MILTER_SEND_COMMAND -- send a command and return the response for a filter
**
** Parameters:
@@ -1941,7 +1941,7 @@ milter_send_command(m, command, data, sz, e, state)
return response;
}
- /*
+/*
** MILTER_COMMAND -- send a command and return the response for each filter
**
** Parameters:
@@ -2019,7 +2019,7 @@ milter_command(command, data, sz, macros, e, state)
}
return response;
}
- /*
+/*
** MILTER_NEGOTIATE -- get version and flags from filter
**
** Parameters:
@@ -2185,7 +2185,7 @@ milter_negotiate(m, e)
m->mf_name, m->mf_fvers, m->mf_fflags, m->mf_pflags);
return 0;
}
- /*
+/*
** MILTER_PER_CONNECTION_CHECK -- checks on per-connection commands
**
** Reduce code duplication by putting these checks in one place
@@ -2212,7 +2212,7 @@ milter_per_connection_check(e)
milter_quit_filter(m, e);
}
}
- /*
+/*
** MILTER_ERROR -- Put a milter filter into error state
**
** Parameters:
@@ -2245,7 +2245,7 @@ milter_error(m, e)
sm_syslog(LOG_INFO, e->e_id, "Milter (%s): to error state",
m->mf_name);
}
- /*
+/*
** MILTER_HEADERS -- send headers to a single milter filter
**
** Parameters:
@@ -2315,7 +2315,7 @@ milter_headers(m, e, state)
m->mf_name);
return response;
}
- /*
+/*
** MILTER_BODY -- send the body to a filter
**
** Parameters:
@@ -2347,8 +2347,9 @@ milter_body(m, e, state)
{
ExitStat = EX_IOERR;
*state = SMFIR_TEMPFAIL;
- syserr("milter_body: %s/df%s: rewind error",
- qid_printqueue(e->e_qgrp, e->e_qdir), e->e_id);
+ syserr("milter_body: %s/%cf%s: rewind error",
+ qid_printqueue(e->e_qgrp, e->e_qdir),
+ DATAFL_LETTER, e->e_id);
return NULL;
}
@@ -2416,8 +2417,9 @@ milter_body(m, e, state)
response = NULL;
}
}
- syserr("milter_body: %s/df%s: read error",
- qid_printqueue(e->e_qgrp, e->e_qdir), e->e_id);
+ syserr("milter_body: %s/%cf%s: read error",
+ qid_printqueue(e->e_qgrp, e->e_qdir),
+ DATAFL_LETTER, e->e_id);
return response;
}
@@ -2442,7 +2444,7 @@ milter_body(m, e, state)
** Actions
*/
- /*
+/*
** MILTER_ADDHEADER -- Add the supplied header to the message
**
** Parameters:
@@ -2532,7 +2534,7 @@ milter_addheader(response, rlen, e)
addheader(newstr(response), val, H_USER, e);
}
}
- /*
+/*
** MILTER_CHANGEHEADER -- Change the supplied header in the message
**
** Parameters:
@@ -2701,7 +2703,7 @@ milter_changeheader(response, rlen, e)
e->e_msgsize += strlen(h->h_value);
}
}
- /*
+/*
** MILTER_ADDRCPT -- Add the supplied recipient to the message
**
** Parameters:
@@ -2746,7 +2748,7 @@ milter_addrcpt(response, rlen, e)
(void) sendtolist(response, NULLADDR, &e->e_sendqueue, 0, e);
return;
}
- /*
+/*
** MILTER_DELRCPT -- Delete the supplied recipient from the message
**
** Parameters:
@@ -2791,8 +2793,8 @@ milter_delrcpt(response, rlen, e)
(void) removefromlist(response, &e->e_sendqueue, e);
return;
}
- /*
-** MILTER_REPLBODY -- Replace the current df file with new body
+/*
+** MILTER_REPLBODY -- Replace the current data file with new body
**
** Parameters:
** response -- encoded form of new body.
@@ -2817,18 +2819,19 @@ milter_replbody(response, rlen, newfilter, e)
if (tTd(64, 10))
sm_dprintf("milter_replbody\n");
- /* If a new filter, reset previous character and truncate df */
+ /* If a new filter, reset previous character and truncate data file */
if (newfilter)
{
off_t prevsize = 0;
char dfname[MAXPATHLEN];
- (void) sm_strlcpy(dfname, queuename(e, 'd'), sizeof dfname);
+ (void) sm_strlcpy(dfname, queuename(e, DATAFL_LETTER),
+ sizeof dfname);
/* Reset prevchar */
prevchar = '\0';
- /* Get the current df information */
+ /* Get the current data file information */
if (bitset(EF_HAS_DF, e->e_flags) && e->e_dfp != NULL)
{
int afd;
@@ -2839,7 +2842,7 @@ milter_replbody(response, rlen, newfilter, e)
prevsize = st.st_size;
}
- /* truncate current df file */
+ /* truncate current data file */
if (sm_io_getinfo(e->e_dfp, SM_IO_WHAT_ISTYPE, BF_FILE_TYPE))
{
if (sm_io_setinfo(e->e_dfp, SM_BF_TRUNCATE, NULL) < 0)
@@ -2943,7 +2946,7 @@ milter_replbody(response, rlen, newfilter, e)
** MTA callouts
*/
- /*
+/*
** MILTER_INIT -- open and negotiate with all of the filters
**
** Parameters:
@@ -3023,7 +3026,7 @@ milter_init(e, state)
return true;
}
- /*
+/*
** MILTER_CONNECT -- send connection info to milter filters
**
** Parameters:
@@ -3157,7 +3160,7 @@ milter_connect(hostname, addr, e, state)
}
return response;
}
- /*
+/*
** MILTER_HELO -- send SMTP HELO/EHLO command info to milter filters
**
** Parameters:
@@ -3205,7 +3208,7 @@ milter_helo(helo, e, state)
milter_per_connection_check(e);
return response;
}
- /*
+/*
** MILTER_ENVFROM -- send SMTP MAIL command info to milter filters
**
** Parameters:
@@ -3303,7 +3306,7 @@ milter_envfrom(args, e, state)
sm_syslog(LOG_INFO, e->e_id, "Milter: reject, senders");
return response;
}
- /*
+/*
** MILTER_ENVRCPT -- send SMTP RCPT command info to milter filters
**
** Parameters:
@@ -3371,7 +3374,7 @@ milter_envrcpt(args, e, state)
sm_free(buf); /* XXX */
return response;
}
- /*
+/*
** MILTER_DATA -- send message headers/body and gather final message results
**
** Parameters:
@@ -3409,8 +3412,8 @@ milter_data(e, state)
{
bool replbody = false; /* milter_replbody() called? */
bool replfailed = false; /* milter_replbody() failed? */
- bool rewind = false; /* rewind df file? */
- bool dfopen = false; /* df open for writing? */
+ bool rewind = false; /* rewind data file? */
+ bool dfopen = false; /* data file open for writing? */
bool newfilter; /* reset on each new filter */
char rcmd;
int i;
@@ -3558,6 +3561,28 @@ milter_data(e, state)
case SMFIR_PROGRESS:
break;
+# if _FFR_QUARANTINE
+ case SMFIR_QUARANTINE:
+ if (!bitset(SMFIF_QUARANTINE, m->mf_fflags))
+ {
+ if (MilterLogLevel > 9)
+ sm_syslog(LOG_WARNING, e->e_id,
+ "milter_data(%s): lied about quarantining, honoring request anyway",
+ m->mf_name);
+ }
+ if (response == NULL)
+ response = newstr("");
+ if (MilterLogLevel > 8)
+ sm_syslog(LOG_INFO, e->e_id,
+ "Milter: quarantine: %s",
+ response);
+ e->e_holdmsg = sm_rpool_strdup_x(e->e_rpool,
+ response);
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), e->e_holdmsg);
+ break;
+# endif /* _FFR_QUARANTINE */
+
case SMFIR_ADDHEADER:
if (!bitset(SMFIF_ADDHDRS, m->mf_fflags))
{
@@ -3708,8 +3733,9 @@ finishup:
}
errno = save_errno;
- syserr("milter_data: %s/df%s: read error",
- qid_printqueue(e->e_qgrp, e->e_qdir), e->e_id);
+ syserr("milter_data: %s/%cf%s: read error",
+ qid_printqueue(e->e_qgrp, e->e_qdir),
+ DATAFL_LETTER, e->e_id);
}
MILTER_CHECK_DONE_MSG();
@@ -3717,7 +3743,7 @@ finishup:
sm_syslog(LOG_INFO, e->e_id, "Milter: reject, data");
return response;
}
- /*
+/*
** MILTER_QUIT -- informs the filter(s) we are done and closes connection(s)
**
** Parameters:
@@ -3739,7 +3765,7 @@ milter_quit(e)
for (i = 0; InputFilters[i] != NULL; i++)
milter_quit_filter(InputFilters[i], e);
}
- /*
+/*
** MILTER_ABORT -- informs the filter(s) that we are aborting current message
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/mime.c b/gnu/usr.sbin/sendmail/sendmail/mime.c
index 00fa1e07a07..0ea6af4fb4c 100644
--- a/gnu/usr.sbin/sendmail/sendmail/mime.c
+++ b/gnu/usr.sbin/sendmail/sendmail/mime.c
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <string.h>
-SM_RCSID("@(#)$Sendmail: mime.c,v 8.121 2001/09/04 22:43:04 ca Exp $")
+SM_RCSID("@(#)$Sendmail: mime.c,v 8.125 2001/09/11 04:05:15 gshapiro Exp $")
/*
** MIME support.
@@ -56,7 +56,7 @@ static char *MimeBoundaryNames[] =
static bool MapNLtoCRLF;
- /*
+/*
** MIME8TO7 -- output 8 bit body in 7 bit format
**
** The header has already been output -- this has to do the
@@ -399,7 +399,8 @@ mime8to7(mci, header, e, boundaries, flags)
/* remember where we were */
offset = sm_io_tell(e->e_dfp, SM_TIME_DEFAULT);
if (offset == -1)
- syserr("mime8to7: cannot sm_io_tell on df%s", e->e_id);
+ syserr("mime8to7: cannot sm_io_tell on %cf%s",
+ DATAFL_LETTER, e->e_id);
/* do a scan of this body type to count character types */
while (sm_io_fgets(e->e_dfp, SM_TIME_DEFAULT, buf, sizeof buf)
@@ -429,7 +430,8 @@ mime8to7(mci, header, e, boundaries, flags)
/* return to the original offset for processing */
/* XXX use relative seeks to handle >31 bit file sizes? */
if (sm_io_seek(e->e_dfp, SM_TIME_DEFAULT, offset, SEEK_SET) < 0)
- syserr("mime8to7: cannot sm_io_fseek on df%s", e->e_id);
+ syserr("mime8to7: cannot sm_io_fseek on %cf%s",
+ DATAFL_LETTER, e->e_id);
else
sm_io_clearerr(e->e_dfp);
}
@@ -665,7 +667,7 @@ mime8to7(mci, header, e, boundaries, flags)
sm_dprintf("\t\t\tmime8to7=>%s (basic)\n", MimeBoundaryNames[bt]);
return bt;
}
- /*
+/*
** MIME_GETCHAR -- get a character for MIME processing
**
** Treats boundaries as SM_IO_EOF.
@@ -774,7 +776,7 @@ mime_getchar(fp, boundaries, btp)
bp = buf;
return *bp++;
}
- /*
+/*
** MIME_GETCHAR_CRLF -- do mime_getchar, but translate NL => CRLF
**
** Parameters:
@@ -809,7 +811,7 @@ mime_getchar_crlf(fp, boundaries, btp)
}
return c;
}
- /*
+/*
** MIMEBOUNDARY -- determine if this line is a MIME boundary & its type
**
** Parameters:
@@ -865,7 +867,7 @@ mimeboundary(line, boundaries)
sm_dprintf("%s\n", MimeBoundaryNames[type]);
return type;
}
- /*
+/*
** DEFCHARSET -- return default character set for message
**
** The first choice for character set is for the mailer
@@ -892,7 +894,7 @@ defcharset(e)
return DefaultCharSet;
return "unknown-8bit";
}
- /*
+/*
** ISBOUNDARY -- is a given string a currently valid boundary?
**
** Parameters:
@@ -920,7 +922,7 @@ isboundary(line, boundaries)
return -1;
}
#endif /* MIME8TO7 */
-
+
#if MIME7TO8
static int mime_fromqp __P((unsigned char *, unsigned char **, int, int));
@@ -1124,7 +1126,7 @@ mime7to8(mci, header, e)
if (tTd(43, 3))
sm_dprintf("\t\t\tmime7to8 => %s to 8bit done\n", cte);
}
- /*
+/*
** The following is based on Borenstein's "codes.c" module, with simplifying
** changes as we do not deal with multipart, and to do the translation in-core,
** with an attempt to prevent overrun of output buffers.
diff --git a/gnu/usr.sbin/sendmail/sendmail/parseaddr.c b/gnu/usr.sbin/sendmail/sendmail/parseaddr.c
index 30267fc36f4..09261dbf956 100644
--- a/gnu/usr.sbin/sendmail/sendmail/parseaddr.c
+++ b/gnu/usr.sbin/sendmail/sendmail/parseaddr.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: parseaddr.c,v 8.340 2001/09/04 22:43:04 ca Exp $")
+SM_RCSID("@(#)$Sendmail: parseaddr.c,v 8.344 2001/09/20 23:08:06 gshapiro Exp $")
static void allocaddr __P((ADDRESS *, int, char *, ENVELOPE *));
static int callsubr __P((char**, int, ENVELOPE *));
@@ -219,7 +219,7 @@ parseaddr(addr, a, flags, delim, delimptr, e, isrcpt)
return a;
}
- /*
+/*
** INVALIDADDR -- check for address containing characters used for macros
**
** Parameters:
@@ -279,7 +279,7 @@ delim:
*delimptr = savedelim; /* restore old character at delimptr */
return result;
}
- /*
+/*
** HASCTRLCHAR -- check for address containing meta-characters
**
** Checks that the address contains no meta-characters, and contains
@@ -350,7 +350,7 @@ hasctrlchar(addr, isrcpt)
}
return result;
}
- /*
+/*
** ALLOCADDR -- do local allocations of address on demand.
**
** Also lowercases the host name if requested.
@@ -397,7 +397,7 @@ allocaddr(a, flags, paddr, e)
a->q_paddr = sm_rpool_strdup_x(e->e_rpool, a->q_user);
a->q_qgrp = NOAQGRP;
}
- /*
+/*
** PRESCAN -- Prescan name and make it canonical
**
** Scans a name and turns it into a set of tokens. This process
@@ -852,7 +852,7 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
}
return av;
}
- /*
+/*
** REWRITE -- apply rewrite rules to token vector.
**
** This routine is an ordered production system. Each rewrite
@@ -1524,7 +1524,7 @@ rewrite(pvp, ruleset, reclevel, e, maxatom)
}
return rstat;
}
- /*
+/*
** CALLSUBR -- call subroutines in rewrite vector
**
** Parameters:
@@ -1635,7 +1635,7 @@ callsubr(pvp, reclevel, e)
}
return rstat;
}
- /*
+/*
** MAP_LOOKUP -- do lookup in map
**
** Parameters:
@@ -1740,7 +1740,7 @@ map_lookup(smap, key, argvect, pstat, e)
}
return replac;
}
- /*
+/*
** INITERRMAILERS -- initialize error and discard mailers
**
** Parameters:
@@ -1776,7 +1776,7 @@ initerrmailers()
errormailer.m_argv = errorargv;
}
}
- /*
+/*
** BUILDADDR -- build address from token vector.
**
** Parameters:
@@ -2030,7 +2030,7 @@ badaddr:
}
return a;
}
- /*
+/*
** CATADDR -- concatenate pieces of addresses (putting in <LWSP> subs)
**
** Parameters:
@@ -2094,7 +2094,7 @@ cataddr(pvp, evp, buf, sz, spacesub)
}
*p = '\0';
}
- /*
+/*
** SAMEADDR -- Determine if two addresses are the same
**
** This is not just a straight comparison -- if the mailer doesn't
@@ -2153,7 +2153,7 @@ sameaddr(a, b)
return true;
}
- /*
+/*
** PRINTADDR -- print address (for debugging)
**
** Parameters:
@@ -2357,7 +2357,7 @@ printaddr(a, follow)
a = a->q_next;
}
}
- /*
+/*
** EMPTYADDR -- return true if this address is empty (``<>'')
**
** Parameters:
@@ -2376,7 +2376,7 @@ emptyaddr(a)
return a->q_paddr == NULL || strcmp(a->q_paddr, "<>") == 0 ||
a->q_user == NULL || strcmp(a->q_user, "<>") == 0;
}
- /*
+/*
** REMOTENAME -- return the name relative to the current mailer
**
** Parameters:
@@ -2549,7 +2549,7 @@ remotename(name, m, flags, pstat, e)
sm_dprintf("remotename => `%s'\n", buf);
return buf;
}
- /*
+/*
** MAPLOCALUSER -- run local username through ruleset 5 for final redirection
**
** Parameters:
@@ -2653,7 +2653,7 @@ maplocaluser(a, sendq, aliaslevel, e)
allocaddr(a1, RF_COPYALL, sm_rpool_strdup_x(e->e_rpool, a->q_paddr), e);
(void) recipient(a1, sendq, aliaslevel, e);
}
- /*
+/*
** DEQUOTE_INIT -- initialize dequote map
**
** Parameters:
@@ -2704,7 +2704,7 @@ dequote_init(map, args)
return true;
}
- /*
+/*
** DEQUOTE_MAP -- unquote an address
**
** Parameters:
@@ -2802,7 +2802,7 @@ dequote_map(map, name, av, statp)
*q++ = '\0';
return map_rewrite(map, name, strlen(name), NULL);
}
- /*
+/*
** RSCHECK -- check string(s) for validity using rewriting sets
**
** Parameters:
@@ -2842,6 +2842,10 @@ rscheck(rwset, p1, p2, e, rmcomm, cnt, logl, host, logid)
auto ADDRESS a1;
bool saveQuickAbort = QuickAbort;
bool saveSuprErrs = SuprErrs;
+#if _FFR_QUARANTINE
+ bool quarantine = false;
+ char ubuf[BUFSIZ * 2];
+#endif /* _FFR_QUARANTINE */
char buf0[MAXLINE];
char pvpbuf[PSBUFSIZE];
extern char MsgBuf[];
@@ -2911,6 +2915,28 @@ rscheck(rwset, p1, p2, e, rmcomm, cnt, logl, host, logid)
e->e_flags |= EF_DISCARD;
discard = true;
}
+#if _FFR_QUARANTINE
+ else if (strcmp(pvp[1], "error") == 0 &&
+ pvp[2] != NULL && (pvp[2][0] & 0377) == CANONHOST &&
+ pvp[3] != NULL && strcmp(pvp[3], "quarantine") == 0)
+ {
+ if (pvp[4] == NULL ||
+ (pvp[4][0] & 0377) != CANONUSER ||
+ pvp[5] == NULL)
+ e->e_holdmsg = sm_rpool_strdup_x(e->e_rpool,
+ rwset);
+ else
+ {
+ cataddr(&(pvp[5]), NULL, ubuf,
+ sizeof ubuf, ' ');
+ e->e_holdmsg = sm_rpool_strdup_x(e->e_rpool,
+ ubuf);
+ }
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), e->e_holdmsg);
+ quarantine = true;
+ }
+#endif /* _FFR_QUARANTINE */
else
{
int savelogusrerrs = LogUsrErrs;
@@ -2961,6 +2987,12 @@ rscheck(rwset, p1, p2, e, rmcomm, cnt, logl, host, logid)
sm_syslog(LOG_NOTICE, logid,
"ruleset=%s, arg1=%s%s, discard",
rwset, p1, lbuf);
+#if _FFR_QUARANTINE
+ else if (quarantine)
+ sm_syslog(LOG_NOTICE, logid,
+ "ruleset=%s, arg1=%s%s, quarantine=%s",
+ rwset, p1, lbuf, ubuf);
+#endif /* _FFR_QUARANTINE */
else
sm_syslog(LOG_NOTICE, logid,
"ruleset=%s, arg1=%s%s, reject=%s",
@@ -2983,7 +3015,7 @@ rscheck(rwset, p1, p2, e, rmcomm, cnt, logl, host, logid)
sm_exc_raisenew_x(&EtypeQuickAbort, 2);
return rstat;
}
- /*
+/*
** RSCAP -- call rewriting set to return capabilities
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/queue.c b/gnu/usr.sbin/sendmail/sendmail/queue.c
index 25ede72069d..c042dc37995 100644
--- a/gnu/usr.sbin/sendmail/sendmail/queue.c
+++ b/gnu/usr.sbin/sendmail/sendmail/queue.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: queue.c,v 8.768 2001/09/08 01:21:09 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: queue.c,v 8.788 2001/09/30 16:32:47 ca Exp $")
#include <dirent.h>
@@ -276,6 +276,7 @@ hash_q(p, h)
** E error recipient
** F flag bits
** G queue delay algorithm (_FFR_QUEUEDELAY)
+** h hold reason (_FFR_QUARANTINE)
** H header
** I data file's inode number
** K time of last delivery attempt
@@ -297,7 +298,7 @@ hash_q(p, h)
** . terminate file
*/
- /*
+/*
** QUEUEUP -- queue a message up for future transmission.
**
** Parameters:
@@ -313,9 +314,6 @@ hash_q(p, h)
** The queue file is left locked.
*/
-# define TEMPQF_LETTER 'T'
-# define LOSEQF_LETTER 'Q'
-
void
queueup(e, announce, msync)
register ENVELOPE *e;
@@ -341,12 +339,12 @@ queueup(e, announce, msync)
*/
newid = (e->e_id == NULL) || !bitset(EF_INQUEUE, e->e_flags);
- (void) sm_strlcpy(tf, queuename(e, 't'), sizeof tf);
+ (void) sm_strlcpy(tf, queuename(e, NEWQFL_LETTER), sizeof tf);
tfp = e->e_lockfp;
if (tfp == NULL)
newid = false;
- /* if newid, just write the qf file directly (instead of tf file) */
+ /* if newid, write the queue file directly (instead of temp file) */
if (!newid)
{
const int flags = O_CREAT|O_WRONLY|O_EXCL;
@@ -399,7 +397,7 @@ queueup(e, announce, msync)
(void) sleep(i % 32);
}
if (tfd < 0 || (tfp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) tfd, SM_IO_WRONLY,
+ (void *) &tfd, SM_IO_WRONLY,
NULL)) == NULL)
{
int save_errno = errno;
@@ -412,9 +410,10 @@ queueup(e, announce, msync)
}
if (tTd(40, 1))
- sm_dprintf("\n>>>>> queueing %s/qf%s%s >>>>>\n",
- qid_printqueue(e->e_qgrp, e->e_qdir), e->e_id,
- newid ? " (new id)" : "");
+ sm_dprintf("\n>>>>> queueing %s/%s%s >>>>>\n",
+ qid_printqueue(e->e_qgrp, e->e_qdir),
+ queuename(e, ANYQFL_LETTER),
+ newid ? " (new id)" : "");
if (tTd(40, 3))
{
sm_dprintf(" e_flags=");
@@ -441,7 +440,7 @@ queueup(e, announce, msync)
** If there is no data file yet, create one.
*/
- (void) sm_strlcpy(dfname, queuename(e, 'd'), sizeof dfname);
+ (void) sm_strlcpy(dfname, queuename(e, DATAFL_LETTER), sizeof dfname);
if (bitset(EF_HAS_DF, e->e_flags))
{
if (e->e_dfp != NULL &&
@@ -449,7 +448,7 @@ queueup(e, announce, msync)
sm_io_setinfo(e->e_dfp, SM_BF_COMMIT, NULL) < 0 &&
errno != EINVAL)
syserr("!queueup: cannot commit data file %s, uid=%d",
- queuename(e, 'd'), geteuid());
+ queuename(e, DATAFL_LETTER), geteuid());
if (e->e_dfp != NULL &&
SuperSafe == SAFE_INTERACTIVE && msync)
@@ -487,7 +486,7 @@ queueup(e, announce, msync)
if (bitset(S_IWGRP, QueueFileMode))
(void) umask(oldumask);
if (dfd < 0 || (dfp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) dfd, SM_IO_WRONLY,
+ (void *) &dfd, SM_IO_WRONLY,
NULL)) == NULL)
syserr("!queueup: cannot create data temp file %s, uid=%d",
dfname, geteuid());
@@ -560,8 +559,8 @@ queueup(e, announce, msync)
(void) sm_io_fprintf(tfp, SM_TIME_DEFAULT, "P%ld\n", e->e_msgpriority);
/*
- ** If df file is in a different directory than the qf file,
- ** output a "d" record naming the directory of the df file.
+ ** If data file is in a different directory than the queue file,
+ ** output a "d" record naming the directory of the data file.
*/
if (e->e_dfqgrp != e->e_qgrp)
@@ -585,6 +584,13 @@ queueup(e, announce, msync)
(void) sm_io_fprintf(tfp, SM_TIME_DEFAULT, "B%s\n",
denlstring(e->e_bodytype, true, false));
+#if _FFR_QUARANTINE
+ /* quarantine reason */
+ if (e->e_holdmsg != NULL)
+ (void) sm_io_fprintf(tfp, SM_TIME_DEFAULT, "h%s\n",
+ denlstring(e->e_holdmsg, true, false));
+#endif /* _FFR_QUARANTINE */
+
/* message from envelope, if it exists */
if (e->e_message != NULL)
(void) sm_io_fprintf(tfp, SM_TIME_DEFAULT, "M%s\n",
@@ -808,12 +814,42 @@ queueup(e, announce, msync)
if (!newid)
{
- /* rename (locked) tf to be (locked) qf */
- qf = queuename(e, 'q');
+ /* rename (locked) tf to be (locked) [qh]f */
+ qf = queuename(e, ANYQFL_LETTER);
if (rename(tf, qf) < 0)
syserr("cannot rename(%s, %s), uid=%d",
tf, qf, geteuid());
+# if _FFR_QUARANTINE
+ /* Check if type has changed */
+ if (e->e_qfletter != '\0' &&
+ e->e_qfletter != qf[0])
+ {
+ char new = qf[0];
+
+ /* If it has changed, remove the old item */
+ if (tTd(40, 5))
+ {
+ sm_dprintf("type changed from %c to %c\n",
+ e->e_qfletter, new);
+ if (tTd(40, 101))
+ pause();
+ }
+
+ qf[0] = e->e_qfletter;
+ if (unlink(qf) < 0)
+ {
+ /* XXX: something more drastic? */
+ if (LogLevel > 0)
+ sm_syslog(LOG_ERR, e->e_id,
+ "queueup: unlink(%s) failed: %s",
+ qf, sm_errstring(errno));
+ }
+ qf[0] = new;
+ }
+ e->e_qfletter = qf[0];
+# endif /* _FFR_QUARANTINE */
+
/*
** fsync() after renaming to make sure metadata is
** written to disk on filesystems in which renames are
@@ -831,26 +867,32 @@ queueup(e, announce, msync)
SYNC_DIR(qf, true);
}
- /* close and unlock old (locked) qf */
+ /* close and unlock old (locked) queue file */
if (e->e_lockfp != NULL)
(void) sm_io_close(e->e_lockfp, SM_TIME_DEFAULT);
e->e_lockfp = tfp;
}
else
+ {
qf = tf;
+#if _FFR_QUARANTINE
+ e->e_qfletter = qf[0];
+#endif /* _FFR_QUARANTINE */
+ }
+
errno = 0;
e->e_flags |= EF_INQUEUE;
/* save log info */
if (LogLevel > 79)
- sm_syslog(LOG_DEBUG, e->e_id, "queueup, qf=%s", qf);
+ sm_syslog(LOG_DEBUG, e->e_id, "queueup %s", qf);
if (tTd(40, 1))
sm_dprintf("<<<<< done queueing %s <<<<<\n\n", e->e_id);
return;
}
- /*
+/*
** PRINTCTLADDR -- print control address to file.
**
** Parameters:
@@ -920,7 +962,7 @@ printctladdr(a, tfp)
denlstring(a->q_paddr, true, false));
}
- /*
+/*
** RUNNERS_SIGTERM -- propagate a SIGTERM to queue runner process
**
** This propagates the signal to the child processes that are queue
@@ -981,7 +1023,7 @@ runners_sigterm(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** RUNNERS_SIGHUP -- propagate a SIGHUP to queue runner process
**
** This propagates the signal to the child processes that are queue
@@ -1033,7 +1075,7 @@ runners_sighup(sig)
errno = save_errno;
return SIGFUNC_RETURN;
}
- /*
+/*
** MARK_WORK_GROUP_RESTART -- mark a work group as needing a restart
**
** Sets a workgroup for restarting.
@@ -1064,7 +1106,7 @@ mark_work_group_restart(wgrp, reason)
WorkGrp[wgrp].wg_restart = reason;
RestartWorkGroup = true;
}
- /*
+/*
** RESTART_MARKED_WORK_GROUPS -- restart work groups marked as needing restart
**
** Restart any workgroup marked as needing a restart provided more
@@ -1108,7 +1150,7 @@ restart_marked_work_groups()
if (wasblocked == 0)
(void) sm_releasesignal(SIGCHLD);
}
- /*
+/*
** RESTART_WORK_GROUP -- restart a specific work group
**
** Restart a specific workgroup provided more runners are allowed.
@@ -1149,7 +1191,7 @@ restart_work_group(wgrp)
wgrp);
}
}
- /*
+/*
** SCHEDULE_QUEUE_RUNS -- schedule the next queue run for a work group.
**
** Parameters:
@@ -1203,7 +1245,7 @@ schedule_queue_runs(runall, wgrp)
INCR_MOD(cgrp, WorkGrp[wgrp].wg_numqgrp);
} while (endgrp != cgrp);
}
- /*
+/*
** RUNQUEUE -- run the jobs in the queue.
**
** Gets the stuff out of the queue in some presumably logical
@@ -1353,7 +1395,7 @@ runqueue(forkflag, verbose, persistent, runall)
#endif /* SM_HEAP_CHECK */
return ret;
}
- /*
+/*
** RUNNER_WORK -- have a queue runner do its work
**
** Have a queue runner do its work a list of entries.
@@ -1539,7 +1581,7 @@ runner_work(e, sequenceno, didfork, skip, njobs)
Oldsh = SIG_DFL; /* after the NoMoreRunners check */
}
- /*
+/*
** RUN_WORK_GROUP -- run the jobs in a queue group from a work group.
**
** Gets the stuff out of the queue in some presumably logical
@@ -1724,6 +1766,9 @@ run_work_group(wgrp, forkflag, verbose, persistent, runall)
*/
if (QueueLimitId != NULL || QueueLimitSender != NULL ||
+#if _FFR_QUARANTINE
+ QueueLimitReason != NULL ||
+#endif /* _FFR_QUARANTINE */
QueueLimitRecipient != NULL)
{
IgnoreHostStatus = true;
@@ -2114,7 +2159,7 @@ runqueueevent(qgrp)
if (errno == EINTR)
errno = ETIMEDOUT;
}
- /*
+/*
** GATHERQ -- gather messages from the message queue(s) the work queue.
**
** Parameters:
@@ -2141,6 +2186,10 @@ runqueueevent(qgrp)
#define NEED_R 004 /* 'R': recipient */
#define NEED_S 010 /* 'S': sender */
#define NEED_H 020 /* host */
+#if _FFR_QUARANTINE
+# define HAS_HOLD 040 /* has an unexpected 'h' line */
+# define NEED_HOLD 100 /* 'h': reason */
+#endif /* _FFR_QUARANTINE */
static WORK *WorkList = NULL; /* list of unsort work */
static int WorkListSize = 0; /* current max size of WorkList */
@@ -2205,6 +2254,20 @@ gatherq(qgrp, qdir, doall, full, more)
check->queue_match);
check = check->queue_next;
}
+
+#if _FFR_QUARANTINE
+ if (QueueMode == QM_HELD)
+ {
+ check = QueueLimitReason;
+ while (check != NULL)
+ {
+ sm_dprintf("\tQueueLimitReason = %s%s\n",
+ check->queue_negate ? "!" : "",
+ check->queue_match);
+ check = check->queue_next;
+ }
+ }
+#endif /* _FFR_QUARANTINE */
}
/* open the queue directory */
@@ -2232,11 +2295,27 @@ gatherq(qgrp, qdir, doall, full, more)
struct stat sbuf;
if (tTd(41, 50))
- sm_dprintf("orderq: checking %s\n", d->d_name);
+ sm_dprintf("orderq: checking %s..", d->d_name);
/* is this an interesting entry? */
- if (d->d_name[0] != 'q' || d->d_name[1] != 'f')
+#if _FFR_QUARANTINE
+ if (!(((QueueMode == QM_NORMAL &&
+ d->d_name[0] == NORMQF_LETTER) ||
+ (QueueMode == QM_HELD &&
+ d->d_name[0] == HELDQF_LETTER) ||
+ (QueueMode == QM_LOST &&
+ d->d_name[0] == LOSEQF_LETTER)) &&
+ d->d_name[1] == 'f'))
+#else /* _FFR_QUARANTINE */
+ if (d->d_name[0] != NORMQF_LETTER || d->d_name[1] != 'f')
+#endif /* _FFR_QUARANTINE */
+ {
+ if (tTd(41, 50))
+ sm_dprintf(" skipping\n");
continue;
+ }
+ if (tTd(41, 50))
+ sm_dprintf("\n");
if (strlen(d->d_name) >= MAXQFNAME)
{
@@ -2298,8 +2377,13 @@ gatherq(qgrp, qdir, doall, full, more)
if (!bitset(S_IFREG, sbuf.st_mode))
{
/* Yikes! Skip it or we will hang on open! */
- if (!((d->d_name[0] == 'd' || d->d_name[0] == 'q' ||
- d->d_name[0] == 'x') &&
+ if (!((d->d_name[0] == DATAFL_LETTER ||
+ d->d_name[0] == NORMQF_LETTER ||
+#if _FFR_QUARANTINE
+ d->d_name[0] == HELDQF_LETTER ||
+ d->d_name[0] == LOSEQF_LETTER ||
+#endif /* _FFR_QUARANTINE */
+ d->d_name[0] == XSCRPT_LETTER) &&
d->d_name[1] == 'f' && d->d_name[2] == '\0'))
syserr("orderq: %s/%s is not a regular file",
qid_printqueue(qgrp, qdir), d->d_name);
@@ -2311,6 +2395,9 @@ gatherq(qgrp, qdir, doall, full, more)
if ((QueueSortOrder == QSO_BYFILENAME ||
QueueSortOrder == QSO_BYMODTIME ||
QueueSortOrder == QSO_RANDOM) &&
+#if _FFR_QUARANTINE
+ QueueLimitReason == NULL &&
+#endif /* _FFR_QUARANTINE */
QueueLimitSender == NULL &&
QueueLimitRecipient == NULL)
{
@@ -2372,6 +2459,10 @@ gatherq(qgrp, qdir, doall, full, more)
i |= NEED_S;
if (QueueLimitRecipient != NULL)
i |= NEED_R;
+#if _FFR_QUARANTINE
+ if (QueueLimitReason != NULL)
+ i |= NEED_HOLD;
+#endif /* _FFR_QUARANTINE */
while (cf != NULL && i != 0 &&
sm_io_fgets(cf, SM_TIME_DEFAULT, lbuf,
sizeof lbuf) != NULL)
@@ -2406,6 +2497,40 @@ gatherq(qgrp, qdir, doall, full, more)
i &= ~NEED_T;
break;
+#if _FFR_QUARANTINE
+ case 'h':
+ if (QueueMode != QM_HELD &&
+ QueueMode != QM_LOST)
+ {
+ if (tTd(41, 49))
+ sm_dprintf("%s not marked as held but has an 'h' line\n",
+ w->w_name);
+ i |= HAS_HOLD;
+ }
+ else if (QueueMode == QM_HELD)
+ {
+ if (QueueLimitReason == NULL)
+ {
+ i &= ~NEED_HOLD;
+ break;
+ }
+ p = &lbuf[1];
+ check = QueueLimitReason;
+ while (check != NULL)
+ {
+ if (strcontainedin(check->queue_match,
+ p) !=
+ check->queue_negate)
+ break;
+ else
+ check = check->queue_next;
+ }
+ if (check != NULL)
+ i &= ~NEED_HOLD;
+ }
+ break;
+#endif /* _FFR_QUARANTINE */
+
case 'R':
if (w->w_host == NULL &&
(p = strrchr(&lbuf[1], '@')) != NULL)
@@ -2489,6 +2614,10 @@ gatherq(qgrp, qdir, doall, full, more)
(void) sm_io_close(cf, SM_TIME_DEFAULT);
if ((!doall && shouldqueue(w->w_pri, w->w_ctime)) ||
+#if _FFR_QUARANTINE
+ bitset(HAS_HOLD, i) ||
+ bitset(NEED_HOLD, i) ||
+#endif /* _FFR_QUARANTINE */
bitset(NEED_R|NEED_S, i))
{
/* don't even bother sorting this job in */
@@ -2517,7 +2646,7 @@ gatherq(qgrp, qdir, doall, full, more)
return i;
}
- /*
+/*
** SORTQ -- sort the work list
**
** First the old WorkQ is cleared away. Then the WorkList is sorted
@@ -2633,7 +2762,7 @@ sortq(max)
else if (QueueSortOrder == QSO_BYFILENAME)
{
/*
- ** Sort based on qf filename.
+ ** Sort based on queue filename.
*/
qsort((char *) WorkList, wc, sizeof *WorkList, workcmpf4);
@@ -2652,7 +2781,7 @@ sortq(max)
else if (QueueSortOrder == QSO_BYMODTIME)
{
/*
- ** Simple sort based on modification time of qf file.
+ ** Simple sort based on modification time of queue file.
** This puts the oldest items first.
*/
@@ -2721,7 +2850,7 @@ sortq(max)
return wc; /* return number of WorkQ items */
}
- /*
+/*
** GROW_WLIST -- make the work list larger
**
** Parameters:
@@ -2778,7 +2907,7 @@ grow_wlist(qgrp, qdir)
if (tTd(41, 1))
sm_dprintf("grow_wlist: WorkListSize now %d\n", WorkListSize);
}
- /*
+/*
** WORKCMPF0 -- simple priority-only compare function.
**
** Parameters:
@@ -2807,7 +2936,7 @@ workcmpf0(a, b)
else
return -1;
}
- /*
+/*
** WORKCMPF1 -- first compare function for ordering work based on host name.
**
** Sorts on host name, lock status, and priority in that order.
@@ -2846,7 +2975,7 @@ workcmpf1(a, b)
/* job priority */
return workcmpf0(a, b);
}
- /*
+/*
** WORKCMPF2 -- second compare function for ordering work based on host name.
**
** Sorts on lock status, host name, and priority in that order.
@@ -2885,7 +3014,7 @@ workcmpf2(a, b)
/* job priority */
return workcmpf0(a, b);
}
- /*
+/*
** WORKCMPF3 -- simple submission-time-only compare function.
**
** Parameters:
@@ -2911,7 +3040,7 @@ workcmpf3(a, b)
else
return 0;
}
- /*
+/*
** WORKCMPF4 -- compare based on file name
**
** Parameters:
@@ -2932,7 +3061,7 @@ workcmpf4(a, b)
{
return strcmp(a->w_name, b->w_name);
}
- /*
+/*
** WORKCMPF5 -- compare based on assigned random number
**
** Parameters:
@@ -2951,7 +3080,7 @@ workcmpf5(a, b)
{
return (get_rand_mod(2)) ? 1 : -1;
}
- /*
+/*
** WORKCMPF6 -- simple modification-time-only compare function.
**
** Parameters:
@@ -2978,7 +3107,7 @@ workcmpf6(a, b)
return 0;
}
#if _FFR_RHS
- /*
+/*
** WORKCMPF7 -- compare function for ordering work based on shuffled host name.
**
** Sorts on lock status, host name, and priority in that order.
@@ -3018,7 +3147,7 @@ workcmpf7(a, b)
return workcmpf0(a, b);
}
#endif /* _FFR_RHS */
- /*
+/*
** STRREV -- reverse string
**
** Returns a pointer to a new string that is the reverse of
@@ -3105,7 +3234,7 @@ sm_strshufflecmp(a, b)
}
#endif /* _FFR_RHS */
- /*
+/*
** DOWORK -- do a work request.
**
** Parameters:
@@ -3418,6 +3547,11 @@ doworklist(el, forkflag, requeueflag)
if (WILL_BE_QUEUED(ei->e_sendmode))
continue;
+#if _FFR_QUARANTINE
+ else if (QueueMode != QM_HELD &&
+ ei->e_holdmsg != NULL)
+ continue;
+#endif /* _FFR_QUARANTINE */
rpool = sm_rpool_new_x(NULL);
clearenvelope(&e, true, rpool);
@@ -3465,7 +3599,7 @@ doworklist(el, forkflag, requeueflag)
finis(true, ExitStat);
return 0;
}
- /*
+/*
** READQF -- read queue file and set up environment.
**
** Parameters:
@@ -3502,7 +3636,7 @@ readqf(e)
** Read and process the file.
*/
- (void) sm_strlcpy(qf, queuename(e, 'q'), sizeof qf);
+ (void) sm_strlcpy(qf, queuename(e, ANYQFL_LETTER), sizeof qf);
qfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, qf, SM_IO_RDWR, NULL);
if (qfp == NULL)
{
@@ -3641,12 +3775,13 @@ readqf(e)
if (LogLevel > 0)
{
sm_syslog(LOG_ALERT, e->e_id,
- "bogus queue file, uid=%d, mode=%o",
- st.st_uid, st.st_mode);
+ "bogus queue file, uid=%d, gid=%d, mode=%o",
+ st.st_uid, st.st_gid, st.st_mode);
}
if (tTd(40, 8))
sm_dprintf("readqf(%s): bogus file\n", qf);
- loseqfile(e, "bogus file uid in mqueue");
+ e->e_flags |= EF_INQUEUE;
+ loseqfile(e, "bogus file uid/gid in mqueue");
(void) sm_io_close(qfp, SM_TIME_DEFAULT);
RELEASE_QUEUE;
return false;
@@ -3657,8 +3792,8 @@ readqf(e)
/* must be a bogus file -- if also old, just remove it */
if (st.st_ctime + 10 * 60 < curtime())
{
- (void) xunlink(queuename(e, 'd'));
- (void) xunlink(queuename(e, 'q'));
+ (void) xunlink(queuename(e, DATAFL_LETTER));
+ (void) xunlink(queuename(e, ANYQFL_LETTER));
}
(void) sm_io_close(qfp, SM_TIME_DEFAULT);
RELEASE_QUEUE;
@@ -3692,6 +3827,9 @@ readqf(e)
e->e_flags |= EF_GLOBALERRS;
set_op_mode(MD_QUEUERUN);
ctladdr = NULL;
+#if _FFR_QUARANTINE
+ e->e_qfletter = qf[0];
+#endif /* _FFR_QUARANTINE */
e->e_dfqgrp = e->e_qgrp;
e->e_dfqdir = e->e_qdir;
#if _FFR_QUEUE_MACRO
@@ -3708,7 +3846,7 @@ readqf(e)
{
unsigned long qflags;
ADDRESS *q;
- int mid;
+ int r;
time_t now;
auto char *ep;
@@ -3717,8 +3855,13 @@ readqf(e)
if (nomore)
{
/* hack attack */
- syserr("SECURITY ALERT: extra data in qf: %s", bp);
+ hackattack:
+ syserr("SECURITY ALERT: extra or bogus data in queue file: %s",
+ bp);
(void) sm_io_close(qfp, SM_TIME_DEFAULT);
+
+ /* the file is already on disk */
+ e->e_flags |= EF_INQUEUE;
loseqfile(e, "bogus queue line");
RELEASE_QUEUE;
return false;
@@ -3726,10 +3869,15 @@ readqf(e)
switch (bp[0])
{
case 'A': /* AUTH= parameter */
+ if (!xtextok(&bp[1]))
+ goto hackattack;
e->e_auth_param = sm_rpool_strdup_x(e->e_rpool, &bp[1]);
break;
case 'B': /* body type */
+ r = check_bodytype(&bp[1]);
+ if (!BODYTYPE_VALID(r))
+ goto hackattack;
e->e_bodytype = sm_rpool_strdup_x(e->e_rpool, &bp[1]);
break;
@@ -3745,6 +3893,11 @@ readqf(e)
{
int qgrp, qdir;
+#if _FFR_MSP_PARANOIA
+ /* forbid queue groups in MSP? */
+ if (UseMSP)
+ goto hackattack;
+#endif /* _FFR_MSP_PARANOIA */
for (qgrp = 0;
qgrp < NumQueue && Queue[qgrp] != NULL;
++qgrp)
@@ -3825,6 +3978,14 @@ readqf(e)
break;
#endif /* _FFR_QUEUEDELAY */
+#if _FFR_QUARANTINE
+ case 'h': /* hold message */
+ e->e_holdmsg = sm_rpool_strdup_x(e->e_rpool, &bp[1]);
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), &bp[1]);
+ break;
+#endif /* _FFR_QUARANTINE */
+
case 'H': /* header */
(void) chompheader(&bp[1], CHHDR_QUEUE, NULL, e);
hdrsize += strlen(&bp[1]);
@@ -3971,15 +4132,15 @@ readqf(e)
case 'V': /* queue file version number */
qfver = atoi(&bp[1]);
if (queuedelay_qfver_unsupported(qfver))
- syserr("qf version %d not supported: %s",
+ syserr("queue file version %d not supported: %s",
qfver,
"sendmail not compiled with _FFR_QUEUEDELAY");
if (qfver <= QF_VERSION)
break;
- syserr("Version number in qf (%d) greater than max (%d)",
+ syserr("Version number in queue file (%d) greater than max (%d)",
qfver, QF_VERSION);
(void) sm_io_close(qfp, SM_TIME_DEFAULT);
- loseqfile(e, "unsupported qf file version");
+ loseqfile(e, "unsupported queue file version");
RELEASE_QUEUE;
return false;
/* NOTREACHED */
@@ -4008,11 +4169,11 @@ readqf(e)
char *p;
/* XXX elimate p? */
- mid = macid_parse(&bp[1], &ep);
- if (mid == 0)
+ r = macid_parse(&bp[1], &ep);
+ if (r == 0)
break;
p = sm_rpool_strdup_x(e->e_rpool, ep);
- macdefine(&e->e_macro, A_PERM, mid, p);
+ macdefine(&e->e_macro, A_PERM, r, p);
}
break;
@@ -4061,7 +4222,7 @@ readqf(e)
** Arrange to read the data file.
*/
- p = queuename(e, 'd');
+ p = queuename(e, DATAFL_LETTER);
e->e_dfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, p, SM_IO_RDONLY,
NULL);
if (e->e_dfp == NULL)
@@ -4083,7 +4244,7 @@ readqf(e)
RELEASE_QUEUE;
return true;
}
- /*
+/*
** PRTSTR -- print a string, "unprintable" characters are shown as \oct
**
** Parameters:
@@ -4126,7 +4287,7 @@ prtstr(s, ml)
}
}
}
- /*
+/*
** PRINTNQE -- print out number of entries in the mail queue
**
** Parameters:
@@ -4209,7 +4370,7 @@ printnqe(out, prefix)
"%sNOTAVAILABLE:-1\r\n", prefix);
#endif /* SM_CONF_SHM */
}
- /*
+/*
** PRINTQUEUE -- print out a representation of the mail queue
**
** Parameters:
@@ -4245,7 +4406,7 @@ printqueue()
"\t\tTotal requests: %d\n",
nrequests);
}
- /*
+/*
** PRINT_SINGLE_QUEUE -- print out a representation of a single mail queue
**
** Parameters:
@@ -4366,6 +4527,9 @@ print_single_queue(qgrp, qdir)
long dfsize;
int flags = 0;
int qfver;
+#if _FFR_QUARANTINE
+ char holdmsg[MAXLINE];
+#endif /* _FFR_QUARANTINE */
char statmsg[MAXLINE];
char bodytype[MAXNAME + 1];
char qf[MAXPATHLEN];
@@ -4393,7 +4557,7 @@ print_single_queue(qgrp, qdir)
errno = 0;
continue;
}
- w->w_name[0] = 'd';
+ w->w_name[0] = DATAFL_LETTER;
(void) sm_strlcpyn(qf, sizeof qf, 3, qddf, "/", w->w_name);
if (stat(qf, &st) >= 0)
dfsize = st.st_size;
@@ -4414,7 +4578,7 @@ print_single_queue(qgrp, qdir)
dfsize = -1;
if (readqf(&e))
{
- char *df = queuename(&e, 'd');
+ char *df = queuename(&e, DATAFL_LETTER);
if (stat(df, &st) >= 0)
dfsize = st.st_size;
}
@@ -4426,6 +4590,12 @@ print_single_queue(qgrp, qdir)
clearenvelope(&e, false, e.e_rpool);
sm_rpool_free(e.e_rpool);
}
+#if _FFR_QUARANTINE
+ if (QueueMode == QM_LOST)
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "?");
+ else if (QueueMode == QM_HELD)
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "!");
+#endif /* _FFR_QUARANTINE */
if (w->w_lock)
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "*");
else if (w->w_tooyoung)
@@ -4437,6 +4607,9 @@ print_single_queue(qgrp, qdir)
errno = 0;
+#if _FFR_QUARANTINE
+ holdmsg[0] = '\0';
+#endif /* _FFR_QUARANTINE */
statmsg[0] = bodytype[0] = '\0';
qfver = 0;
while (sm_io_fgets(f, SM_TIME_DEFAULT, buf, sizeof buf) != NULL)
@@ -4461,6 +4634,15 @@ print_single_queue(qgrp, qdir)
statmsg[i] = '\0';
break;
+#if _FFR_QUARANTINE
+ case 'h': /* hold message */
+ if ((i = strlen(&buf[1])) >= sizeof holdmsg)
+ i = sizeof holdmsg - 1;
+ memmove(holdmsg, &buf[1], i);
+ holdmsg[i] = '\0';
+ break;
+#endif /* _FFR_QUARANTINE */
+
case 'B': /* body type */
if ((i = strlen(&buf[1])) >= sizeof bodytype)
i = sizeof bodytype - 1;
@@ -4490,6 +4672,17 @@ print_single_queue(qgrp, qdir)
ctime(&submittime));
prtstr(&buf[1], 39);
}
+#if _FFR_QUARANTINE
+ if (holdmsg[0] != '\0')
+ {
+ (void) sm_io_fprintf(smioout,
+ SM_TIME_DEFAULT,
+ "\n ON HOLD: (%.*s)",
+ Verbose ? 100 : 60,
+ holdmsg);
+ holdmsg[0] = '\0';
+ }
+#endif /* _FFR_QUARANTINE */
if (statmsg[0] != '\0' || bodytype[0] != '\0')
{
(void) sm_io_fprintf(smioout,
@@ -4571,7 +4764,7 @@ print_single_queue(qgrp, qdir)
}
return nrequests;
}
- /*
+/*
** QUEUENAME -- build a file name in the queue directory for this envelope.
**
** Parameters:
@@ -4602,13 +4795,44 @@ queuename(e, type)
if (e->e_id == NULL)
assign_queueid(e);
+#if _FFR_QUARANTINE
+ /* Change type according to QueueMode */
+ if (type == ANYQFL_LETTER)
+ {
+ if (e->e_holdmsg != NULL)
+ type = HELDQF_LETTER;
+ else
+ {
+ switch (QueueMode)
+ {
+ case QM_NORMAL:
+ type = NORMQF_LETTER;
+ break;
+
+ case QM_HELD:
+ type = HELDQF_LETTER;
+ break;
+
+ case QM_LOST:
+ type = LOSEQF_LETTER;
+ break;
+
+ default:
+ /* should never happen */
+ abort();
+ /* NOTREACHED */
+ }
+ }
+ }
+#endif /* _FFR_QUARANTINE */
+
/* begin of filename */
pref[0] = (char) type;
pref[1] = 'f';
pref[2] = '\0';
/* Assign a queue group/directory if needed */
- if (type == 'x')
+ if (type == XSCRPT_LETTER)
{
/*
** We don't want to call setnewqueue() if we are fetching
@@ -4644,7 +4868,7 @@ queuename(e, type)
{
if (e->e_qgrp == NOQGRP || e->e_qdir == NOQDIR)
setnewqueue(e);
- if (type == 'd')
+ if (type == DATAFL_LETTER)
{
qd = e->e_dfqdir;
qg = e->e_dfqgrp;
@@ -4662,20 +4886,23 @@ queuename(e, type)
{
switch (type)
{
- case 'd':
+ case DATAFL_LETTER:
if (bitset(QP_SUBDF, Queue[qg]->qg_qpaths[qd].qp_subdirs))
sub = "/df/";
break;
+#if _FFR_QUARANTINE
+ case HELDQF_LETTER:
+#endif /* _FFR_QUARANTINE */
case TEMPQF_LETTER:
- case 't':
+ case NEWQFL_LETTER:
case LOSEQF_LETTER:
- case 'q':
+ case NORMQF_LETTER:
if (bitset(QP_SUBQF, Queue[qg]->qg_qpaths[qd].qp_subdirs))
sub = "/qf/";
break;
- case 'x':
+ case XSCRPT_LETTER:
if (bitset(QP_SUBXF, Queue[qg]->qg_qpaths[qd].qp_subdirs))
sub = "/xf/";
break;
@@ -4693,7 +4920,7 @@ queuename(e, type)
sm_dprintf("queuename: %s\n", buf);
return buf;
}
- /*
+/*
** ASSIGN_QUEUEID -- assign a queue ID for this envelope.
**
** Assigns an id code if one does not already exist.
@@ -4779,13 +5006,17 @@ assign_queueid(e)
e->e_qdir = NOQDIR;
e->e_xfqgrp = NOQGRP;
#endif /* 0 */
+#if _FFR_QUARANTINE
+ /* New ID means it's not on disk yet */
+ e->e_qfletter = '\0';
+#endif /* _FFR_QUARANTINE */
if (tTd(7, 1))
sm_dprintf("assign_queueid: assigned id %s, e=%p\n",
e->e_id, e);
if (LogLevel > 93)
sm_syslog(LOG_DEBUG, e->e_id, "assigned id");
}
- /*
+/*
** SYNC_QUEUE_TIME -- Assure exclusive PID in any given second
**
** Make sure one PID can't be used by two processes in any one second.
@@ -4813,7 +5044,7 @@ sync_queue_time()
(void) sleep(1);
#endif /* FAST_PID_RECYCLE */
}
- /*
+/*
** UNLOCKQUEUE -- unlock the queue entry for a specified envelope
**
** Parameters:
@@ -4848,9 +5079,9 @@ unlockqueue(e)
if (LogLevel > 87)
sm_syslog(LOG_DEBUG, e->e_id, "unlock");
if (!tTd(51, 104))
- (void) xunlink(queuename(e, 'x'));
+ (void) xunlink(queuename(e, XSCRPT_LETTER));
}
- /*
+/*
** SETCTLUSER -- create a controlling address
**
** Create a fake "address" given only a local login name; this is
@@ -4858,7 +5089,7 @@ unlockqueue(e)
**
** Parameters:
** user -- the user name of the controlling user.
-** qfver -- the version stamp of this qf file.
+** qfver -- the version stamp of this queue file.
** e -- envelope
**
** Returns:
@@ -4939,8 +5170,8 @@ setctluser(user, qfver, e)
a->q_paddr = sm_rpool_strdup_x(e->e_rpool, p);
return a;
}
- /*
-** LOSEQFILE -- save the qf as Qf and try to let someone know
+/*
+** LOSEQFILE -- rename queue file with LOSEQF_LETTER & try to let someone know
**
** Parameters:
** e -- the envelope (e->e_id will be used).
@@ -4955,22 +5186,33 @@ loseqfile(e, why)
register ENVELOPE *e;
char *why;
{
+ bool loseit = true;
char *p;
char buf[MAXPATHLEN];
if (e == NULL || e->e_id == NULL)
return;
- p = queuename(e, 'q');
+ p = queuename(e, ANYQFL_LETTER);
if (sm_strlcpy(buf, p, sizeof buf) >= sizeof buf)
return;
if (!bitset(EF_INQUEUE, e->e_flags))
queueup(e, false, true);
- p = queuename(e, LOSEQF_LETTER);
- if (rename(buf, p) < 0)
- syserr("cannot rename(%s, %s), uid=%d", buf, p, geteuid());
- else if (LogLevel > 0)
- sm_syslog(LOG_ALERT, e->e_id,
- "Losing %s: %s", buf, why);
+#if _FFR_QUARANTINE
+ else if (QueueMode == QM_LOST)
+ loseit = false;
+#endif /* _FFR_QUARANTINE */
+
+ /* if already lost, no need to re-lose */
+ if (loseit)
+ {
+ p = queuename(e, LOSEQF_LETTER);
+ if (rename(buf, p) < 0)
+ syserr("cannot rename(%s, %s), uid=%d",
+ buf, p, geteuid());
+ else if (LogLevel > 0)
+ sm_syslog(LOG_ALERT, e->e_id,
+ "Losing %s: %s", buf, why);
+ }
if (e->e_dfp != NULL)
{
(void) sm_io_close(e->e_dfp, SM_TIME_DEFAULT);
@@ -4978,7 +5220,7 @@ loseqfile(e, why)
}
e->e_flags &= ~EF_HAS_DF;
}
- /*
+/*
** NAME2QID -- translate a queue group name to a queue group id
**
** Parameters:
@@ -5000,7 +5242,7 @@ name2qid(queuename)
return NOQGRP;
return s->s_quegrp->qg_index;
}
- /*
+/*
** QID_PRINTNAME -- create externally printable version of queue id
**
** Parameters:
@@ -5033,8 +5275,8 @@ qid_printname(e)
id);
return idbuf;
}
- /*
-** QID_PRINTQUEUE -- create full version of queue directory for df files
+/*
+** QID_PRINTQUEUE -- create full version of queue directory for data files
**
** Parameters:
** qgrp -- index in queue group.
@@ -5162,7 +5404,7 @@ pickqdir(qg, fsize, e)
qg->qg_qdir, avail);
return NOQDIR;
}
- /*
+/*
** SETNEWQUEUE -- Sets a new queue group and directory
**
** Assign a queue group and directory to an envelope and store the
@@ -5243,7 +5485,7 @@ setnewqueue(e)
e->e_dfqdir = e->e_qdir;
return true;
}
- /*
+/*
** CHKQDIR -- check a queue directory
**
** Parameters:
@@ -5311,7 +5553,7 @@ chkqdir(name, sff)
name, sm_errstring(i));
return true;
}
- /*
+/*
** MULTIQUEUE_CACHE -- cache a list of paths to queues.
**
** Each potential queue is checked as the cache is built.
@@ -5879,7 +6121,7 @@ disk_status(out, prefix)
#endif /* _FFR_CONTROL_MSTAT */
#if SM_CONF_SHM
- /*
+/*
** UPD_QS -- update information about queue when adding/deleting an entry
**
** Parameters:
@@ -5940,7 +6182,7 @@ upd_qs(e, delete, avail)
FILE_SYS_AVAIL(fidx) -= s;
}
- /*
+/*
** INIT_SHM -- initialize shared memory structure
**
** Initialize or attach to shared memory segment.
@@ -6055,7 +6297,7 @@ init_shm(qn, owner, hash)
}
#endif /* SM_CONF_SHM */
- /*
+/*
** SETUP_QUEUES -- setup all queue groups
**
** Parameters:
@@ -6178,6 +6420,22 @@ setup_queues(owner)
syserr("can not write to queue directory %s (RunAsGid=%d, required=%d)",
basedir, (int) RunAsGid, (int) st.st_gid);
}
+ if (bitset(S_IWOTH|S_IXOTH, st.st_mode))
+ {
+#if _FFR_MSP_PARANOIA
+ syserr("dangerous permissions=%o on queue directory %s",
+ (int) st.st_mode, basedir);
+#else /* _FFR_MSP_PARANOIA */
+ if (LogLevel > 0)
+ sm_syslog(LOG_ERR, NOQID,
+ "dangerous permissions=%o on queue directory %s",
+ (int) st.st_mode, basedir);
+#endif /* _FFR_MSP_PARANOIA */
+ }
+#if _FFR_MSP_PARANOIA
+ if (NumQueue > 1)
+ syserr("can not use multiple queues for MSP");
+#endif /* _FFR_MSP_PARANOIA */
}
/* initial number of queue directories */
@@ -6213,7 +6471,7 @@ setup_queues(owner)
}
#if SM_CONF_SHM
- /*
+/*
** CLEANUP_SHM -- do some cleanup work for shared memory etc
**
** Parameters:
@@ -6241,7 +6499,7 @@ cleanup_shm(owner)
}
#endif /* SM_CONF_SHM */
- /*
+/*
** CLEANUP_QUEUES -- do some cleanup work for queues
**
** Parameters:
@@ -6257,7 +6515,7 @@ cleanup_queues()
{
sync_queue_time();
}
- /*
+/*
** SET_DEF_QUEUEVAL -- set default values for a queue group.
**
** Parameters:
@@ -6286,7 +6544,7 @@ set_def_queueval(qg, all)
qg->qg_maxqrun = all ? MaxRunnersPerQueue : -1;
qg->qg_nice = NiceQueueRun;
}
- /*
+/*
** MAKEQUEUE -- define a new queue.
**
** Parameters:
@@ -6522,7 +6780,7 @@ makequeue(line, qdef)
setbitn(QD_DEFINED, qg->qg_flags);
}
#if 0
- /*
+/*
** HASHFQN -- calculate a hash value for a fully qualified host name
**
** Arguments:
@@ -6569,7 +6827,7 @@ hashfqn(fqn, buckets)
#endif /* 0 */
#if _FFR_QUEUEDELAY
- /*
+/*
** QUEUEDELAY -- compute queue delay time
**
** Parameters:
@@ -6803,8 +7061,8 @@ makeworkgroups()
** Create a hard link from the 'old' data file to the 'new' data file.
** If the old and new queue directories are on different file systems,
** then the new data file link is created in the old queue directory,
-** and the new qf file will contain a 'd' record pointing to the
-** directory containing the new df file.
+** and the new queue file will contain a 'd' record pointing to the
+** directory containing the new data file.
**
** Parameters:
** old -- old envelope.
@@ -6833,8 +7091,8 @@ dup_df(old, new)
SM_REQUIRE(ISVALIDQGRP(old->e_qgrp) && ISVALIDQDIR(old->e_qdir));
SM_REQUIRE(ISVALIDQGRP(new->e_qgrp) && ISVALIDQDIR(new->e_qdir));
- (void) sm_strlcpy(opath, queuename(old, 'd'), sizeof opath);
- (void) sm_strlcpy(npath, queuename(new, 'd'), sizeof npath);
+ (void) sm_strlcpy(opath, queuename(old, DATAFL_LETTER), sizeof opath);
+ (void) sm_strlcpy(npath, queuename(new, DATAFL_LETTER), sizeof npath);
if (old->e_dfp != NULL)
{
@@ -6896,7 +7154,7 @@ dup_df(old, new)
new->e_dfqgrp = old->e_dfqgrp;
new->e_dfqdir = old->e_dfqdir;
- (void) sm_strlcpy(npath, queuename(new, 'd'), sizeof npath);
+ (void) sm_strlcpy(npath, queuename(new, DATAFL_LETTER), sizeof npath);
if (link(opath, npath) == 0)
{
new->e_flags |= EF_HAS_DF;
@@ -6986,7 +7244,7 @@ split_env(e, sendqueue, qgrp, qdir)
#define SM_SPLIT_NONE (1)
#define SM_SPLIT_NEW(n) (1 + (n))
- /*
+/*
** SPLIT_ACROSS_QUEUE_GROUPS
**
** This function splits an envelope across multiple queue groups
@@ -7003,7 +7261,7 @@ split_env(e, sendqueue, qgrp, qdir)
** Side Effects:
** On success, e->e_sibling points to a list of zero or more
** additional envelopes, and the associated data files exist
-** on disk. But the 'qf' files are not created.
+** on disk. But the queue files are not created.
**
** On failure, e->e_flags & EF_FATALERRS is set.
** e->e_sibling is not changed.
@@ -7371,7 +7629,7 @@ split_within_queue(e)
}
return SM_SPLIT_NEW(nsplit);
}
- /*
+/*
** SPLIT_BY_RECIPIENT
**
** Split an envelope with multiple recipients into multiple
diff --git a/gnu/usr.sbin/sendmail/sendmail/readcf.c b/gnu/usr.sbin/sendmail/sendmail/readcf.c
index 7706b62d294..0309821a089 100644
--- a/gnu/usr.sbin/sendmail/sendmail/readcf.c
+++ b/gnu/usr.sbin/sendmail/sendmail/readcf.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: readcf.c,v 8.582 2001/09/04 22:43:05 ca Exp $")
+SM_RCSID("@(#)$Sendmail: readcf.c,v 8.587 2001/09/22 20:48:35 ca Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@@ -645,7 +645,7 @@ readcf(cfname, safe, e)
}
}
}
- /*
+/*
** TRANSLATE_DOLLARS -- convert $x into internal form
**
** Actually does all appropriate pre-processing of a config line
@@ -726,7 +726,7 @@ translate_dollars(bp)
while (--p > bp && isascii(*p) && isspace(*p))
*p = '\0';
}
- /*
+/*
** TOOMANY -- signal too many of some option
**
** Parameters:
@@ -747,7 +747,7 @@ toomany(id, maxcnt)
{
syserr("too many %c lines, %d max", id, maxcnt);
}
- /*
+/*
** FILECLASS -- read members of a class from a file
**
** Parameters:
@@ -964,7 +964,7 @@ fileclass(class, filename, fmt, safe, optional)
f = NULL;
else
f = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) fd, SM_IO_RDONLY, NULL);
+ (void *) &fd, SM_IO_RDONLY, NULL);
}
else
{
@@ -1017,7 +1017,7 @@ fileclass(class, filename, fmt, safe, optional)
if (pid > 0)
(void) waitfor(pid);
}
- /*
+/*
** MAKEMAILER -- define a new mailer.
**
** Parameters:
@@ -1475,7 +1475,7 @@ makemailer(line)
Mailer[i] = s->s_mailer = m;
m->m_mno = i;
}
- /*
+/*
** MUNCHSTRING -- translate a string into internal form.
**
** Parameters:
@@ -1547,7 +1547,7 @@ munchstring(p, delimptr, delim)
*q++ = '\0';
return buf;
}
- /*
+/*
** EXTRQUOTSTR -- extract a (quoted) string.
**
** This routine deals with quoted (") strings and escaped
@@ -1607,7 +1607,7 @@ extrquotstr(p, delimptr, delimbuf, st)
*st = !(quotemode || backslash);
return buf;
}
- /*
+/*
** MAKEARGV -- break up a string into words
**
** Parameters:
@@ -1648,7 +1648,7 @@ makeargv(p)
return avp;
}
- /*
+/*
** PRINTRULES -- print rewrite rules (for debugging)
**
** Parameters:
@@ -1685,7 +1685,7 @@ printrules()
}
}
}
- /*
+/*
** PRINTMAILER -- print mailer structure (for debugging)
**
** Parameters:
@@ -1762,7 +1762,7 @@ printmailer(m)
}
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "\n");
}
- /*
+/*
** SETOPTION -- set global processing option
**
** Parameters:
@@ -2155,6 +2155,11 @@ setoption(opt, val, safe, sticky, e)
if (o->o_code == opt)
break;
}
+ if (o->o_name == NULL)
+ {
+ syserr("readcf: unknown option name 0x%x", opt & 0xff);
+ return;
+ }
subopt = NULL;
}
@@ -3484,7 +3489,7 @@ setoption(opt, val, safe, sticky, e)
if (sticky && !bitset(OI_SUBOPT, o->o_flags))
setbitn(opt, StickyOpt);
}
- /*
+/*
** SETCLASS -- set a string into a class
**
** Parameters:
@@ -3528,7 +3533,7 @@ setclass(class, str)
setbitn(bitidx(class), s->s_class);
}
}
- /*
+/*
** MAKEMAPENTRY -- create a map entry
**
** Parameters:
@@ -3608,7 +3613,7 @@ makemapentry(line)
}
return &s->s_map;
}
- /*
+/*
** STRTORWSET -- convert string to rewriting set number
**
** Parameters:
@@ -3736,7 +3741,7 @@ strtorwset(p, endp, stabmode)
}
return ruleset;
}
- /*
+/*
** SETTIMEOUT -- set an individual timeout
**
** Parameters:
@@ -4057,7 +4062,7 @@ settimeout(name, val, sticky)
setbitn(to->to_code + i, StickyTimeoutOpt);
}
}
- /*
+/*
** INITTIMEOUTS -- parse and set timeout values
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/recipient.c b/gnu/usr.sbin/sendmail/sendmail/recipient.c
index 4b1fb0b1a51..fc21bb54762 100644
--- a/gnu/usr.sbin/sendmail/sendmail/recipient.c
+++ b/gnu/usr.sbin/sendmail/sendmail/recipient.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: recipient.c,v 8.322 2001/09/04 22:43:05 ca Exp $")
+SM_RCSID("@(#)$Sendmail: recipient.c,v 8.325 2001/09/11 04:05:16 gshapiro Exp $")
static void includetimeout __P((void));
static ADDRESS *self_reference __P((ADDRESS *));
@@ -307,7 +307,7 @@ sendtolist(list, ctladdr, sendq, aliaslevel, e)
return naddrs;
}
#if MILTER
- /*
+/*
** REMOVEFROMLIST -- Remove addresses from a send list.
**
** The parameter is a comma-separated list of recipients to remove.
@@ -419,7 +419,7 @@ removefromlist(list, sendq, e)
return naddrs;
}
#endif /* MILTER */
- /*
+/*
** RECIPIENT -- Designate a message recipient
**
** Saves the named person for future mailing.
@@ -1103,7 +1103,7 @@ recipient(new, sendq, aliaslevel, e)
macdefine(&e->e_macro, A_TEMP, macid("{nrcpts}"), buf0);
return new;
}
- /*
+/*
** FINDUSER -- find the password entry for a user.
**
** This looks a lot like getpwnam, except that it may want to
@@ -1241,7 +1241,7 @@ finduser(name, fuzzyp, user)
return EX_NOUSER;
#endif /* MATCHGECOS */
}
- /*
+/*
** WRITABLE -- predicate returning if the file is writable.
**
** This routine must duplicate the algorithm in sys/fio.c.
@@ -1333,7 +1333,7 @@ writable(filename, ctladdr, flags)
errno = safefile(filename, euid, egid, user, flags, S_IWRITE, NULL);
return errno == 0;
}
- /*
+/*
** INCLUDE -- handle :include: specification.
**
** Parameters:
@@ -1874,7 +1874,7 @@ includetimeout()
errno = ETIMEDOUT;
longjmp(CtxIncludeTimeout, 1);
}
- /*
+/*
** SENDTOARGV -- send to an argument vector.
**
** Parameters:
@@ -1899,7 +1899,7 @@ sendtoargv(argv, e)
while ((p = *argv++) != NULL)
(void) sendtolist(p, NULLADDR, &e->e_sendqueue, 0, e);
}
- /*
+/*
** GETCTLADDR -- get controlling address from an address header.
**
** If none, get one corresponding to the effective userid.
@@ -1919,7 +1919,7 @@ getctladdr(a)
a = a->q_alias;
return a;
}
- /*
+/*
** SELF_REFERENCE -- check to see if an address references itself
**
** The check is done through a chain of aliases. If it is part of
diff --git a/gnu/usr.sbin/sendmail/sendmail/sasl.c b/gnu/usr.sbin/sendmail/sendmail/sasl.c
index 00cbd95f399..da3ad949362 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sasl.c
+++ b/gnu/usr.sbin/sendmail/sendmail/sasl.c
@@ -10,7 +10,7 @@
#if SASL
# include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: sasl.c,v 8.8 2001/09/04 22:43:05 ca Exp $")
+SM_RCSID("@(#)$Sendmail: sasl.c,v 8.11 2001/09/11 04:05:16 gshapiro Exp $")
# include <stdlib.h>
# include <sendmail.h>
# include <errno.h>
@@ -140,7 +140,7 @@ sm_sasl_init()
sasl_set_alloc(sm_sasl_malloc, sm_sasl_calloc,
sm_sasl_realloc, sm_sasl_free);
}
- /*
+/*
** INTERSECT -- create the intersection between two lists
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/savemail.c b/gnu/usr.sbin/sendmail/sendmail/savemail.c
index 0f90db8d443..8240a98347f 100644
--- a/gnu/usr.sbin/sendmail/sendmail/savemail.c
+++ b/gnu/usr.sbin/sendmail/sendmail/savemail.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: savemail.c,v 8.287 2001/09/04 22:43:05 ca Exp $")
+SM_RCSID("@(#)$Sendmail: savemail.c,v 8.291 2001/09/11 04:05:16 gshapiro Exp $")
static void errbody __P((MCI *, ENVELOPE *, char *));
static bool pruneroute __P((char *));
@@ -32,7 +32,7 @@ static bool pruneroute __P((char *));
** message; otherwise just send the header.
**
** Returns:
-** true if the df file should be preserved by dropenvelope()
+** true if the data file should be preserved by dropenvelope()
**
** Side Effects:
** Saves the letter, by writing or mailing it back to the
@@ -205,7 +205,8 @@ savemail(e, sendbody)
}
else
{
- syserr("Cannot open %s", queuename(e, 'x'));
+ syserr("Cannot open %s",
+ queuename(e, XSCRPT_LETTER));
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
"Transcript of session is unavailable.\r\n");
}
@@ -475,7 +476,7 @@ savemail(e, sendbody)
}
return savedf;
}
- /*
+/*
** RETURNTOSENDER -- return a message to the sender with an error.
**
** Parameters:
@@ -738,7 +739,7 @@ returntosender(msg, returnq, flags, e)
}
return -1;
}
- /*
+/*
** ERRBODY -- output the body of an error message.
**
** Typically this is a copy of the transcript plus a copy of the
@@ -1353,7 +1354,7 @@ errbody(mci, e, separator)
if (errno != 0)
syserr("errbody: I/O error");
}
- /*
+/*
** SMTPTODSN -- convert SMTP to DSN status code
**
** Parameters:
@@ -1423,7 +1424,7 @@ smtptodsn(smtpstat)
return "4.0.0";
return "5.0.0";
}
- /*
+/*
** XTEXTIFY -- take regular text and turn it into DSN-style xtext
**
** Parameters:
@@ -1497,7 +1498,7 @@ xtextify(t, taboo)
*p = '\0';
return bp;
}
- /*
+/*
** XUNTEXTIFY -- take xtext and turn it into plain text
**
** Parameters:
@@ -1577,7 +1578,7 @@ xuntextify(t)
*p = '\0';
return bp;
}
- /*
+/*
** XTEXTOK -- check if a string is legal xtext
**
** Xtext is used in Delivery Status Notifications. The spec was
@@ -1614,7 +1615,7 @@ xtextok(s)
}
return true;
}
- /*
+/*
** PRUNEROUTE -- prune an RFC-822 source route
**
** Trims down a source route to the last internet-registered hop.
diff --git a/gnu/usr.sbin/sendmail/sendmail/sendmail.h b/gnu/usr.sbin/sendmail/sendmail/sendmail.h
index 22a32fc348d..4d0ba670cbe 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sendmail.h
+++ b/gnu/usr.sbin/sendmail/sendmail/sendmail.h
@@ -48,7 +48,7 @@
#ifdef _DEFINE
# ifndef lint
-SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.876 2001/09/04 22:43:05 ca Exp $";
+SM_UNUSED(static char SmailId[]) = "@(#)$Sendmail: sendmail.h,v 8.883 2001/09/25 18:59:53 ca Exp $";
# endif /* ! lint */
#endif /* _DEFINE */
@@ -198,7 +198,7 @@ typedef struct envelope ENVELOPE;
typedef struct mailer MAILER;
typedef struct queuegrp QUEUEGRP;
- /*
+/*
** Address structure.
** Addresses are stored internally in this structure.
*/
@@ -337,7 +337,7 @@ extern void setsender __P((char *, ENVELOPE *, char **, int, bool));
/* macro to simplify the common call to rewrite() */
#define REWRITE(pvp, rs, env) rewrite(pvp, rs, 0, env, MAXATOM)
- /*
+/*
** Mailer definition structure.
** Every mailer known to the system is declared in this
** structure. It defines the pathname of the mailer, some
@@ -451,7 +451,7 @@ EXTERN MAILER *LocalMailer; /* ptr to local mailer */
EXTERN MAILER *ProgMailer; /* ptr to program mailer */
EXTERN MAILER *Mailer[MAXMAILERS + 1];
- /*
+/*
** Queue group definition structure.
** Every queue group known to the system is declared in this structure.
** It defines the basic pathname of the queue group, some flags
@@ -517,7 +517,7 @@ extern bool filesys_free __P((long));
#endif /* _FFR_ANY_FREE_FS */
#if SASL
- /*
+/*
** SASL
*/
@@ -585,7 +585,7 @@ EXTERN int SASLOpts; /* options for SASL */
EXTERN int MaxSLBits; /* max. encryption bits for SASL */
#endif /* SASL */
- /*
+/*
** Structure to store macros.
*/
typedef struct
@@ -597,7 +597,7 @@ typedef struct
EXTERN MACROS_T GlobalMacros;
- /*
+/*
** Information about currently open connections to mailers, or to
** hosts that we have looked up recently.
*/
@@ -711,7 +711,7 @@ EXTERN int MaxMciCache; /* maximum entries in MCI cache */
EXTERN time_t MciCacheTimeout; /* maximum idle time on connections */
EXTERN time_t MciInfoTimeout; /* how long 'til we retry down hosts */
- /*
+/*
** Header structure.
** This structure is used internally to store header items.
*/
@@ -768,7 +768,7 @@ extern struct hdrinfo HdrInfo[];
#define CHHDR_DEF 0x0001 /* default header */
#define CHHDR_CHECK 0x0002 /* call ruleset for header */
#define CHHDR_USER 0x0004 /* header from user */
-#define CHHDR_QUEUE 0x0008 /* header from qf file */
+#define CHHDR_QUEUE 0x0008 /* header from queue file */
/* functions */
extern void addheader __P((char *, char *, int, ENVELOPE *));
@@ -781,7 +781,7 @@ extern bool isheader __P((char *));
extern void putfromline __P((MCI *, ENVELOPE *));
extern void setupheaders __P((void));
- /*
+/*
** Performance monitoring
*/
@@ -796,7 +796,7 @@ TIMERS
#define PUSHTIMER(l, t) { if (tTd(98, l)) pushtimer(&t); }
#define POPTIMER(l, t) { if (tTd(98, l)) poptimer(&t); }
- /*
+/*
** Envelope structure.
** This structure defines the message itself. There is usually
** only one of these -- for the message that we originally read
@@ -856,14 +856,18 @@ struct envelope
char *e_statmsg; /* stat msg (changes per delivery).
* readonly. NULL or allocated from
* e_rpool. */
+#if _FFR_QUARANTINE
+ char *e_holdmsg; /* why envelope is quarantined */
+ char e_qfletter; /* queue file letter on disk */
+#endif /* _FFR_QUARANTINE */
char *e_msgboundary; /* MIME-style message part boundary */
char *e_origrcpt; /* original recipient (one only) */
char *e_envid; /* envelope id from MAIL FROM: line */
char *e_status; /* DSN status for this message */
time_t e_dtime; /* time of last delivery attempt */
int e_ntries; /* number of delivery attempts */
- dev_t e_dfdev; /* df file's device, for crash recov */
- ino_t e_dfino; /* df file's ino, for crash recovery */
+ dev_t e_dfdev; /* data file device (crash recovery) */
+ ino_t e_dfino; /* data file inode (crash recovery) */
MACROS_T e_macro; /* macro definitions */
MCI *e_mci; /* connection info */
char *e_auth_param; /* readonly; NULL or static storage or
@@ -900,7 +904,7 @@ struct envelope
#define EF_NL_NOT_EOL 0x0040000L /* don't accept raw NL as EOLine */
#define EF_CRLF_NOT_EOL 0x0080000L /* don't accept CR-LF as EOLine */
#define EF_RET_PARAM 0x0100000L /* RCPT command had RET argument */
-#define EF_HAS_DF 0x0200000L /* set when df file is instantiated */
+#define EF_HAS_DF 0x0200000L /* set when data file is instantiated */
#define EF_IS_MIME 0x0400000L /* really is a MIME message */
#define EF_DONT_MIME 0x0800000L /* never MIME this message */
#define EF_DISCARD 0x1000000L /* discard the message */
@@ -916,6 +920,12 @@ struct envelope
#define IS_DLVR_TRACE(e) (((e)->e_dlvr_flag & DLVR_TRACE) != 0)
#define IS_DLVR_BY(e) ((e)->e_dlvr_flag != 0)
+#define BODYTYPE_NONE (0)
+#define BODYTYPE_7BIT (1)
+#define BODYTYPE_8BITMIME (2)
+#define BODYTYPE_ILLEGAL (-1)
+#define BODYTYPE_VALID(b) ((b) == BODYTYPE_7BIT || (b) == BODYTYPE_8BITMIME)
+
extern ENVELOPE BlankEnvelope;
/* functions */
@@ -926,7 +936,7 @@ extern void printenvflags __P((ENVELOPE *));
extern void putbody __P((MCI *, ENVELOPE *, char *));
extern void putheader __P((MCI *, HDR *, ENVELOPE *, int));
- /*
+/*
** Message priority classes.
**
** The message class is read directly from the Priority: header
@@ -959,7 +969,7 @@ struct priority
EXTERN int NumPriorities; /* pointer into Priorities */
EXTERN struct priority Priorities[MAXPRIORITIES];
- /*
+/*
** Rewrite rules.
*/
@@ -1061,7 +1071,7 @@ extern int strtorwset __P((char *, char **, int));
extern void translate_dollars __P((char *));
extern bool wordinclass __P((char *, int));
- /*
+/*
** Name canonification short circuit.
**
** If the name server for a host is down, the process of trying to
@@ -1102,7 +1112,7 @@ extern int getmxrr __P((char *, char **, unsigned short *, bool, int *, bool, in
extern char *hostsignature __P((MAILER *, char *));
extern int getfallbackmxrr __P((char *));
- /*
+/*
** Mapping functions
**
** These allow arbitrary mappings in the config file. The idea
@@ -1241,7 +1251,7 @@ extern int udbexpand __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
extern char *udbsender __P((char *, SM_RPOOL_T *));
#endif /* USERDB */
- /*
+/*
** LDAP related items
*/
#if LDAPMAP
@@ -1271,7 +1281,7 @@ extern bool ldapmap_parseargs __P((MAP *, char *));
extern void ldapmap_set_defaults __P((char *));
#endif /* LDAPMAP */
- /*
+/*
** PH related items
*/
@@ -1290,7 +1300,7 @@ struct ph_map_struct
typedef struct ph_map_struct PH_MAP_STRUCT;
#endif /* PH_MAP */
- /*
+/*
** Process List (proclist)
*/
@@ -1317,7 +1327,7 @@ extern void proc_list_probe __P((void));
extern void proc_list_set __P((pid_t, char *));
extern void proc_list_signal __P((int, int));
- /*
+/*
** Symbol table definitions
*/
@@ -1408,7 +1418,7 @@ typedef struct symtab STAB;
extern STAB *stab __P((char *, int, int));
extern void stabapply __P((void (*)(STAB *, int), int));
- /*
+/*
** Operation, send, error, and MIME modes
**
** The operation mode describes the basic operation of sendmail.
@@ -1598,7 +1608,7 @@ extern char *validate_connection __P((SOCKADDR *, char *, ENVELOPE *));
#endif /* NETINET || NETINET6 || NETUNIX || NETISO || NETNS || NETX25 */
#if MILTER
- /*
+/*
** Mail Filters (milter)
*/
@@ -1690,7 +1700,7 @@ struct termescape
char *te_rv_off; /* turn reverse-video off */
};
- /*
+/*
** Additional definitions
*/
@@ -1719,7 +1729,7 @@ struct termescape
#define D_ISSET ((char)0x03) /* this client struct is set */
#if STARTTLS
- /*
+/*
** TLS
*/
@@ -1792,10 +1802,26 @@ EXTERN char *Srvkeyfile; /* file with server private key */
EXTERN unsigned long TLS_Srv_Opts; /* TLS server options */
#endif /* STARTTLS */
- /*
+/*
** Queue related items
*/
+/* queue file names */
+#if _FFR_QUARANTINE
+# define ANYQFL_LETTER '?'
+# define HELDQF_LETTER 'h'
+#else /* _FFR_QUARANTINE */
+/* Before quarantining, ANYQF == NORMQF */
+# define ANYQFL_LETTER 'q'
+#endif /* _FFR_QUARANTINE */
+#define DATAFL_LETTER 'd'
+#define XSCRPT_LETTER 'x'
+#define NORMQF_LETTER 'q'
+#define NEWQFL_LETTER 't'
+
+# define TEMPQF_LETTER 'T'
+# define LOSEQF_LETTER 'Q'
+
/* queue sort order */
#define QSO_BYPRIORITY 0 /* sort by message priority */
#define QSO_BYHOST 1 /* sort by first host name */
@@ -1829,6 +1855,13 @@ EXTERN unsigned long TLS_Srv_Opts; /* TLS server options */
#define SAFE_INTERACTIVE 1 /* limit fsync() in -odi */
#define SAFE_REALLY 2 /* always fsync() */
+#if _FFR_QUARANTINE
+/* QueueMode bits */
+# define QM_NORMAL 0x0001
+# define QM_HELD 0x0002
+# define QM_LOST 0x0004
+#endif /* _FFR_QUARANTINE */
+
/* Queue Run Limitations */
struct queue_char
{
@@ -1845,7 +1878,10 @@ EXTERN int MaxQueueChildren; /* max # of forked queue children */
EXTERN int MaxRunnersPerQueue; /* max # proc's active in queue group */
EXTERN int NiceQueueRun; /* nice queue runs to this value */
EXTERN int NumQueue; /* number of queue groups */
-EXTERN int QueueFileMode; /* mode on qf/tf/df files */
+EXTERN int QueueFileMode; /* mode on files in mail queue */
+#if _FFR_QUARANTINE
+EXTERN int QueueMode; /* which queue items to act upon */
+#endif /* _FFR_QUARANTINE */
EXTERN int QueueSortOrder; /* queue sorting order algorithm */
EXTERN time_t MinQueueAge; /* min delivery interval */
EXTERN time_t QueueIntvl; /* intervals between running the queue */
@@ -1856,6 +1892,9 @@ EXTERN time_t QueueInitDelay; /* initial queue delay */
EXTERN time_t QueueMaxDelay; /* maximum queue delay */
#endif /* _FFR_QUEUEDELAY */
EXTERN QUEUE_CHAR *QueueLimitId; /* limit queue run to id */
+#if _FFR_QUARANTINE
+EXTERN QUEUE_CHAR *QueueLimitReason; /* limit queue run to rcpt */
+#endif /* _FFR_QUARANTINE */
EXTERN QUEUE_CHAR *QueueLimitRecipient; /* limit queue run to rcpt */
EXTERN QUEUE_CHAR *QueueLimitSender; /* limit queue run to sender */
EXTERN QUEUEGRP *Queue[MAXQUEUEGROUPS + 1]; /* queue groups */
@@ -1958,7 +1997,7 @@ extern void inittimeouts __P((char *, bool));
/* variables */
extern unsigned char tTdvect[100]; /* trace vector */
- /*
+/*
** Miscellaneous information.
*/
@@ -2025,7 +2064,7 @@ extern unsigned char tTdvect[100]; /* trace vector */
var = _newval; \
} while (0)
- /*
+/*
** Global variables.
*/
@@ -2036,7 +2075,7 @@ EXTERN bool ColonOkInAddr; /* single colon legal in address */
EXTERN bool ConfigFileRead; /* configuration file has been read */
#endif /* !defined(_USE_SUN_NSSWITCH_) && !defined(_USE_DEC_SVC_CONF_) */
EXTERN bool volatile DataProgress; /* have we sent anything since last check */
-EXTERN bool DisConnected; /* running with OutChannel redirected to xf */
+EXTERN bool DisConnected; /* running with OutChannel redirect to transcript file */
EXTERN bool DontExpandCnames; /* do not $[...$] expand CNAMEs */
EXTERN bool DontInitGroups; /* avoid initgroups() because of NIS cost */
EXTERN bool DontLockReadFiles; /* don't read lock support files */
@@ -2132,12 +2171,12 @@ EXTERN uid_t DefUid; /* default uid to run as */
EXTERN uid_t RealUid; /* real uid of caller */
EXTERN uid_t RunAsUid; /* UID to become for bulk of run */
EXTERN uid_t TrustedUid; /* uid of trusted user for files and startup */
-EXTERN size_t DataFileBufferSize; /* size of buffer for in-core df */
+EXTERN size_t DataFileBufferSize; /* size of buf for in-core data file */
EXTERN time_t DeliverByMin; /* deliver by minimum time */
EXTERN time_t DialDelay; /* delay between dial-on-demand tries */
EXTERN time_t SafeAlias; /* interval to wait until @:@ in alias file */
EXTERN time_t ServiceCacheMaxAge; /* refresh interval for cache */
-EXTERN size_t XscriptFileBufferSize; /* size of buffer for in-core xf */
+EXTERN size_t XscriptFileBufferSize; /* size of buf for in-core transcript file */
EXTERN MODE_T OldUmask; /* umask when sendmail starts up */
EXTERN long MaxMessageSize; /* advertised max size we will accept */
EXTERN long MinBlocksFree; /* min # of blocks free on queue fs */
@@ -2297,6 +2336,7 @@ extern void auth_warning __P((ENVELOPE *, const char *, ...));
extern int blocksignal __P((int));
extern bool bitintersect __P((BITMAP256, BITMAP256));
extern bool bitzerop __P((BITMAP256));
+extern int check_bodytype __P((char *));
extern void buildfname __P((char *, char *, char *, int));
extern bool chkclientmodifiers __P((int));
extern bool chkdaemonmodifiers __P((int));
diff --git a/gnu/usr.sbin/sendmail/sendmail/sfsasl.c b/gnu/usr.sbin/sendmail/sendmail/sfsasl.c
index 984cd50bafd..f7f75e1d9cf 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sfsasl.c
+++ b/gnu/usr.sbin/sendmail/sendmail/sfsasl.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: sfsasl.c,v 8.84 2001/09/03 22:35:38 gshapiro Exp $")
+SM_RCSID("@(#)$Sendmail: sfsasl.c,v 8.86 2001/09/11 04:05:16 gshapiro Exp $")
#include <stdlib.h>
#include <sendmail.h>
#include <errno.h>
diff --git a/gnu/usr.sbin/sendmail/sendmail/shmticklib.c b/gnu/usr.sbin/sendmail/sendmail/shmticklib.c
index 395624de032..e11e978037c 100644
--- a/gnu/usr.sbin/sendmail/sendmail/shmticklib.c
+++ b/gnu/usr.sbin/sendmail/sendmail/shmticklib.c
@@ -11,7 +11,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: shmticklib.c,v 8.11 2000/09/04 19:13:19 ca Exp $")
+SM_RCSID("@(#)$Sendmail: shmticklib.c,v 8.14 2001/09/11 04:05:16 gshapiro Exp $")
#if _FFR_SHM_STATUS
# include <sys/types.h>
@@ -20,7 +20,7 @@ SM_RCSID("@(#)$Sendmail: shmticklib.c,v 8.11 2000/09/04 19:13:19 ca Exp $")
# include "statusd_shm.h"
- /*
+/*
** SHMTICK -- increment a shared memory variable
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c b/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c
index 1f5fa68b3d2..9ffb76fae2d 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c
+++ b/gnu/usr.sbin/sendmail/sendmail/sm_resolve.c
@@ -46,7 +46,7 @@
# if NAMED_BIND
# include "sm_resolve.h"
-SM_RCSID("$Sendmail: sm_resolve.c,v 8.22 2001/09/01 00:06:02 gshapiro Exp $")
+SM_RCSID("$Sendmail: sm_resolve.c,v 8.24 2001/09/11 04:05:16 gshapiro Exp $")
static struct stot
{
diff --git a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
index ab31a677a81..b29b3912f7e 100644
--- a/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
+++ b/gnu/usr.sbin/sendmail/sendmail/srvrsmtp.c
@@ -16,7 +16,7 @@
# include <libmilter/mfdef.h>
#endif /* MILTER */
-SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.778 2001/09/04 22:43:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: srvrsmtp.c,v 8.795 2001/09/25 19:57:10 gshapiro Exp $")
#if SASL || STARTTLS
# include <sys/time.h>
@@ -206,6 +206,9 @@ typedef struct
bool sm_milterize;
bool sm_milterlist; /* any filters in the list? */
#endif /* MILTER */
+#if _FFR_QUARANTINE
+ char *sm_holdmsg; /* carry quarantining across messages */
+#endif /* _FFR_QUARANTINE */
} SMTP_T;
static void smtp_data __P((SMTP_T *, ENVELOPE *));
@@ -622,8 +625,10 @@ smtp(nullserver, d_flags, e)
!bitset(EF_DISCARD, e->e_flags))
{
char state;
+ char *response;
- (void) milter_connect(peerhostname, RealHostAddr, e, &state);
+ response = milter_connect(peerhostname, RealHostAddr,
+ e, &state);
switch (state)
{
case SMFIR_REPLYCODE: /* REPLYCODE shouldn't happen */
@@ -638,6 +643,8 @@ smtp(nullserver, d_flags, e)
smtp.sm_milterize = false;
break;
}
+ if (response != NULL)
+ sm_free(response); /* XXX */
}
#endif /* MILTER */
@@ -694,6 +701,14 @@ smtp(nullserver, d_flags, e)
protocol = NULL;
sendinghost = macvalue('s', e);
+#if _FFR_QUARANTINE
+ /* If quarantining by a connect/ehlo action, save between messages */
+ if (e->e_holdmsg == NULL)
+ smtp.sm_holdmsg = NULL;
+ else
+ smtp.sm_holdmsg = newstr(e->e_holdmsg);
+#endif /* _FFR_QUARANTINE */
+
/* sendinghost's storage must outlive the current envelope */
if (sendinghost != NULL)
sendinghost = sm_strdup_x(sendinghost);
@@ -931,8 +946,9 @@ smtp(nullserver, d_flags, e)
/* NULL pointer ok since it's our function */
if (LogLevel > 8)
sm_syslog(LOG_INFO, NOQID,
- "AUTH=server, relay=%.100s, authid=%.32s, mech=%.16s, bits=%d",
- CurSmtpClient, user,
+ "AUTH=server, relay=%.100s, authid=%.128s, mech=%.16s, bits=%d",
+ CurSmtpClient,
+ shortenstring(user, 128),
auth_type, *ssf);
}
else if (result == SASL_CONTINUE)
@@ -1577,8 +1593,28 @@ smtp(nullserver, d_flags, e)
}
if (gothello)
+ {
CLEAR_STATE(cmdbuf);
+#if _FFR_QUARANTINE
+ /* restore connection quarantining */
+ if (smtp.sm_holdmsg == NULL)
+ {
+ e->e_holdmsg = NULL;
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), "");
+ }
+ else
+ {
+ e->e_holdmsg = sm_rpool_strdup_x(e->e_rpool,
+ smtp.sm_holdmsg);
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"),
+ e->e_holdmsg);
+ }
+#endif /* _FFR_QUARANTINE */
+ }
+
#if MILTER
if (smtp.sm_milterlist && smtp.sm_milterize &&
!bitset(EF_DISCARD, e->e_flags))
@@ -1590,7 +1626,7 @@ smtp(nullserver, d_flags, e)
switch (state)
{
case SMFIR_REPLYCODE:
- nullserver = response;
+ nullserver = newstr(response);
smtp.sm_milterize = false;
break;
@@ -1604,6 +1640,19 @@ smtp(nullserver, d_flags, e)
smtp.sm_milterize = false;
break;
}
+ if (response != NULL)
+ sm_free(response);
+
+#if _FFR_QUARANTINE
+ /*
+ ** If quarantining by a connect/ehlo action,
+ ** save between messages
+ */
+
+ if (smtp.sm_holdmsg == NULL &&
+ e->e_holdmsg != NULL)
+ smtp.sm_holdmsg = newstr(e->e_holdmsg);
+#endif /* _FFR_QUARANTINE */
}
#endif /* MILTER */
gothello = true;
@@ -1870,13 +1919,18 @@ smtp(nullserver, d_flags, e)
/* do config file checking of the sender */
macdefine(&e->e_macro, A_PERM,
macid("{addr_type}"), "e s");
+#if _FFR_MAIL_MACRO
+ /* make the "real" sender address available */
+ macdefine(&e->e_macro, A_TEMP, macid("{mail_from}"),
+ e->e_from.q_paddr);
+#endif /* _FFR_MAIL_MACRO */
if (rscheck("check_mail", addr,
NULL, e, true, true, 3, NULL,
e->e_id) != EX_OK ||
Errors > 0)
sm_exc_raisenew_x(&EtypeQuickAbort, 1);
macdefine(&e->e_macro, A_PERM,
- macid("{addr_type}"), NULL);
+ macid("{addr_type}"), NULL);
if (MaxMessageSize > 0 &&
(e->e_msgsize > MaxMessageSize ||
@@ -2186,6 +2240,22 @@ smtp(nullserver, d_flags, e)
else
message("250 2.0.0 Reset state");
CLEAR_STATE(cmdbuf);
+#if _FFR_QUARANTINE
+ /* restore connection quarantining */
+ if (smtp.sm_holdmsg == NULL)
+ {
+ e->e_holdmsg = NULL;
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), "");
+ }
+ else
+ {
+ e->e_holdmsg = sm_rpool_strdup_x(e->e_rpool,
+ smtp.sm_holdmsg);
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), e->e_holdmsg);
+ }
+#endif /* _FFR_QUARANTINE */
break;
case CMDVRFY: /* vrfy -- verify address */
@@ -2301,7 +2371,11 @@ smtp(nullserver, d_flags, e)
case CMDETRN: /* etrn -- force queue flush */
DELAY_CONN("ETRN");
- if (!bitset(SRV_OFFER_ETRN, features) || UseMSP)
+
+ /* Don't leak queue information via debug flags */
+ if (!bitset(SRV_OFFER_ETRN, features) || UseMSP ||
+ (RealUid != 0 && RealUid != TrustedUid &&
+ OpMode == MD_SMTP))
{
/* different message for MSA ? */
message("502 5.7.0 Sorry, we do not allow this operation");
@@ -2557,7 +2631,7 @@ doquit:
SM_END_TRY
}
}
- /*
+/*
** SMTP_DATA -- implement the SMTP DATA command.
**
** Parameters:
@@ -2710,7 +2784,12 @@ smtp_data(smtp, e)
aborting = Errors > 0;
if (!aborting)
- aborting = !split_by_recipient(e);
+ {
+#if _FFR_QUARANTINE
+ if (QueueMode == QM_HELD || e->e_holdmsg == NULL)
+#endif /* _FFR_QUARANTINE */
+ aborting = !split_by_recipient(e);
+ }
if (aborting)
{
@@ -2775,6 +2854,14 @@ smtp_data(smtp, e)
/* make sure it is in the queue */
queueup(ee, false, true);
}
+#if _FFR_QUARANTINE
+ else if (QueueMode != QM_HELD &&
+ ee->e_holdmsg != NULL)
+ {
+ /* make sure it is in the queue */
+ queueup(ee, false, true);
+ }
+#endif /* _FFR_QUARANTINE */
else
{
/* send to all recipients */
@@ -2801,6 +2888,14 @@ smtp_data(smtp, e)
ee->e_sendmode = SM_QUEUE;
continue;
}
+#if _FFR_QUARANTINE
+ else if (QueueMode != QM_HELD &&
+ ee->e_holdmsg != NULL)
+ {
+ ee->e_sendmode = SM_QUEUE;
+ continue;
+ }
+#endif /* _FFR_QUARANTINE */
anything_to_send = true;
/* close all the queue files */
@@ -2845,6 +2940,15 @@ smtp_data(smtp, e)
{
for (ee = e; ee != NULL; ee = ee->e_sibling)
{
+#if _FFR_QUARANTINE
+ if (!doublequeue &&
+ QueueMode != QM_HELD &&
+ ee->e_holdmsg != NULL)
+ {
+ dropenvelope(ee, true, false);
+ continue;
+ }
+#endif /* _FFR_QUARANTINE */
if (WILL_BE_QUEUED(ee->e_sendmode))
dropenvelope(ee, true, false);
}
@@ -2861,8 +2965,23 @@ smtp_data(smtp, e)
CurEnv = e;
newenvelope(e, e, sm_rpool_new_x(NULL));
e->e_flags = BlankEnvelope.e_flags;
+
+#if _FFR_QUARANTINE
+ /* restore connection quarantining */
+ if (smtp->sm_holdmsg == NULL)
+ {
+ e->e_holdmsg = NULL;
+ macdefine(&e->e_macro, A_PERM, macid("{holdmsg}"), "");
+ }
+ else
+ {
+ e->e_holdmsg = sm_rpool_strdup_x(e->e_rpool, smtp->sm_holdmsg);
+ macdefine(&e->e_macro, A_PERM,
+ macid("{holdmsg}"), e->e_holdmsg);
+ }
+#endif /* _FFR_QUARANTINE */
}
- /*
+/*
** LOGUNDELRCPTS -- log undelivered (or all) recipients.
**
** Parameters:
@@ -2904,7 +3023,7 @@ logundelrcpts(e, msg, level, all)
}
e->e_to = NULL;
}
- /*
+/*
** CHECKSMTPATTACK -- check for denial-of-service attack by repetition
**
** Parameters:
@@ -2959,7 +3078,7 @@ checksmtpattack(pcounter, maxcount, waitnow, cname, e)
}
return (time_t) 0;
}
- /*
+/*
** SETUP_SMTPD_IO -- setup I/O fd correctly for the SMTP server
**
** Parameters:
@@ -3035,7 +3154,7 @@ setup_smtpd_io()
(void) fcntl(inchfd, F_SETFL, inmode);
}
}
- /*
+/*
** SKIPWORD -- skip a fixed word.
**
** Parameters:
@@ -3086,7 +3205,7 @@ skipword(p, w)
return p;
}
- /*
+/*
** MAIL_ESMTP_ARGS -- process ESMTP arguments from MAIL line
**
** Parameters:
@@ -3353,7 +3472,7 @@ mail_esmtp_args(kp, vp, e)
/* NOTREACHED */
}
}
- /*
+/*
** RCPT_ESMTP_ARGS -- process ESMTP arguments from RCPT line
**
** Parameters:
@@ -3442,7 +3561,7 @@ rcpt_esmtp_args(a, kp, vp, e)
/* NOTREACHED */
}
}
- /*
+/*
** PRINTVRFYADDR -- print an entry in the verify queue
**
** Parameters:
@@ -3502,7 +3621,7 @@ printvrfyaddr(a, last, vrfy)
}
#if SASL
- /*
+/*
** SASLMECHS -- get list of possible AUTH mechanisms
**
** Parameters:
@@ -3544,7 +3663,7 @@ saslmechs(conn, mechlist)
*mechlist = NULL; /* be paranoid... */
return num;
}
- /*
+/*
** PROXY_POLICY -- define proxy policy for AUTH
**
** Parameters:
@@ -3574,7 +3693,7 @@ proxy_policy(context, auth_identity, requested_user, user, errstr)
#endif /* SASL */
#if STARTTLS
- /*
+/*
** INITSRVTLS -- initialize server side TLS
**
** Parameters:
@@ -3601,7 +3720,7 @@ initsrvtls(tls_ok)
return tls_ok_srv;
}
#endif /* STARTTLS */
- /*
+/*
** SRVFEATURES -- get features for SMTP server
**
** Parameters:
@@ -3698,7 +3817,7 @@ srvfeatures(e, clientname, features)
return features;
}
- /*
+/*
** HELP -- implement the HELP command.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/stab.c b/gnu/usr.sbin/sendmail/sendmail/stab.c
index d83e1b40b64..603c1a9a29e 100644
--- a/gnu/usr.sbin/sendmail/sendmail/stab.c
+++ b/gnu/usr.sbin/sendmail/sendmail/stab.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: stab.c,v 8.80 2001/09/04 22:43:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: stab.c,v 8.84 2001/09/11 04:05:17 gshapiro Exp $")
/*
** STAB -- manage the symbol table
@@ -212,7 +212,7 @@ stab(name, type, op)
return s;
}
- /*
+/*
** STABAPPLY -- apply function to all stab entries
**
** Parameters:
@@ -243,7 +243,7 @@ stabapply(func, arg)
}
}
}
- /*
+/*
** QUEUEUP_MACROS -- queueup the macros in a class
**
** Write the macros listed in the specified class into the
@@ -251,7 +251,7 @@ stabapply(func, arg)
**
** Parameters:
** class -- class ID.
-** qfp -- file pointer to the qf file.
+** qfp -- file pointer to the queue file.
** e -- the envelope.
**
** Returns:
@@ -292,7 +292,7 @@ queueup_macros(class, qfp, e)
}
}
}
- /*
+/*
** COPY_CLASS -- copy class members from one class to another
**
** Parameters:
@@ -324,7 +324,7 @@ copy_class(src, dst)
}
}
- /*
+/*
** RMEXPSTAB -- remove expired entries from SymTab.
**
** These entries need to be removed in long-running processes,
diff --git a/gnu/usr.sbin/sendmail/sendmail/stats.c b/gnu/usr.sbin/sendmail/sendmail/stats.c
index 35a2fdacc39..98069b6a4e1 100644
--- a/gnu/usr.sbin/sendmail/sendmail/stats.c
+++ b/gnu/usr.sbin/sendmail/sendmail/stats.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: stats.c,v 8.47 2001/08/24 17:01:47 ca Exp $")
+SM_RCSID("@(#)$Sendmail: stats.c,v 8.50 2001/09/11 04:05:17 gshapiro Exp $")
#include <sendmail/mailstats.h>
@@ -24,7 +24,7 @@ static bool GotStats = false; /* set when we have stats to merge */
/* See http://physics.nist.gov/cuu/Units/binary.html */
#define ONE_K 1000 /* one thousand (twenty-four?) */
#define KBYTES(x) (((x) + (ONE_K - 1)) / ONE_K)
- /*
+/*
** MARKSTATS -- mark statistics
**
** Parameters:
@@ -76,7 +76,7 @@ markstats(e, to, reject)
GotStats = true;
}
- /*
+/*
** CLEARSTATS -- clear statistics structure
**
** Parameters:
@@ -96,7 +96,7 @@ clearstats()
memset(&Stat, '\0', sizeof Stat);
GotStats = false;
}
- /*
+/*
** POSTSTATS -- post statistics in the statistics file
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/sysexits.c b/gnu/usr.sbin/sendmail/sendmail/sysexits.c
index ceb6257f0bb..51d277e5ec4 100644
--- a/gnu/usr.sbin/sendmail/sendmail/sysexits.c
+++ b/gnu/usr.sbin/sendmail/sendmail/sysexits.c
@@ -13,9 +13,9 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: sysexits.c,v 8.30 2001/02/25 04:53:29 ca Exp $")
+SM_RCSID("@(#)$Sendmail: sysexits.c,v 8.33 2001/09/11 04:05:17 gshapiro Exp $")
- /*
+/*
** DSNTOEXITSTAT -- convert DSN-style error code to EX_ style.
**
** Parameters:
@@ -132,7 +132,7 @@ dsntoexitstat(dsncode)
}
return EX_CONFIG;
}
- /*
+/*
** EXITSTAT -- convert EX_ value to error text.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/timers.c b/gnu/usr.sbin/sendmail/sendmail/timers.c
index 002b7596aac..756e0dc4f69 100644
--- a/gnu/usr.sbin/sendmail/sendmail/timers.c
+++ b/gnu/usr.sbin/sendmail/sendmail/timers.c
@@ -11,7 +11,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: timers.c,v 8.22 2001/05/10 01:16:11 ca Exp $")
+SM_RCSID("@(#)$Sendmail: timers.c,v 8.24 2001/09/11 04:05:17 gshapiro Exp $")
#if _FFR_TIMERS
# include <sys/types.h>
diff --git a/gnu/usr.sbin/sendmail/sendmail/tls.c b/gnu/usr.sbin/sendmail/sendmail/tls.c
index a08339a0f19..30060da7d14 100644
--- a/gnu/usr.sbin/sendmail/sendmail/tls.c
+++ b/gnu/usr.sbin/sendmail/sendmail/tls.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: tls.c,v 8.72 2001/09/04 22:43:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: tls.c,v 8.75 2001/09/11 04:05:17 gshapiro Exp $")
#if STARTTLS
# include <openssl/err.h>
@@ -63,7 +63,7 @@ get_dh512()
# endif /* !NO_DH */
- /*
+/*
** TLS_RAND_INIT -- initialize STARTTLS random generator
**
** Parameters:
@@ -248,7 +248,7 @@ tls_rand_init(randfile, logl)
return true;
# endif /* ! HASURANDOMDEV */
}
- /*
+/*
** INIT_TLS_LIBRARY -- Calls functions which setup TLS library for global use.
**
** Parameters:
@@ -271,7 +271,7 @@ init_tls_library()
return tls_rand_init(RandFile, 7);
}
- /*
+/*
** TLS_SET_VERIFY -- request client certificate?
**
** Parameters:
@@ -336,7 +336,7 @@ tls_set_verify(ctx, ssl, vrfy)
# define TLS_S_DHPAR_EX 0x00400000 /* DH param file exists */
# define TLS_S_DHPAR_OK 0x00800000 /* DH param file is ok to use */
- /*
+/*
** TLS_OK_F -- can var be an absolute filename?
**
** Parameters:
@@ -362,7 +362,7 @@ tls_ok_f(var, fn, srv)
srv ? "Server" : "Client", fn);
return false;
}
- /*
+/*
** TLS_SAFE_F -- is a file safe to use?
**
** Parameters:
@@ -457,7 +457,7 @@ tls_safe_f(var, sff, srv)
ok = false; \
}
- /*
+/*
** INITTLS -- initialize TLS
**
** Parameters:
@@ -977,7 +977,7 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
return ok;
}
- /*
+/*
** TLS_GET_INFO -- get information about TLS connection
**
** Parameters:
@@ -1140,7 +1140,7 @@ tls_get_info(ssl, srv, host, mac, certreq)
}
return r;
}
- /*
+/*
** ENDTLS -- shutdown secure connection
**
** Parameters:
@@ -1230,7 +1230,7 @@ endtls(ssl, side)
}
# if !TLS_NO_RSA
- /*
+/*
** TMP_RSA_KEY -- return temporary RSA key
**
** Parameters:
@@ -1294,7 +1294,7 @@ tmp_rsa_key(s, export, keylength)
return rsa_tmp;
}
# endif /* !TLS_NO_RSA */
- /*
+/*
** APPS_SSL_INFO_CB -- info callback for TLS connections
**
** Parameters:
@@ -1366,7 +1366,7 @@ apps_ssl_info_cb(s, where, ret)
}
}
}
- /*
+/*
** TLS_VERIFY_LOG -- log verify error for TLS certificates
**
** Parameters:
@@ -1408,7 +1408,7 @@ tls_verify_log(ok, ctx)
depth, buf, ok, X509_verify_cert_error_string(reason));
return 1;
}
- /*
+/*
** TLS_VERIFY_CB -- verify callback for TLS certificates
**
** Parameters:
@@ -1434,7 +1434,7 @@ tls_verify_cb(ctx)
}
return ok;
}
- /*
+/*
** TLSLOGERR -- log the errors from the TLS error stack
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/trace.c b/gnu/usr.sbin/sendmail/sendmail/trace.c
index f0c0795302d..cdcba6c79a8 100644
--- a/gnu/usr.sbin/sendmail/sendmail/trace.c
+++ b/gnu/usr.sbin/sendmail/sendmail/trace.c
@@ -15,7 +15,7 @@
#include <sm/debug.h>
#include <sm/string.h>
-SM_RCSID("@(#)$Sendmail: trace.c,v 8.35 2001/08/17 16:02:27 ca Exp $")
+SM_RCSID("@(#)$Sendmail: trace.c,v 8.37 2001/09/11 04:05:17 gshapiro Exp $")
static char *tTnewflag __P((char *));
static char *tToldflag __P((char *));
diff --git a/gnu/usr.sbin/sendmail/sendmail/udb.c b/gnu/usr.sbin/sendmail/sendmail/udb.c
index cc568a68feb..1ba4caa246d 100644
--- a/gnu/usr.sbin/sendmail/sendmail/udb.c
+++ b/gnu/usr.sbin/sendmail/sendmail/udb.c
@@ -14,9 +14,9 @@
#include <sendmail.h>
#if USERDB
-SM_RCSID("@(#)$Sendmail: udb.c,v 8.150 2001/09/04 22:54:42 ca Exp $ (with USERDB)")
+SM_RCSID("@(#)$Sendmail: udb.c,v 8.153 2001/09/11 04:05:17 gshapiro Exp $ (with USERDB)")
#else /* USERDB */
-SM_RCSID("@(#)$Sendmail: udb.c,v 8.150 2001/09/04 22:54:42 ca Exp $ (without USERDB)")
+SM_RCSID("@(#)$Sendmail: udb.c,v 8.153 2001/09/11 04:05:17 gshapiro Exp $ (without USERDB)")
#endif /* USERDB */
#if USERDB
@@ -549,7 +549,7 @@ udbexpand(a, sendq, aliaslevel, e)
}
return EX_OK;
}
- /*
+/*
** UDBSENDER -- return canonical external name of sender, given local name
**
** Parameters:
@@ -572,7 +572,7 @@ udbsender(sender, rpool)
{
return udbmatch(sender, "mailname", rpool);
}
- /*
+/*
** UDBMATCH -- match user in field, return result of lookup.
**
** Parameters:
@@ -817,7 +817,7 @@ udbmatch(user, field, rpool)
/* still nothing.... too bad */
return NULL;
}
- /*
+/*
** UDB_MAP_LOOKUP -- look up arbitrary entry in user database map
**
** Parameters:
@@ -875,7 +875,7 @@ udb_map_lookup(map, name, av, statp)
SM_END_TRY
return result;
}
- /*
+/*
** _UDBX_INIT -- parse the UDB specification, opening any valid entries.
**
** Parameters:
@@ -1191,7 +1191,7 @@ _udb_parsespec(udbspec, opt, maxopts)
}
return optnum;
}
- /*
+/*
** _UDBX_CLOSE -- close all file based UDB entries.
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/usersmtp.c b/gnu/usr.sbin/sendmail/sendmail/usersmtp.c
index bc1d7d898fe..4294f131c03 100644
--- a/gnu/usr.sbin/sendmail/sendmail/usersmtp.c
+++ b/gnu/usr.sbin/sendmail/sendmail/usersmtp.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: usersmtp.c,v 8.418 2001/09/04 22:43:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: usersmtp.c,v 8.423 2001/09/24 14:16:54 ca Exp $")
#include <sysexits.h>
@@ -47,7 +47,7 @@ extern void sm_sasl_free __P((void *));
static char SmtpMsgBuffer[MAXLINE]; /* buffer for commands */
static char SmtpReplyBuffer[MAXLINE]; /* buffer for replies */
static bool SmtpNeedIntro; /* need "while talking" in transcript */
- /*
+/*
** SMTPINIT -- initialize SMTP.
**
** Opens the connection and sends the initial protocol.
@@ -269,7 +269,7 @@ tryhelo:
smtpquit(m, mci, e);
return;
}
- /*
+/*
** ESMTP_CHECK -- check to see if this implementation likes ESMTP protocol
**
** Parameters:
@@ -310,7 +310,7 @@ esmtp_check(line, firstline, m, mci, e)
/* specify prototype so compiler can check calls */
static char *str_union __P((char *, char *, SM_RPOOL_T *));
- /*
+/*
** STR_UNION -- create the union of two lists
**
** Parameters:
@@ -380,7 +380,7 @@ str_union(s1, s2, rpool)
}
#endif /* SASL */
- /*
+/*
** HELO_OPTIONS -- process the options on a HELO line.
**
** Parameters:
@@ -527,7 +527,7 @@ static sasl_callback_t callbacks[] =
{ SASL_CB_LIST_END, NULL, NULL }
};
- /*
+/*
** INIT_SASL_CLIENT -- initialize client side of Cyrus-SASL
**
** Parameters:
@@ -578,7 +578,7 @@ stop_sasl_client()
sasl_clt_init = false;
sasl_done();
}
- /*
+/*
** GETSASLDATA -- process the challenges from the SASL protocol
**
** This gets the relevant sasl response data out of the reply
@@ -654,7 +654,7 @@ getsasldata(line, firstline, m, mci, e)
mci->mci_sasl_string_len = len;
return;
}
- /*
+/*
** READAUTH -- read auth values from a file
**
** Parameters:
@@ -723,7 +723,7 @@ readauth(filename, safe, sai, rpool)
f = NULL;
else
f = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
- (void *) fd, SM_IO_RDONLY, NULL);
+ (void *) &fd, SM_IO_RDONLY, NULL);
}
else
#endif /* !_FFR_ALLOW_SASLINFO */
@@ -875,12 +875,13 @@ getauth(mci, e, sai)
}
l = strlen(pvp[i + 1]);
- /* remove closing quote */
- if (l > 3 && pvp[i + 1][l - 1] == '"')
- pvp[i + 1][l - 1] = '\0';
- else
+ /* check syntax */
+ if (l <= 3 || pvp[i + 1][l - 1] != '"')
goto fail;
+ /* remove closing quote */
+ pvp[i + 1][l - 1] = '\0';
+
/* remove "TD and " */
l -= 4;
(*sai)[r] = (char *) sm_rpool_malloc(mci->mci_rpool, l + 1);
@@ -952,7 +953,7 @@ getauth(mci, e, sai)
(*sai)[i] = NULL; /* just clear; rpool */
return ret;
}
- /*
+/*
** GETSIMPLE -- callback to get userid or authid
**
** Parameters:
@@ -1086,7 +1087,7 @@ getsimple(context, id, result, len)
}
return SASL_OK;
}
- /*
+/*
** GETSECRET -- callback to get password
**
** Parameters:
@@ -1124,7 +1125,7 @@ getsecret(conn, context, id, psecret)
(*psecret)->len = (unsigned long) len;
return SASL_OK;
}
- /*
+/*
** SAFESASLFILE -- callback for sasl: is file safe?
**
** Parameters:
@@ -1161,12 +1162,12 @@ safesaslfile(context, file)
if (file == NULL || *file == '\0')
return SASL_OK;
sff = SFF_SAFEDIRPATH|SFF_NOWLINK|SFF_NOWWFILES|SFF_ROOTOK;
+#if SASL <= 10515
if ((p = strrchr(file, '/')) == NULL)
p = file;
else
++p;
-#if SASL <= 10515
/* everything beside libs and .conf files must not be readable */
len = strlen(p);
if ((len <= 3 || strncmp(p, "lib", 3) != 0) &&
@@ -1253,7 +1254,7 @@ saslgetrealm(context, id, availrealms, result)
*result = r;
return SASL_OK;
}
- /*
+/*
** ITEMINLIST -- does item appear in list?
**
** Check whether item appears in list (which must be separated by a
@@ -1297,7 +1298,7 @@ iteminlist(item, list, delim)
}
return NULL;
}
- /*
+/*
** REMOVEMECH -- remove item [rem] from list [list]
**
** Parameters:
@@ -1361,7 +1362,7 @@ removemech(rem, list, rpool)
ret[(needle - list) - 1] = '\0';
return ret;
}
- /*
+/*
** ATTEMPTAUTH -- try to AUTHenticate using one mechanism
**
** Parameters:
@@ -1573,7 +1574,7 @@ attemptauth(m, mci, e, sai)
}
/* NOTREACHED */
}
- /*
+/*
** SMTPAUTH -- try to AUTHenticate
**
** This will try mechanisms in the order the sasl library decided until:
@@ -1694,7 +1695,7 @@ smtpauth(m, mci, e)
}
#endif /* SASL */
- /*
+/*
** SMTPMAILFROM -- send MAIL command
**
** Parameters:
@@ -1946,7 +1947,7 @@ smtpmailfrom(m, mci, e)
smtpquit(m, mci, e);
return EX_PROTOCOL;
}
- /*
+/*
** SMTPRCPT -- designate recipient.
**
** Parameters:
@@ -2080,7 +2081,7 @@ smtprcpt(to, m, mci, e, ctladdr, xstart)
return smtprcptstat(to, m, mci, e);
}
- /*
+/*
** SMTPRCPTSTAT -- get recipient status
**
** This is only called during SMTP pipelining
@@ -2167,7 +2168,7 @@ smtprcptstat(to, m, mci, e)
SmtpReplyBuffer);
return EX_PROTOCOL;
}
- /*
+/*
** SMTPDATA -- send the data and clean up the transaction.
**
** Parameters:
@@ -2477,7 +2478,7 @@ datatimeout()
}
errno = save_errno;
}
- /*
+/*
** SMTPGETSTAT -- get status code from DATA in LMTP
**
** Parameters:
@@ -2536,7 +2537,7 @@ smtpgetstat(m, mci, e)
}
return status;
}
- /*
+/*
** SMTPQUIT -- close the SMTP connection.
**
** Parameters:
@@ -2619,7 +2620,7 @@ smtpquit(m, mci, e)
CurHostName = oldcurhost;
return;
}
- /*
+/*
** SMTPRSET -- send a RSET (reset) command
**
** Parameters:
@@ -2672,7 +2673,7 @@ smtprset(m, mci, e)
}
smtpquit(m, mci, e);
}
- /*
+/*
** SMTPPROBE -- check the connection state
**
** Parameters:
@@ -2706,7 +2707,7 @@ smtpprobe(mci)
smtpquit(m, mci, e);
return r;
}
- /*
+/*
** REPLY -- read arpanet reply
**
** Parameters:
@@ -2912,7 +2913,7 @@ reply(m, mci, e, timeout, pfunc, enhstat)
return r;
}
- /*
+/*
** SMTPMESSAGE -- send message to server
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/util.c b/gnu/usr.sbin/sendmail/sendmail/util.c
index 6bdacc2fe50..786893b739a 100644
--- a/gnu/usr.sbin/sendmail/sendmail/util.c
+++ b/gnu/usr.sbin/sendmail/sendmail/util.c
@@ -13,12 +13,12 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Sendmail: util.c,v 8.347 2001/09/04 22:43:06 ca Exp $")
+SM_RCSID("@(#)$Sendmail: util.c,v 8.352 2001/09/26 14:56:58 ca Exp $")
#include <sysexits.h>
#include <sm/xtrap.h>
- /*
+/*
** ADDQUOTES -- Adds quotes & quote bits to a string.
**
** Runs through a string and adds backslashes and quote bits.
@@ -67,7 +67,7 @@ addquotes(s, rpool)
*q = '\0';
return r;
}
- /*
+/*
** RFC822_STRING -- Checks string for proper RFC822 string quoting.
**
** Runs through a string and verifies RFC822 special characters
@@ -125,7 +125,7 @@ rfc822_string(s)
/* unbalanced '"' or '(' */
return !quoted && commentlev == 0;
}
- /*
+/*
** SHORTEN_RFC822_STRING -- Truncate and rebalance an RFC822 string
**
** Arbitrarily shorten (in place) an RFC822 string and rebalance
@@ -233,7 +233,7 @@ increment:
}
return modified;
}
- /*
+/*
** FIND_CHARACTER -- find an unquoted character in an RFC822 string
**
** Find an unquoted, non-commented character in an RFC822
@@ -302,8 +302,34 @@ find_character(string, character)
/* Return pointer to the character */
return string;
}
+
+/*
+** CHECK_BODYTYPE -- check bodytype parameter
+**
+** Parameters:
+** bodytype -- bodytype parameter
+**
+** Returns:
+** BODYTYPE_* according to parameter
+**
+*/
+
+int
+check_bodytype(bodytype)
+ char *bodytype;
+{
+ /* check body type for legality */
+ if (bodytype == NULL)
+ return BODYTYPE_NONE;
+ if (sm_strcasecmp(bodytype, "7BIT") == 0)
+ return BODYTYPE_7BIT;
+ if (sm_strcasecmp(bodytype, "8BITMIME") == 0)
+ return BODYTYPE_8BITMIME;
+ return BODYTYPE_ILLEGAL;
+}
+
#if _FFR_BESTMX_BETTER_TRUNCATION || _FFR_DNSMAP_MULTI
- /*
+/*
** TRUNCATE_AT_DELIM -- truncate string at a delimiter and append "..."
**
** Parameters:
@@ -346,7 +372,7 @@ truncate_at_delim(str, len, delim)
str[0] = '\0';
}
#endif /* _FFR_BESTMX_BETTER_TRUNCATION || _FFR_DNSMAP_MULTI */
- /*
+/*
** XALLOC -- Allocate memory, raise an exception on error
**
** Parameters:
@@ -389,7 +415,7 @@ xalloc(sz)
}
return p;
}
- /*
+/*
** COPYPLIST -- copy list of pointers.
**
** This routine is the equivalent of strdup for lists of
@@ -432,7 +458,7 @@ copyplist(list, copycont, rpool)
return newvp;
}
- /*
+/*
** COPYQUEUE -- copy address queue.
**
** This routine is the equivalent of strdup for address queues;
@@ -471,7 +497,7 @@ copyqueue(addr, rpool)
return ret;
}
- /*
+/*
** LOG_SENDMAIL_PID -- record sendmail pid and command line.
**
** Parameters:
@@ -524,7 +550,7 @@ log_sendmail_pid(e)
if (LogLevel > 9)
sm_syslog(LOG_INFO, NOQID, "started as: %s", CommandLineArgs);
}
- /*
+/*
** SET_DELIVERY_MODE -- set and record the delivery mode
**
** Parameters:
@@ -550,7 +576,7 @@ set_delivery_mode(mode, e)
buf[1] = '\0';
macdefine(&e->e_macro, A_TEMP, macid("{deliveryMode}"), buf);
}
- /*
+/*
** SET_OP_MODE -- set and record the op mode
**
** Parameters:
@@ -576,7 +602,7 @@ set_op_mode(mode)
buf[1] = '\0';
macdefine(&BlankEnvelope.e_macro, A_TEMP, MID_OPMODE, buf);
}
- /*
+/*
** PRINTAV -- print argument vector.
**
** Parameters:
@@ -603,7 +629,7 @@ printav(av)
}
(void) sm_io_putc(smioout, SM_TIME_DEFAULT, '\n');
}
- /*
+/*
** XPUTS -- put string doing control escapes.
**
** Parameters:
@@ -780,7 +806,7 @@ xputs(s)
TermEscape.te_rv_off);
(void) sm_io_flush(smioout, SM_TIME_DEFAULT);
}
- /*
+/*
** MAKELOWER -- Translate a line into lower case
**
** Parameters:
@@ -806,7 +832,7 @@ makelower(p)
if (isascii(c) && isupper(c))
*p = tolower(c);
}
- /*
+/*
** FIXCRLF -- fix <CR><LF> in line.
**
** Looks for the <CR><LF> combination and turns it into the
@@ -841,7 +867,7 @@ fixcrlf(line, stripnl)
*p++ = '\n';
*p = '\0';
}
- /*
+/*
** PUTLINE -- put a line like fputs obeying SMTP conventions
**
** This routine always guarantees outputing a newline (or CRLF,
@@ -865,7 +891,7 @@ putline(l, mci)
{
putxline(l, strlen(l), mci, PXLF_MAPFROM);
}
- /*
+/*
** PUTXLINE -- putline with flags bits.
**
** This routine always guarantees outputing a newline (or CRLF,
@@ -1103,7 +1129,7 @@ putxline(l, len, mci, pxflags)
DataProgress = true;
} while (l < end);
}
- /*
+/*
** XUNLINK -- unlink a file, doing logging as appropriate.
**
** Parameters:
@@ -1133,7 +1159,7 @@ xunlink(f)
SYNC_DIR(f, false);
return i;
}
- /*
+/*
** SFGETS -- "safe" fgets -- times out and ignores random interrupts.
**
** Parameters:
@@ -1241,7 +1267,7 @@ sfgets(buf, siz, fp, timeout, during)
}
return buf;
}
- /*
+/*
** FGETFOLDED -- like fgets, but knows about folded lines.
**
** Parameters:
@@ -1330,7 +1356,7 @@ fgetfolded(buf, n, f)
*p = '\0';
return bp;
}
- /*
+/*
** CURTIME -- return current time.
**
** Parameters:
@@ -1348,7 +1374,7 @@ curtime()
(void) time(&t);
return t;
}
- /*
+/*
** ATOBOOL -- convert a string representation to boolean.
**
** Defaults to false
@@ -1369,7 +1395,7 @@ atobool(s)
return true;
return false;
}
- /*
+/*
** ATOOCT -- convert a string representation to octal.
**
** Parameters:
@@ -1390,7 +1416,7 @@ atooct(s)
i = (i << 3) | (*s++ - '0');
return i;
}
- /*
+/*
** BITINTERSECT -- tell if two bitmaps intersect
**
** Parameters:
@@ -1415,7 +1441,7 @@ bitintersect(a, b)
}
return false;
}
- /*
+/*
** BITZEROP -- tell if a bitmap is all zero
**
** Parameters:
@@ -1439,7 +1465,7 @@ bitzerop(map)
}
return true;
}
- /*
+/*
** STRCONTAINEDIN -- tell if one string is contained in another
**
** Parameters:
@@ -1474,7 +1500,7 @@ strcontainedin(a, b)
}
return false;
}
- /*
+/*
** CHECKFD012 -- check low numbered file descriptors
**
** File descriptors 0, 1, and 2 should be open at all times.
@@ -1498,7 +1524,7 @@ checkfd012(where)
fill_fd(i, where);
#endif /* XDEBUG */
}
- /*
+/*
** CHECKFDOPEN -- make sure file descriptor is open -- for extended debugging
**
** Parameters:
@@ -1524,7 +1550,7 @@ checkfdopen(fd, where)
}
#endif /* XDEBUG */
}
- /*
+/*
** CHECKFDS -- check for new or missing file descriptors
**
** Parameters:
@@ -1584,7 +1610,7 @@ checkfds(where)
}
errno = save_errno;
}
- /*
+/*
** PRINTOPENFDS -- print the open file descriptors (for debugging)
**
** Parameters:
@@ -1609,7 +1635,7 @@ printopenfds(logit)
for (fd = 0; fd < DtableSize; fd++)
dumpfd(fd, false, logit);
}
- /*
+/*
** DUMPFD -- dump a file descriptor
**
** Parameters:
@@ -1798,7 +1824,7 @@ printit:
else
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "%s\n", buf);
}
- /*
+/*
** SHORTEN_HOSTNAME -- strip local domain information off of hostname.
**
** Parameters:
@@ -1845,7 +1871,7 @@ shorten_hostname(host)
}
return NULL;
}
- /*
+/*
** PROG_OPEN -- open a program for reading
**
** Parameters:
@@ -2024,7 +2050,7 @@ prog_open(argv, pfd, e)
_exit(EX_CONFIG);
return -1; /* avoid compiler warning on IRIX */
}
- /*
+/*
** GET_COLUMN -- look up a Column in a line buffer
**
** Parameters:
@@ -2097,7 +2123,7 @@ get_column(line, col, delim, buf, buflen)
(void) sm_strlcpy(buf, begin, i + 1);
return buf;
}
- /*
+/*
** CLEANSTRCPY -- copy string keeping out bogus characters
**
** Parameters:
@@ -2134,7 +2160,7 @@ cleanstrcpy(t, f, l)
}
*t = '\0';
}
- /*
+/*
** DENLSTRING -- convert newlines in a string to spaces
**
** Parameters:
@@ -2190,7 +2216,7 @@ denlstring(s, strict, logattacks)
return bp;
}
- /*
+/*
** STR2PRT -- convert "unprintable" characters in a string to \oct
**
** Parameters:
@@ -2276,7 +2302,7 @@ str2prt(s)
buf[len - 1] = '\0';
return buf;
}
- /*
+/*
** PATH_IS_DIR -- check to see if file exists and is a directory.
**
** There are some additional checks for security violations in
@@ -2325,7 +2351,7 @@ path_is_dir(pathname, createflag)
}
return true;
}
- /*
+/*
** PROC_LIST_ADD -- add process id to list of our children
**
** Parameters:
@@ -2422,7 +2448,7 @@ proc_list_add(pid, task, type, count, other)
CurChildren++;
}
}
- /*
+/*
** PROC_LIST_SET -- set pid task in process list
**
** Parameters:
@@ -2449,7 +2475,7 @@ proc_list_set(pid, task)
}
}
}
- /*
+/*
** PROC_LIST_DROP -- drop pid from process list
**
** Parameters:
@@ -2496,7 +2522,7 @@ proc_list_drop(pid, count, other)
return type;
}
- /*
+/*
** PROC_LIST_CLEAR -- clear the process list
**
** Parameters:
@@ -2519,7 +2545,7 @@ proc_list_clear()
ProcListVec[i].proc_pid = NO_PID;
CurChildren = 0;
}
- /*
+/*
** PROC_LIST_PROBE -- probe processes in the list to see if they still exist
**
** Parameters:
@@ -2557,7 +2583,7 @@ proc_list_probe()
CurChildren = 0;
}
- /*
+/*
** PROC_LIST_DISPLAY -- display the process list
**
** Parameters:
diff --git a/gnu/usr.sbin/sendmail/sendmail/version.c b/gnu/usr.sbin/sendmail/sendmail/version.c
index 759feefd9b8..c7387b84f64 100644
--- a/gnu/usr.sbin/sendmail/sendmail/version.c
+++ b/gnu/usr.sbin/sendmail/sendmail/version.c
@@ -13,6 +13,6 @@
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: version.c,v 8.79 2001/09/07 20:59:16 ca Exp $")
+SM_RCSID("@(#)$Sendmail: version.c,v 8.83 2001/09/29 01:47:38 ca Exp $")
-char Version[] = "8.12.0";
+char Version[] = "8.12.1";
diff --git a/gnu/usr.sbin/sendmail/smrsh/smrsh.c b/gnu/usr.sbin/sendmail/smrsh/smrsh.c
index 8df557a4319..e9170206405 100644
--- a/gnu/usr.sbin/sendmail/smrsh/smrsh.c
+++ b/gnu/usr.sbin/sendmail/smrsh/smrsh.c
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: smrsh.c,v 8.53 2001/08/31 18:36:04 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: smrsh.c,v 8.55 2001/09/11 04:05:22 gshapiro Exp $")
/*
** SMRSH -- sendmail restricted shell
diff --git a/gnu/usr.sbin/sendmail/vacation/vacation.c b/gnu/usr.sbin/sendmail/vacation/vacation.c
index 582b839be74..25ea7f6b9b3 100644
--- a/gnu/usr.sbin/sendmail/vacation/vacation.c
+++ b/gnu/usr.sbin/sendmail/vacation/vacation.c
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
The Regents of the University of California. All rights reserved.\n\
Copyright (c) 1983 Eric P. Allman. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Sendmail: vacation.c,v 8.127 2001/09/08 01:21:15 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Sendmail: vacation.c,v 8.130 2001/09/18 21:45:35 gshapiro Exp $")
#include <ctype.h>
@@ -994,7 +994,8 @@ sendmessage(myname, msgfn, emptysender)
}
/* check return status of the following calls? XXX */
(void) close(pvect[0]);
- if ((sfp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT, (void *)pvect[1],
+ if ((sfp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
+ (void *) &(pvect[1]),
SM_IO_WRONLY, NULL)) != NULL)
{
(void) sm_io_fprintf(sfp, SM_TIME_DEFAULT, "To: %s\n", From);