summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2004-02-14 21:53:31 +0000
committergshapiro <gshapiro@FreeBSD.org>2004-02-14 21:53:31 +0000
commit238623a0204c90e8d61dbde7b3b499a5036f2e5d (patch)
tree136f3e97b372409d2104603a771ff37e36631243 /contrib
parent96b960fca637a0765d566591885b7d42576e723f (diff)
downloadFreeBSD-src-238623a0204c90e8d61dbde7b3b499a5036f2e5d.zip
FreeBSD-src-238623a0204c90e8d61dbde7b3b499a5036f2e5d.tar.gz
Import sendmail 8.12.11
Diffstat (limited to 'contrib')
-rw-r--r--contrib/sendmail/PGPKEYS72
-rw-r--r--contrib/sendmail/RELEASE_NOTES66
-rw-r--r--contrib/sendmail/cf/README18
-rw-r--r--contrib/sendmail/cf/cf/submit.cf9
-rw-r--r--contrib/sendmail/cf/m4/cfhead.m42
-rw-r--r--contrib/sendmail/cf/m4/proto.m48
-rw-r--r--contrib/sendmail/cf/m4/version.m46
-rw-r--r--contrib/sendmail/doc/op/op.me15
-rw-r--r--contrib/sendmail/include/libmilter/mfapi.h4
-rw-r--r--contrib/sendmail/include/libmilter/milter.h8
-rw-r--r--contrib/sendmail/include/sm/cdefs.h5
-rw-r--r--contrib/sendmail/include/sm/conf.h11
-rw-r--r--contrib/sendmail/libmilter/docs/smfi_addrcpt.html2
-rw-r--r--contrib/sendmail/libmilter/docs/smfi_delrcpt.html2
-rw-r--r--contrib/sendmail/libmilter/docs/smfi_setreply.html6
-rw-r--r--contrib/sendmail/libmilter/docs/xxfi_connect.html24
-rw-r--r--contrib/sendmail/libmilter/docs/xxfi_envrcpt.html4
-rw-r--r--contrib/sendmail/libmilter/engine.c61
-rw-r--r--contrib/sendmail/libmilter/libmilter.h4
-rw-r--r--contrib/sendmail/libmilter/listener.c68
-rw-r--r--contrib/sendmail/libmilter/main.c13
-rw-r--r--contrib/sendmail/libmilter/signal.c4
-rw-r--r--contrib/sendmail/libsm/assert.c6
-rw-r--r--contrib/sendmail/libsm/exc.c6
-rw-r--r--contrib/sendmail/libsm/ldap.c10
-rw-r--r--contrib/sendmail/libsm/local.h5
-rw-r--r--contrib/sendmail/smrsh/smrsh.811
-rw-r--r--contrib/sendmail/smrsh/smrsh.c10
-rw-r--r--contrib/sendmail/src/README9
-rw-r--r--contrib/sendmail/src/alias.c4
-rw-r--r--contrib/sendmail/src/conf.c13
-rw-r--r--contrib/sendmail/src/daemon.c18
-rw-r--r--contrib/sendmail/src/deliver.c7
-rw-r--r--contrib/sendmail/src/headers.c14
-rw-r--r--contrib/sendmail/src/main.c49
-rw-r--r--contrib/sendmail/src/milter.c21
-rw-r--r--contrib/sendmail/src/mime.c74
-rw-r--r--contrib/sendmail/src/queue.c121
-rw-r--r--contrib/sendmail/src/readcf.c8
-rw-r--r--contrib/sendmail/src/recipient.c7
-rw-r--r--contrib/sendmail/src/sendmail.835
-rw-r--r--contrib/sendmail/src/sendmail.h3
-rw-r--r--contrib/sendmail/src/srvrsmtp.c51
-rw-r--r--contrib/sendmail/src/tls.c36
-rw-r--r--contrib/sendmail/src/util.c7
-rw-r--r--contrib/sendmail/src/version.c6
46 files changed, 699 insertions, 244 deletions
diff --git a/contrib/sendmail/PGPKEYS b/contrib/sendmail/PGPKEYS
index 35f3a5a..860252b 100644
--- a/contrib/sendmail/PGPKEYS
+++ b/contrib/sendmail/PGPKEYS
@@ -89,6 +89,76 @@ y+PVZ1MwnEXfTQReVSla0AAOIRirHEh4YnUVZzFSNEJqoDRZQwVd7Q==
-----END PGP PUBLIC KEY BLOCK-----
Type Bits KeyID Created Expires Algorithm Use
+pub 1024 0x95F61771 2003-12-10 ---------- RSA Sign & Encrypt
+ Key fingerprint = 46 FE 81 99 48 75 30 B1 3E A9 79 43 BB 78 C1 D4
+uid Sendmail Signing Key/2004 <sendmail@Sendmail.ORG>
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.2.3 (OpenBSD)
+
+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
+=CNJY
+-----END PGP PUBLIC KEY BLOCK-----
+
+Type Bits KeyID Created Expires Algorithm Use
pub 1024 0x396F0789 2003-01-15 ---------- RSA Sign & Encrypt
Key fingerprint = C4 73 DF 4A 97 9C 27 A9 EE 4F B2 BD 55 B5 E0 0F
uid Sendmail Signing Key/2003 <sendmail@Sendmail.ORG>
@@ -952,4 +1022,4 @@ SIXqPke2iCW6+zdG1T/gS5T9T9/Lf2c9FQf0FjURAi3ynDA2RBLA5FDsI8v3
=dbDm
-----END PGP PUBLIC KEY BLOCK-----
-$Revision: 8.13.2.2 $, Last updated $Date: 2003/01/15 01:55:04 $
+$Revision: 8.13.2.4 $, Last updated $Date: 2004/01/13 21:18:06 $
diff --git a/contrib/sendmail/RELEASE_NOTES b/contrib/sendmail/RELEASE_NOTES
index 1f7993b..0d6377d 100644
--- a/contrib/sendmail/RELEASE_NOTES
+++ b/contrib/sendmail/RELEASE_NOTES
@@ -1,12 +1,74 @@
SENDMAIL RELEASE NOTES
- $Id: RELEASE_NOTES,v 8.1340.2.165 2003/09/16 20:50:42 ca Exp $
+ $Id: RELEASE_NOTES,v 8.1340.2.189 2004/01/18 17:50:57 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.10/8.12.10 2003/09/24
+8.12.11/8.12.11 2004/01/18
+ Use QueueFileMode when opening qf files. This error was a
+ regression in 8.12.10. Problem detected and diagnosed
+ Lech Szychowski of the Polish Power Grid Company.
+ Properly count the number of queue runners in a work group and
+ make sure the total limit of MaxQueueChildren is not
+ exceeded. Based on patch from Takayuki Yoshizawa of
+ Techfirm, Inc.
+ Take care of systems that can generate time values where the
+ seconds can exceed the usual range of 0 to 59.
+ Problem noted by Randy Diffenderfer of EDS.
+ Avoid regeneration of identical queue identifiers by processes
+ whose process id is the same as that of the initial
+ sendmail process that was used to start the daemon.
+ Problem noted by Randy Diffenderfer of EDS.
+ When a milter invokes smfi_delrcpt() compare the supplied
+ recipient address also against the printable addresses
+ of the current list to deal with rewritten addresses.
+ Based on patch from Sean Hanson of The Asylum.
+ BadRcptThrottle now also works for addresses which return the
+ error mailer, e.g., virtusertable entries with the
+ right hand side error:. Patch from Per Hedeland.
+ Fix printing of 8 bit characters as octals in log messages.
+ Based on patch by Andrey J. Melnikoff.
+ Undo change of algorithm for MIME 7-bit base64 encoding to 8-bit
+ text that has been introduced in 8.12.3. There are some
+ examples where the new code fails, but the old code works.
+ To get the 8.12.3-8.12.10 version, compile sendmail with
+ -DMIME7TO8_OLD=0. If you have an example of improper
+ 7 to 8 bit conversion please send it to us.
+ Return normal error code for unknown SMTP commands instead of
+ the one specified by check_relay or a milter for a
+ connection. Problem noted by Andrzej Filip.
+ Some ident responses contain data after the terminating CRLF which
+ causes sendmail to log "POSSIBLE ATTACK...newline in string".
+ To avoid this everything after LF is ignored.
+ If the operating system supports O_EXLOCK and HASFLOCK is set
+ then a possible race condition for creating qf files
+ can be avoided. Note: the race condition does not
+ exist within sendmail, but between sendmail and an
+ external application that accesses qf files.
+ Log the proper options name for TLS related mising files for
+ the CACertPath, CACertFile, and DHParameters options.
+ Do not split an envelope if it will be discarded, otherwise df
+ files could be left behind. Problem found by Wolfgang
+ Breyha.
+ The use of the environment variables HOME and HOSTALIASES has been
+ deprecated and will be removed in version 8.13. This only
+ effects configuration which preserve those variable via the
+ 'E' command in the cf file as sendmail clears out its entire
+ environment.
+ Portability:
+ Add support for Darwin 7.0/Mac OS X 10.3 (a.k.a. Panther).
+ Solaris 10 has unsetenv(), patch from Craig Mohrman of
+ Sun Microsystems.
+ LIBMILTER: Add extra checks in case a broken MTA sends bogus data
+ to libmilter. Based on code review by Rob Grzywinski.
+ SMRSH: Properly assemble commands that contain '&&' or '||'.
+ Problem noted by Eric Lee of Talking Heads.
+ New Files:
+ devtools/OS/Darwin.7.0
+
+8.12.10/8.12.10 2003/09/24 (Released: 2003/09/17)
SECURITY: Fix a buffer overflow in address parsing. Problem
detected by Michal Zalewski, patch from Todd C. Miller
of Courtesan Consulting.
diff --git a/contrib/sendmail/cf/README b/contrib/sendmail/cf/README
index 725f72a..ff70579 100644
--- a/contrib/sendmail/cf/README
+++ b/contrib/sendmail/cf/README
@@ -2591,9 +2591,9 @@ my.domain and you have
my.domain RELAY
-in the access map, then all e-mail with a sender address of
-<user@my.domain> gets through, even if check_relay would reject it
-(e.g., based on the hostname or IP address). This allows spammers
+in the access map, then any e-mail with a sender address of
+<user@my.domain> will not be rejected by check_relay even though
+it would match the hostname or IP address. This allows spammers
to get around DNS based blacklist by faking the sender address. To
avoid this problem you have to use tagged entries:
@@ -3858,11 +3858,11 @@ confMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage
receive a 452 error code (i.e., they
are deferred for the next delivery
attempt).
-confBAD_RCPT_THROTTLE BadRcptThrottle [infinite] If set and more than the
- specified number of recipients in an
- envelope are rejected, sleep for one
- second after each rejected RCPT
- command.
+confBAD_RCPT_THROTTLE BadRcptThrottle [infinite] If set and the specified
+ number of recipients in a single SMTP
+ transaction have been rejected, sleep
+ for one second after each subsequent
+ RCPT command in that transaction.
confDONT_PROBE_INTERFACES DontProbeInterfaces
[False] If set, sendmail will _not_
insert the names and addresses of any
@@ -4375,4 +4375,4 @@ M4 DIVERSIONS
8 DNS based blacklists
9 special local rulesets (1 and 2)
-$Revision: 8.623.2.25 $, Last updated $Date: 2003/06/18 18:47:21 $
+$Revision: 8.623.2.27 $, Last updated $Date: 2004/01/11 17:58:25 $
diff --git a/contrib/sendmail/cf/cf/submit.cf b/contrib/sendmail/cf/cf/submit.cf
index f7d3e18..cb9f8c7 100644
--- a/contrib/sendmail/cf/cf/submit.cf
+++ b/contrib/sendmail/cf/cf/submit.cf
@@ -24,7 +24,7 @@
######################################################################
######################################################################
-##### $Id: cfhead.m4,v 8.108.2.3 2003/04/03 17:51:51 ca Exp $ #####
+##### $Id: cfhead.m4,v 8.108.2.6 2003/12/05 02:26:47 ca Exp $ #####
##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ #####
##### $Id: submit.mc,v 8.6.2.7 2003/09/10 22:11:56 ca Exp $ #####
##### $Id: msp.m4,v 1.32 2002/03/26 22:02:03 ca Exp $ #####
@@ -32,7 +32,7 @@
##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ #####
-##### $Id: proto.m4,v 8.649.2.24 2003/08/04 21:14:26 ca Exp $ #####
+##### $Id: proto.m4,v 8.649.2.30 2004/01/11 17:54:06 ca Exp $ #####
# level 10 config file format
V10/Berkeley
@@ -60,6 +60,7 @@ Cwlocalhost
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM
+# host/domain names ending with a token in class P are canonical
CP.
# "Smart" relay host (may be null)
@@ -110,7 +111,7 @@ D{MTAHost}[127.0.0.1]
# Configuration version number
-DZ8.12.10/Submit
+DZ8.12.11/Submit
###############
@@ -276,7 +277,7 @@ O QueueDirectory=/var/spool/clientmqueue
#O Timeout.quit=2m
#O Timeout.misc=2m
#O Timeout.command=1h
-#O Timeout.ident=5s
+O Timeout.ident=0
#O Timeout.fileopen=60s
#O Timeout.control=2m
O Timeout.queuereturn=5d
diff --git a/contrib/sendmail/cf/m4/cfhead.m4 b/contrib/sendmail/cf/m4/cfhead.m4
index db3fae71..c8b6f35 100644
--- a/contrib/sendmail/cf/m4/cfhead.m4
+++ b/contrib/sendmail/cf/m4/cfhead.m4
@@ -305,4 +305,4 @@ define(`confMILTER_MACROS_ENVRCPT', ``{rcpt_mailer}, {rcpt_host}, {rcpt_addr}'')
divert(0)dnl
-VERSIONID(`$Id: cfhead.m4,v 8.108.2.3 2003/04/03 17:51:51 ca Exp $')
+VERSIONID(`$Id: cfhead.m4,v 8.108.2.6 2003/12/05 02:26:47 ca Exp $')
diff --git a/contrib/sendmail/cf/m4/proto.m4 b/contrib/sendmail/cf/m4/proto.m4
index 411bba0..48f4eab 100644
--- a/contrib/sendmail/cf/m4/proto.m4
+++ b/contrib/sendmail/cf/m4/proto.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`$Id: proto.m4,v 8.649.2.24 2003/08/04 21:14:26 ca Exp $')
+VERSIONID(`$Id: proto.m4,v 8.649.2.30 2004/01/11 17:54:06 ca Exp $')
# level CF_LEVEL config file format
V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')
@@ -111,6 +111,7 @@ Fw`'confCW_FILE',
# ... `define' this only if sendmail cannot automatically determine your domain
ifdef(`confDOMAIN_NAME', `Dj`'confDOMAIN_NAME', `#Dj$w.Foo.COM')
+# host/domain names ending with a token in class P are canonical
CP.
ifdef(`UUCP_RELAY',
@@ -633,7 +634,8 @@ _OPTION(Milter.LogLevel, `confMILTER_LOG_LEVEL', `')
_OPTION(Milter.macros.connect, `confMILTER_MACROS_CONNECT', `')
_OPTION(Milter.macros.helo, `confMILTER_MACROS_HELO', `')
_OPTION(Milter.macros.envfrom, `confMILTER_MACROS_ENVFROM', `')
-_OPTION(Milter.macros.envrcpt, `confMILTER_MACROS_ENVRCPT', `')')
+_OPTION(Milter.macros.envrcpt, `confMILTER_MACROS_ENVRCPT', `')
+')
# CA directory
_OPTION(CACertPath, `confCACERT_PATH', `')
diff --git a/contrib/sendmail/cf/m4/version.m4 b/contrib/sendmail/cf/m4/version.m4
index 299588f..b6cc228 100644
--- a/contrib/sendmail/cf/m4/version.m4
+++ b/contrib/sendmail/cf/m4/version.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -11,8 +11,8 @@ divert(-1)
# the sendmail distribution.
#
#
-VERSIONID(`$Id: version.m4,v 8.92.2.22 2003/09/16 20:02:05 ca Exp $')
+VERSIONID(`$Id: version.m4,v 8.92.2.26 2004/01/13 00:29:26 ca Exp $')
#
divert(0)
# Configuration version number
-DZ8.12.10`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.12.11`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/contrib/sendmail/doc/op/op.me b/contrib/sendmail/doc/op/op.me
index 56d795e..d34b7b4 100644
--- a/contrib/sendmail/doc/op/op.me
+++ b/contrib/sendmail/doc/op/op.me
@@ -9,7 +9,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: op.me,v 8.609.2.26 2003/07/28 21:54:53 ca Exp $
+.\" $Id: op.me,v 8.609.2.29 2004/01/11 17:58:24 ca Exp $
.\"
.\" eqn op.me | pic | troff -me
.\"
@@ -90,7 +90,7 @@ Sendmail, Inc.
.de Ve
Version \\$2
..
-.Ve $Revision: 8.609.2.26 $
+.Ve $Revision: 8.609.2.29 $
.rm Ve
.sp
For Sendmail Version 8.12
@@ -1125,7 +1125,7 @@ that some sites might want.
A complete description of the log levels
is given in section
.\" XREF
-4.6.
+4.7.
.sh 2 "Dumping State"
.pp
You can ask
@@ -3025,7 +3025,7 @@ alias files,
:include: files,
and external databases)
must be readable by that user.
-Also, since sendmail will not be able to change it's uid,
+Also, since sendmail will not be able to change its uid,
delivery to programs or files will be marked as unsafe,
e.g., undeliverable,
in
@@ -6227,8 +6227,9 @@ selected SASL mechanisms.
Explanations of these properties can be found in the Cyrus SASL documentation.
.ip BadRcptThrottle=\fIN\fP
[no short name]
-If set and more than the specified number of recipients in a single SMTP
-envelope are rejected, sleep for one second after each rejected RCPT command.
+If set and the specified number of recipients in a single SMTP
+transaction have been rejected, sleep for one second after each subsequent
+RCPT command in that transaction.
.ip BlankSub=\fIc\fP
[B]
Set the blank substitution character to
@@ -10767,7 +10768,7 @@ replace it with a blank sheet for double-sided output.
.\".sz 10
.\"Eric Allman
.\".sp
-.\"Version $Revision: 8.609.2.26 $
+.\"Version $Revision: 8.609.2.29 $
.\".ce 0
.bp 3
.ce
diff --git a/contrib/sendmail/include/libmilter/mfapi.h b/contrib/sendmail/include/libmilter/mfapi.h
index 6d79030..9a7e7d8 100644
--- a/contrib/sendmail/include/libmilter/mfapi.h
+++ b/contrib/sendmail/include/libmilter/mfapi.h
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Id: mfapi.h,v 8.44.2.3 2002/12/19 02:10:09 ca Exp $
+ * $Id: mfapi.h,v 8.44.2.4 2003/10/20 21:51:49 msk Exp $
*/
/*
@@ -108,7 +108,7 @@ struct smfiDesc
};
#if _FFR_SMFI_OPENSOCKET
-LIBMILTER_API int smfi_opensocket __P((void));
+LIBMILTER_API int smfi_opensocket __P((bool));
#endif /* _FFR_SMFI_OPENSOCKET */
LIBMILTER_API int smfi_register __P((struct smfiDesc));
LIBMILTER_API int smfi_main __P((void));
diff --git a/contrib/sendmail/include/libmilter/milter.h b/contrib/sendmail/include/libmilter/milter.h
index 9d0d35d..c18be73 100644
--- a/contrib/sendmail/include/libmilter/milter.h
+++ b/contrib/sendmail/include/libmilter/milter.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -7,7 +7,7 @@
* the sendmail distribution.
*
*
- * $Id: milter.h,v 8.37.2.1 2002/12/19 02:10:09 ca Exp $
+ * $Id: milter.h,v 8.37.2.3 2003/12/02 00:19:51 msk Exp $
*/
/*
@@ -25,7 +25,11 @@
typedef pthread_t sthread_t;
typedef int socket_t;
+#if _FFR_MILTER_MACROS_EOM
+# define MAX_MACROS_ENTRIES 5 /* max size of macro pointer array */
+#else /* _FFR_MILTER_MACROS_EOM */
# define MAX_MACROS_ENTRIES 4 /* max size of macro pointer array */
+#endif /* _FFR_MILTER_MACROS_EOM */
/*
** context for milter
diff --git a/contrib/sendmail/include/sm/cdefs.h b/contrib/sendmail/include/sm/cdefs.h
index bb5e4c1..7b06e79 100644
--- a/contrib/sendmail/include/sm/cdefs.h
+++ b/contrib/sendmail/include/sm/cdefs.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Id: cdefs.h,v 1.15 2002/01/16 18:30:11 ca Exp $
+ * $Id: cdefs.h,v 1.15.2.1 2003/12/05 22:44:17 ca Exp $
*/
/*
@@ -67,11 +67,14 @@
# if __GNUC__ >= 2
# if __GNUC__ == 2 && __GNUC_MINOR__ < 5
# define SM_DEAD(proto) volatile proto
+# define SM_DEAD_D volatile
# else /* __GNUC__ == 2 && __GNUC_MINOR__ < 5 */
# define SM_DEAD(proto) proto __attribute__((__noreturn__))
+# define SM_DEAD_D
# endif /* __GNUC__ == 2 && __GNUC_MINOR__ < 5 */
# else /* __GNUC__ >= 2 */
# define SM_DEAD(proto) proto
+# define SM_DEAD_D
# endif /* __GNUC__ >= 2 */
# endif /* SM_DEAD */
diff --git a/contrib/sendmail/include/sm/conf.h b/contrib/sendmail/include/sm/conf.h
index 0653410..055b958 100644
--- a/contrib/sendmail/include/sm/conf.h
+++ b/contrib/sendmail/include/sm/conf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -10,7 +10,7 @@
* the sendmail distribution.
*
*
- * $Id: conf.h,v 1.90.2.18 2003/08/20 22:27:44 ca Exp $
+ * $Id: conf.h,v 1.90.2.20 2004/01/07 00:52:16 ca Exp $
*/
/*
@@ -437,6 +437,9 @@ typedef int pid_t;
# if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
# define HASURANDOMDEV 1 /* /dev/[u]random added in S9 */
# endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
+# if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210)
+# define HASUNSETENV 1 /* unsetenv() added in S10 */
+# endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */
# ifndef HASGETUSERSHELL
# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */
# endif /* ! HASGETUSERSHELL */
@@ -2254,8 +2257,8 @@ typedef struct msgb mblk_t;
# undef HAVE_SYS_ERRLIST
# define sys_errlist __sys_errlist
# define sys_nerr __sys_nerr
-# define major(dev) ((int)(((dev) >> 8) & 0xff)
-# define minor(dev) ((int)((dev) & 0xff)
+# define major(dev) ((int)(((dev) >> 8) & 0xff))
+# define minor(dev) ((int)((dev) & 0xff))
# endif /* defined(__INTERIX) */
diff --git a/contrib/sendmail/libmilter/docs/smfi_addrcpt.html b/contrib/sendmail/libmilter/docs/smfi_addrcpt.html
index 3b2eb56..16f86c9 100644
--- a/contrib/sendmail/libmilter/docs/smfi_addrcpt.html
+++ b/contrib/sendmail/libmilter/docs/smfi_addrcpt.html
@@ -48,7 +48,7 @@ Add a recipient for the current message.
<td>smfi_addrcpt will fail and return MI_FAILURE if:
<ul><li>rcpt is NULL.
- <li>Adding headers in the current connection state is invalid.
+ <li>Adding recipients in the current connection state is invalid.
<li>A network error occurs.
<li>SMFIF_ADDRCPT was not set when <a href="smfi_register.html">smfi_register</a> was called.
</ul>
diff --git a/contrib/sendmail/libmilter/docs/smfi_delrcpt.html b/contrib/sendmail/libmilter/docs/smfi_delrcpt.html
index 451f36a..9608e61 100644
--- a/contrib/sendmail/libmilter/docs/smfi_delrcpt.html
+++ b/contrib/sendmail/libmilter/docs/smfi_delrcpt.html
@@ -49,7 +49,7 @@ Remove a recipient from the current message's envelope.
<td>smfi_delrcpt will fail and return MI_FAILURE if:
<ul>
<li>rcpt is NULL.
- <li>Adding headers in the current connection state is invalid.
+ <li>Deleting recipients in the current connection state is invalid.
<li>A network error occurs.
<li>SMFIF_DELRCPT was not set when <a href="smfi_register.html">smfi_register</a> was called.
</ul>
diff --git a/contrib/sendmail/libmilter/docs/smfi_setreply.html b/contrib/sendmail/libmilter/docs/smfi_setreply.html
index 646a8f1..d5b0e24 100644
--- a/contrib/sendmail/libmilter/docs/smfi_setreply.html
+++ b/contrib/sendmail/libmilter/docs/smfi_setreply.html
@@ -75,6 +75,12 @@ Otherwise, it return MI_SUCCESS.
<td>
<ul>
<li>Values passed to smfi_setreply are not checked for standards compliance.
+<li>The message parameter should contain only printable characters,
+other characters may lead to undefined behavior.
+For example, CR or LF will cause the call to fail,
+single '%' characters will cause the text to be ignored
+(if there really should be a '%' in the string,
+use '%%' just like for <tt>printf(3)</tt>).
<li>For details about reply codes and their meanings, please see RFC's
<a href="http://www.rfc-editor.org/rfc/rfc821.txt">821</a>/
<a href="http://www.rfc-editor.org/rfc/rfc2821.txt">2821</a>
diff --git a/contrib/sendmail/libmilter/docs/xxfi_connect.html b/contrib/sendmail/libmilter/docs/xxfi_connect.html
index af58bf9..85d02e4 100644
--- a/contrib/sendmail/libmilter/docs/xxfi_connect.html
+++ b/contrib/sendmail/libmilter/docs/xxfi_connect.html
@@ -62,11 +62,29 @@ is passed to smfi_register().
<td><table border="1" cellspacing=0>
<tr bgcolor="#dddddd"><th>Return value</th><th>Description</th></tr>
<tr valign="top">
- <td>SMFIS_DISCARD</td>
- <td>Not meaningful, as
- this is only meaningful from message-oriented routines.
+ <td>SMFIS_ACCEPT</td>
+ <td>Accept all commands and messages from this client without any
+ further contact with the filter. </td>
</td>
</tr>
+ <tr valign="top">
+ <td>SMFIS_CONTINUE</td>
+ <td>Continue normal processing. </td>
+ </tr>
+ <tr valign="top">
+ <td>SMFIS_DISCARD</td>
+ <td>Undefined behaviour; do not use. </td>
+ </tr>
+ <tr valign="top">
+ <td>SMFIS_TEMPFAIL</td>
+ <td>Reject all commands and messages from this client with a
+ temporary failure reply code. </td>
+ </tr>
+ <tr valign="top">
+ <td>SMFIS_REJECT</td>
+ <td>Reject all commands and messages from this client with a
+ permanent failure reply code. </td>
+ </tr>
</table>
</tr>
-->
diff --git a/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html b/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html
index 9d32e90..a96ac95 100644
--- a/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html
+++ b/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html
@@ -52,12 +52,12 @@ Handle the envelope RCPT command.
<tr valign="top">
<td>SMFIS_TEMPFAIL</td>
<td>Temporarily fail for this particular recipient; further recipients
- maystill be sent. <a href="xxfi_abort.html">xxfi_abort</a> is not called.
+ may still be sent. <a href="xxfi_abort.html">xxfi_abort</a> is not called.
</td>
</tr>
<tr valign="top">
<td>SMFIS_REJECT</td>
- <td>Reject this particular recipient; further recipients maystill be sent.
+ <td>Reject this particular recipient; further recipients may still be sent.
<a href="xxfi_abort.html">xxfi_abort</a> is not called.
</td>
</tr>
diff --git a/contrib/sendmail/libmilter/engine.c b/contrib/sendmail/libmilter/engine.c
index 623b2c2..6bd225c 100644
--- a/contrib/sendmail/libmilter/engine.c
+++ b/contrib/sendmail/libmilter/engine.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: engine.c,v 8.109.2.5 2003/08/04 18:14:33 ca Exp $")
+SM_RCSID("@(#)$Id: engine.c,v 8.109.2.8 2003/12/01 23:57:45 msk Exp $")
#include "libmilter.h"
@@ -59,14 +59,21 @@ typedef struct cmdfct_t cmdfct;
#define CT_END 0x0008 /* start replying */
/* index in macro array: macros only for these commands */
-#define CI_NONE (-1)
-#define CI_CONN 0
-#define CI_HELO 1
-#define CI_MAIL 2
-#define CI_RCPT 3
-#if CI_RCPT >= MAX_MACROS_ENTRIES
+#define CI_NONE (-1)
+#define CI_CONN 0
+#define CI_HELO 1
+#define CI_MAIL 2
+#define CI_RCPT 3
+#if _FFR_MILTER_MACROS_EOM
+# define CI_EOM 4
+# if CI_EOM >= MAX_MACROS_ENTRIES
+ERROR: do not compile with CI_EOM >= MAX_MACROS_ENTRIES
+# endif
+#else /* _FFR_MILTER_MACROS_EOM */
+# if CI_RCPT >= MAX_MACROS_ENTRIES
ERROR: do not compile with CI_RCPT >= MAX_MACROS_ENTRIES
-#endif
+# endif
+#endif /* _FFR_MILTER_MACROS_EOM */
/* function prototypes */
static int st_abortfct __P((genarg *));
@@ -156,7 +163,11 @@ static cmdfct cmds[] =
{SMFIC_MACRO, CM_ARGV, ST_NONE, CT_KEEP, CI_NONE, st_macros },
{SMFIC_BODY, CM_ARG1, ST_BODY, CT_CONT, CI_NONE, st_bodychunk },
{SMFIC_CONNECT, CM_ARG2, ST_CONN, CT_CONT, CI_CONN, st_connectinfo },
+#if _FFR_MILTER_MACROS_EOM
+{SMFIC_BODYEOB, CM_ARG1, ST_ENDM, CT_CONT, CI_EOM, st_bodyend },
+#else /* _FFR_MILTER_MACROS_EOM */
{SMFIC_BODYEOB, CM_ARG1, ST_ENDM, CT_CONT, CI_NONE, st_bodyend },
+#endif /* _FFR_MILTER_MACROS_EOM */
{SMFIC_HELO, CM_ARG1, ST_HELO, CT_CONT, CI_HELO, st_helo },
{SMFIC_HEADER, CM_ARG2, ST_HDRS, CT_CONT, CI_NONE, st_header },
{SMFIC_MAIL, CM_ARGV, ST_MAIL, CT_CONT, CI_MAIL, st_sender },
@@ -599,7 +610,7 @@ st_connectinfo(g)
l = g->a_len;
while (s[i] != '\0' && i <= l)
++i;
- if (i >= l)
+ if (i + 1 >= l)
return _SMFIS_ABORT;
/* Move past trailing \0 in host string */
@@ -608,9 +619,7 @@ st_connectinfo(g)
(void) memset(&sockaddr, '\0', sizeof sockaddr);
if (family != SMFIA_UNKNOWN)
{
- (void) memcpy((void *) &port, (void *) (s + i),
- sizeof port);
- if ((i += sizeof port) >= l)
+ if (i + sizeof port >= l)
{
smi_log(SMI_LOG_ERR,
"%s: connect[%d]: wrong len %d >= %d",
@@ -618,6 +627,9 @@ st_connectinfo(g)
(int) g->a_ctx->ctx_id, (int) i, (int) l);
return _SMFIS_ABORT;
}
+ (void) memcpy((void *) &port, (void *) (s + i),
+ sizeof port);
+ i += sizeof port;
/* make sure string is terminated */
if (s[l - 1] != '\0')
@@ -729,7 +741,12 @@ st_helo(g)
mi_clr_macros(g->a_ctx, g->a_idx + 1);
if (g->a_ctx->ctx_smfi != NULL &&
(fi_helo = g->a_ctx->ctx_smfi->xxfi_helo) != NULL)
+ {
+ /* paranoia: check for terminating '\0' */
+ if (g->a_len == 0 || g->a_buf[g->a_len - 1] != '\0')
+ return MI_FAILURE;
return (*fi_helo)(g->a_ctx, g->a_buf);
+ }
return SMFIS_CONTINUE;
}
/*
@@ -847,6 +864,11 @@ st_macros(g)
case SMFIC_RCPT:
i = CI_RCPT;
break;
+#if _FFR_MILTER_MACROS_EOM
+ case SMFIC_BODYEOB:
+ i = CI_EOM;
+ break;
+#endif /* _FFR_MILTER_MACROS_EOM */
default:
free(argv);
return _SMFIS_FAIL;
@@ -1089,10 +1111,16 @@ dec_argv(buf, len)
for (i = 0, elem = 0; i < len && elem < nelem; i++)
{
if (buf[i] == '\0')
- s[++elem] = &(buf[i + 1]);
+ {
+ ++elem;
+ if (i + 1 >= len)
+ s[elem] = NULL;
+ else
+ s[elem] = &(buf[i + 1]);
+ }
}
- /* overwrite last entry */
+ /* overwrite last entry (already done above, just paranoia) */
s[elem] = NULL;
return s;
}
@@ -1117,6 +1145,9 @@ dec_arg2(buf, len, s1, s2)
{
size_t i;
+ /* paranoia: check for terminating '\0' */
+ if (len == 0 || buf[len - 1] != '\0')
+ return MI_FAILURE;
*s1 = buf;
for (i = 1; i < len && buf[i] != '\0'; i++)
continue;
diff --git a/contrib/sendmail/libmilter/libmilter.h b/contrib/sendmail/libmilter/libmilter.h
index 7b2fbb8..13bddce 100644
--- a/contrib/sendmail/libmilter/libmilter.h
+++ b/contrib/sendmail/libmilter/libmilter.h
@@ -19,7 +19,7 @@
#ifdef _DEFINE
# define EXTERN
# define INIT(x) = x
-SM_IDSTR(MilterlId, "@(#)$Id: libmilter.h,v 8.33.2.12 2003/09/08 21:39:55 yuri Exp $")
+SM_IDSTR(MilterlId, "@(#)$Id: libmilter.h,v 8.33.2.13 2003/10/20 21:51:50 msk Exp $")
#else /* _DEFINE */
# define EXTERN extern
# define INIT(x)
@@ -176,7 +176,7 @@ extern void mi_clean_signals __P((void));
extern struct hostent *mi_gethostbyname __P((char *, int));
extern int mi_inet_pton __P((int, const char *, void *));
extern void mi_closener __P((void));
-extern int mi_opensocket __P((char *, int, int, smfiDesc_ptr));
+extern int mi_opensocket __P((char *, int, int, bool, smfiDesc_ptr));
/* communication functions */
extern char *mi_rd_cmd __P((socket_t, struct timeval *, char *, size_t *, char *));
diff --git a/contrib/sendmail/libmilter/listener.c b/contrib/sendmail/libmilter/listener.c
index 5eb5f32..bb7a297 100644
--- a/contrib/sendmail/libmilter/listener.c
+++ b/contrib/sendmail/libmilter/listener.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: listener.c,v 8.85.2.12 2003/08/04 18:47:29 ca Exp $")
+SM_RCSID("@(#)$Id: listener.c,v 8.85.2.17 2003/10/21 17:22:57 ca Exp $")
/*
** listener.c -- threaded network listener
@@ -18,6 +18,9 @@ SM_RCSID("@(#)$Id: listener.c,v 8.85.2.12 2003/08/04 18:47:29 ca Exp $")
#include "libmilter.h"
#include <sm/errstring.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
# if NETINET || NETINET6
# include <arpa/inet.h>
@@ -28,26 +31,29 @@ static int L_family;
static SOCKADDR_LEN_T L_socksize;
static socket_t listenfd = INVALID_SOCKET;
-static socket_t mi_milteropen __P((char *, int, char *));
+static socket_t mi_milteropen __P((char *, int, bool, char *));
/*
** MI_OPENSOCKET -- create the socket where this filter and the MTA will meet
**
-** Parameters:
+** Parameters:
** conn -- connection description
** backlog -- listen backlog
-** dbg -- debug level
+** dbg -- debug level
+** rmsocket -- if true, try to unlink() the socket first
+** (UNIX domain sockets only)
** smfi -- filter structure to use
**
-** Return value:
-** MI_SUCCESS/MI_FAILURE
+** Return value:
+** MI_SUCCESS/MI_FAILURE
*/
int
-mi_opensocket(conn, backlog, dbg, smfi)
+mi_opensocket(conn, backlog, dbg, rmsocket, smfi)
char *conn;
int backlog;
int dbg;
+ bool rmsocket;
smfiDesc_ptr smfi;
{
if (smfi == NULL || conn == NULL)
@@ -64,7 +70,7 @@ mi_opensocket(conn, backlog, dbg, smfi)
}
(void) smutex_init(&L_Mutex);
(void) smutex_lock(&L_Mutex);
- listenfd = mi_milteropen(conn, backlog, smfi->xxfi_name);
+ listenfd = mi_milteropen(conn, backlog, rmsocket, smfi->xxfi_name);
if (!ValidSocket(listenfd))
{
smi_log(SMI_LOG_FATAL,
@@ -91,6 +97,8 @@ mi_opensocket(conn, backlog, dbg, smfi)
** Parameters:
** conn -- connection description
** backlog -- listen backlog
+** rmsocket -- if true, try to unlink() the socket first
+** (UNIX domain sockets only)
** name -- name for logging
**
** Returns:
@@ -105,9 +113,10 @@ static char *sockpath = NULL;
#endif /* NETUNIX */
static socket_t
-mi_milteropen(conn, backlog, name)
+mi_milteropen(conn, backlog, rmsocket, name)
char *conn;
int backlog;
+ bool rmsocket;
char *name;
{
socket_t sock;
@@ -457,6 +466,41 @@ mi_milteropen(conn, backlog, name)
return INVALID_SOCKET;
}
+#if NETUNIX
+ if (addr.sa.sa_family == AF_UNIX && rmsocket)
+ {
+ struct stat s;
+
+ if (stat(colon, &s) != 0)
+ {
+ if (errno != ENOENT)
+ {
+ smi_log(SMI_LOG_ERR,
+ "%s: Unable to stat() %s: %s",
+ name, colon, sm_errstring(errno));
+ (void) closesocket(sock);
+ return INVALID_SOCKET;
+ }
+ }
+ else if (!S_ISSOCK(s.st_mode))
+ {
+ smi_log(SMI_LOG_ERR,
+ "%s: %s is not a UNIX domain socket",
+ name, colon);
+ (void) closesocket(sock);
+ return INVALID_SOCKET;
+ }
+ else if (unlink(colon) != 0)
+ {
+ smi_log(SMI_LOG_ERR,
+ "%s: Unable to remove %s: %s",
+ name, colon, sm_errstring(errno));
+ (void) closesocket(sock);
+ return INVALID_SOCKET;
+ }
+ }
+#endif /* NETUNIX */
+
if (bind(sock, &addr.sa, L_socksize) < 0)
{
smi_log(SMI_LOG_ERR,
@@ -591,9 +635,11 @@ mi_closener()
** Parameters:
** conn -- connection description
** dbg -- debug level
+** rmsocket -- if true, try to unlink() the socket first
+** (UNIX domain sockets only)
** smfi -- filter structure to use
** timeout -- timeout for reads/writes
-** backlog -- listen queue backlog size
+** backlog -- listen queue backlog size
**
** Returns:
** MI_SUCCESS -- Exited normally
@@ -673,7 +719,7 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
FD_RD_VAR(rds, excs);
struct timeval chktime;
- if (mi_opensocket(conn, backlog, dbg, smfi) == MI_FAILURE)
+ if (mi_opensocket(conn, backlog, dbg, false, smfi) == MI_FAILURE)
return MI_FAILURE;
clilen = L_socksize;
diff --git a/contrib/sendmail/libmilter/main.c b/contrib/sendmail/libmilter/main.c
index 4e62c45..36b99f0 100644
--- a/contrib/sendmail/libmilter/main.c
+++ b/contrib/sendmail/libmilter/main.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: main.c,v 8.64.2.10 2003/01/23 22:34:24 ca Exp $")
+SM_RCSID("@(#)$Id: main.c,v 8.64.2.13 2003/10/20 22:27:13 ca Exp $")
#define _DEFINE 1
#include "libmilter.h"
@@ -86,7 +86,7 @@ smfi_stop()
}
/*
-** default values for some variables.
+** Default values for some variables.
** Most of these can be changed with the functions below.
*/
@@ -101,19 +101,22 @@ static int backlog = MI_SOMAXCONN;
** able to start up
**
** Parameters:
-** None.
+** rmsocket -- if true, instructs libmilter to attempt
+** to remove the socket before creating it;
+** only applies for "local:" or "unix:" sockets
**
** Return:
** MI_SUCCESS/MI_FAILURE
*/
int
-smfi_opensocket()
+smfi_opensocket(rmsocket)
+ bool rmsocket;
{
if (smfi == NULL || conn == NULL)
return MI_FAILURE;
- return mi_opensocket(conn, backlog, dbg, smfi);
+ return mi_opensocket(conn, backlog, dbg, rmsocket, smfi);
}
#endif /* _FFR_SMFI_OPENSOCKET */
diff --git a/contrib/sendmail/libmilter/signal.c b/contrib/sendmail/libmilter/signal.c
index e167959..94e7f15 100644
--- a/contrib/sendmail/libmilter/signal.c
+++ b/contrib/sendmail/libmilter/signal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: signal.c,v 8.37.2.3 2003/08/04 18:14:33 ca Exp $")
+SM_RCSID("@(#)$Id: signal.c,v 8.37.2.4 2003/11/19 00:22:40 ca Exp $")
#include "libmilter.h"
diff --git a/contrib/sendmail/libsm/assert.c b/contrib/sendmail/libsm/assert.c
index efad1ec..7ba5c1a 100644
--- a/contrib/sendmail/libsm/assert.c
+++ b/contrib/sendmail/libsm/assert.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: assert.c,v 1.25 2001/09/11 04:04:47 gshapiro Exp $")
+SM_RCSID("@(#)$Id: assert.c,v 1.25.2.1 2003/12/05 22:44:17 ca Exp $")
/*
** Abnormal program termination and assertion checking.
@@ -127,7 +127,7 @@ sm_abort_sethandler(f)
** doesn't.
*/
-void
+void SM_DEAD_D
#if SM_VA_STD
sm_abort(char *fmt, ...)
#else /* SM_VA_STD */
@@ -163,7 +163,7 @@ sm_abort(fmt, va_alist)
** doesn't.
*/
-void
+void SM_DEAD_D
sm_abort_at(filename, lineno, msg)
const char *filename;
int lineno;
diff --git a/contrib/sendmail/libsm/exc.c b/contrib/sendmail/libsm/exc.c
index 9cc1c6f..e2360c6 100644
--- a/contrib/sendmail/libsm/exc.c
+++ b/contrib/sendmail/libsm/exc.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: exc.c,v 1.47 2002/01/09 18:51:43 ca Exp $")
+SM_RCSID("@(#)$Id: exc.c,v 1.47.2.1 2003/12/05 22:44:17 ca Exp $")
/*
** exception handling
@@ -587,7 +587,7 @@ sm_exc_newthread(h)
** doesn't.
*/
-void
+void SM_DEAD_D
sm_exc_raise_x(exc)
SM_EXC_T *exc;
{
@@ -648,7 +648,7 @@ sm_exc_raise_x(exc)
** none.
*/
-void
+void SM_DEAD_D
#if SM_VA_STD
sm_exc_raisenew_x(
const SM_EXC_TYPE_T *etype,
diff --git a/contrib/sendmail/libsm/ldap.c b/contrib/sendmail/libsm/ldap.c
index b022b39..0e1c718 100644
--- a/contrib/sendmail/libsm/ldap.c
+++ b/contrib/sendmail/libsm/ldap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: ldap.c,v 1.44.2.3 2003/07/07 20:16:16 gshapiro Exp $")
+SM_RCSID("@(#)$Id: ldap.c,v 1.44.2.5 2003/12/23 21:21:56 gshapiro Exp $")
#if LDAPMAP
# include <sys/types.h>
@@ -570,9 +570,11 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result,
** no need to spin through attributes
*/
- if (statp == EX_OK &&
- bitset(SM_LDAP_MATCHONLY, flags))
+ if (bitset(SM_LDAP_MATCHONLY, flags))
+ {
+ statp = EX_OK;
continue;
+ }
/* record completed DN's to prevent loops */
dn = ldap_get_dn(lmap->ldap_ld, entry);
diff --git a/contrib/sendmail/libsm/local.h b/contrib/sendmail/libsm/local.h
index 95b5ffe..610663d 100644
--- a/contrib/sendmail/libsm/local.h
+++ b/contrib/sendmail/libsm/local.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2000-2002, 2004 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -11,7 +11,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Id: local.h,v 1.51.2.1 2002/09/09 21:38:08 gshapiro Exp $
+ * $Id: local.h,v 1.51.2.2 2004/01/09 18:32:44 ca Exp $
*/
/*
@@ -37,7 +37,6 @@ int sm_wsetup __P((SM_FILE_T *));
int sm_flags __P((int));
SM_FILE_T *sm_fp __P((const SM_FILE_T *, const int, SM_FILE_T *));
int sm_vprintf __P((int, char const *, va_list));
-int sm_vfscanf __P((SM_FILE_T *, int, char const *, va_list));
/* std io functions */
ssize_t sm_stdread __P((SM_FILE_T *, char *, size_t));
diff --git a/contrib/sendmail/smrsh/smrsh.8 b/contrib/sendmail/smrsh/smrsh.8
index 3b07664..b15a16c 100644
--- a/contrib/sendmail/smrsh/smrsh.8
+++ b/contrib/sendmail/smrsh/smrsh.8
@@ -9,9 +9,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: smrsh.8,v 8.16.2.1 2003/07/08 01:33:03 gshapiro Exp $
+.\" $Id: smrsh.8,v 8.16.2.2 2003/10/07 18:05:37 ca Exp $
.\"
-.TH SMRSH 8 "$Date: 2003/07/08 01:33:03 $"
+.TH SMRSH 8 "$Date: 2003/10/07 18:05:37 $"
.SH NAME
smrsh \- restricted shell for sendmail
.SH SYNOPSIS
@@ -88,6 +88,11 @@ and/or \-DSMRSH_CMDDIR=\e"\fIdir\fP\e"
to change the default program directory
(defaults to ``/usr/adm/sm.bin'').
.SH FILES
-/usr/adm/sm.bin \- directory for restricted programs
+/usr/adm/sm.bin \- default directory for restricted programs on most OSs
+.PP
+/var/adm/sm.bin \- directory for restricted programs on HP UX and Solaris
+.PP
+/usr/libexec/sm.bin \- directory for restricted programs on FreeBSD (>= 3.3)
+
.SH SEE ALSO
sendmail(8)
diff --git a/contrib/sendmail/smrsh/smrsh.c b/contrib/sendmail/smrsh/smrsh.c
index 9a9bc21..bfcfcbe 100644
--- a/contrib/sendmail/smrsh/smrsh.c
+++ b/contrib/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, "@(#)$Id: smrsh.c,v 8.58.2.2 2002/09/24 21:40:05 ca Exp $")
+SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.58.2.5 2003/12/15 17:09:39 ca Exp $")
/*
** SMRSH -- sendmail restricted shell
@@ -118,8 +118,9 @@ addcmd(s, cmd, len)
if (s == NULL || *s == '\0')
return;
+ /* enough space for s (len) and CMDDIR + "/" and '\0'? */
if (sizeof newcmdbuf - strlen(newcmdbuf) <=
- len + (cmd ? (strlen(CMDDIR) + 1) : 0))
+ len + 1 + (cmd ? (strlen(CMDDIR) + 1) : 0))
{
(void)sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
"%s: command too long: %s\n", prg, par);
@@ -130,7 +131,7 @@ addcmd(s, cmd, len)
}
if (cmd)
(void) sm_strlcat2(newcmdbuf, CMDDIR, "/", sizeof newcmdbuf);
- (void) sm_strlcat(newcmdbuf, s, sizeof newcmdbuf);
+ (void) strncat(newcmdbuf, s, len);
}
int
@@ -423,7 +424,8 @@ main(argc, argv)
#ifdef DEBUG
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "%s\n", newcmdbuf);
#endif /* DEBUG */
- (void) execle("/bin/sh", "/bin/sh", "-c", newcmdbuf, NULL, newenv);
+ (void) execle("/bin/sh", "/bin/sh", "-c", newcmdbuf,
+ (char *)NULL, newenv);
save_errno = errno;
#ifndef DEBUG
syslog(LOG_CRIT, "Cannot exec /bin/sh: %s", sm_errstring(errno));
diff --git a/contrib/sendmail/src/README b/contrib/sendmail/src/README
index 669a20c..e0af96b 100644
--- a/contrib/sendmail/src/README
+++ b/contrib/sendmail/src/README
@@ -9,7 +9,7 @@
# the sendmail distribution.
#
#
-# $Id: README,v 8.355.2.15 2003/06/02 01:43:04 ca Exp $
+# $Id: README,v 8.355.2.16 2004/01/08 21:54:55 ca Exp $
#
This directory contains the source files for sendmail(TM).
@@ -561,6 +561,11 @@ MATCHGECOS Permit fuzzy matching of user names against the full
MIME8TO7 If non-zero, include 8 to 7 bit MIME conversions. This
also controls advertisement of 8BITMIME in the ESMTP
startup dialogue.
+MIME7TO8_OLD If 0 then use an algorithm for MIME 7-bit quoted-printable
+ or base64 encoding to 8-bit text that has been introduced
+ in 8.12.3. There are some examples where that code fails,
+ but the old code works. If you have an example of improper
+ 7 to 8 bit conversion please send it to sendmail-bugs.
MIME7TO8 If non-zero, include 7 to 8 bit MIME conversions.
HES_GETMAILHOST Define this to 1 if you are using Hesiod with the
hes_getmailhost() routine. This is included with the MIT
@@ -1797,4 +1802,4 @@ util.c Some general purpose routines used by sendmail.
version.c The version number and information about this
version of sendmail.
-(Version $Revision: 8.355.2.15 $, last update $Date: 2003/06/02 01:43:04 $ )
+(Version $Revision: 8.355.2.16 $, last update $Date: 2004/01/08 21:54:55 $ )
diff --git a/contrib/sendmail/src/alias.c b/contrib/sendmail/src/alias.c
index 3ce8b0e..c944388 100644
--- a/contrib/sendmail/src/alias.c
+++ b/contrib/sendmail/src/alias.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: alias.c,v 8.214.2.1 2003/07/28 17:47:55 ca Exp $")
+SM_RCSID("@(#)$Id: alias.c,v 8.214.2.2 2003/10/06 20:43:29 ca Exp $")
#define SEPARATOR ':'
# define ALIAS_SPEC_SEPARATORS " ,/:"
diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c
index b164d29..56a8404 100644
--- a/contrib/sendmail/src/conf.c
+++ b/contrib/sendmail/src/conf.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: conf.c,v 8.972.2.50 2003/09/03 21:37:03 ca Exp $")
+SM_RCSID("@(#)$Id: conf.c,v 8.972.2.54 2004/01/08 21:54:55 ca Exp $")
#include <sendmail/pathnames.h>
#if NEWDB
@@ -5571,6 +5571,9 @@ char *CompileOptions[] =
#if MIME7TO8
"MIME7TO8",
#endif /* MIME7TO8 */
+#if MIME7TO8_OLD
+ "MIME7TO8_OLD",
+#endif /* MIME7TO8_OLD */
#if MIME8TO7
"MIME8TO7",
#endif /* MIME8TO7 */
@@ -6065,11 +6068,19 @@ char *FFRCompileOptions[] =
/* Limit sleep(2) time in libsm/clock.c */
"_FFR_MAX_SLEEP_TIME",
#endif /* _FFR_MAX_SLEEP_TIME */
+#if _FFR_MESSAGEID_MACRO
+ /* stick the message ID header's value in a macro */
+ "_FFR_MESSAGEID_MACRO",
+#endif /* _FFR_MESSAGEID_MACRO */
#if MILTER
# if _FFR_MILTER_421
/* If a filter returns 421, close the SMTP connection */
"_FFR_MILTER_421",
# endif /* _FFR_MILTER_421 */
+# if _FFR_MILTER_MACROS_EOM
+ /* Add an EOM macro set for milter */
+ "_FFR_MILTER_MACROS_EOM",
+# endif /* _FFR_MILTER_MACROS_EOM */
# if _FFR_MILTER_PERDAEMON
/* Per DaemonPortOptions InputMailFilter lists */
"_FFR_MILTER_PERDAEMON",
diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c
index 267f363..88c55cd 100644
--- a/contrib/sendmail/src/daemon.c
+++ b/contrib/sendmail/src/daemon.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: daemon.c,v 8.613.2.17 2003/07/30 20:17:04 ca Exp $")
+SM_RCSID("@(#)$Id: daemon.c,v 8.613.2.20 2003/11/25 19:02:24 ca Exp $")
#if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__)
# define USE_SOCK_STREAM 1
@@ -164,6 +164,8 @@ getrequests(e)
extern bool refuseconnections __P((char *, ENVELOPE *, int, bool));
+ /* initialize data for function that generates queue ids */
+ init_qid_alg();
for (idx = 0; idx < NDaemons; idx++)
{
Daemons[idx].d_port = setupdaemon(&(Daemons[idx].d_addr));
@@ -363,7 +365,6 @@ getrequests(e)
/* Did someone signal while waiting? */
CHECK_RESTART;
-
curdaemon = -1;
if (doqueuerun())
{
@@ -3484,10 +3485,21 @@ getauthinfo(fd, may_be_forged)
nleft = sizeof ibuf - 1;
while ((i = read(s, p, nleft)) > 0)
{
+ char *s;
+
p += i;
nleft -= i;
*p = '\0';
- if (strchr(ibuf, '\n') != NULL || nleft <= 0)
+ if ((s = strchr(ibuf, '\n')) != NULL)
+ {
+ if (p > s + 1)
+ {
+ p = s + 1;
+ *p = '\0';
+ }
+ break;
+ }
+ if (nleft <= 0)
break;
}
(void) close(s);
diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c
index 95149a0..eb98f83 100644
--- a/contrib/sendmail/src/deliver.c
+++ b/contrib/sendmail/src/deliver.c
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <sys/time.h>
-SM_RCSID("@(#)$Id: deliver.c,v 8.940.2.19 2003/09/03 19:58:26 ca Exp $")
+SM_RCSID("@(#)$Id: deliver.c,v 8.940.2.20 2003/09/26 18:26:19 ca Exp $")
#if HASSETUSERCONTEXT
# include <login_cap.h>
@@ -3491,7 +3491,12 @@ do_transfer:
(mci->mci_state == MCIS_MAIL ||
mci->mci_state == MCIS_RCPT ||
mci->mci_state == MCIS_DATA))
+ {
mci->mci_state = MCIS_OPEN;
+ SmtpPhase = mci->mci_phase = "idle";
+ sm_setproctitle(true, e, "%s: %s", CurHostName,
+ mci->mci_phase);
+ }
}
if (tobuf[0] != '\0')
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c
index dd871ea..8012b51 100644
--- a/contrib/sendmail/src/headers.c
+++ b/contrib/sendmail/src/headers.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: headers.c,v 8.266.4.7 2003/09/03 21:32:20 ca Exp $")
+SM_RCSID("@(#)$Id: headers.c,v 8.266.4.9 2003/10/30 00:17:22 gshapiro Exp $")
static size_t fix_mime_header __P((HDR *, ENVELOPE *));
static int priencode __P((char *));
@@ -730,6 +730,10 @@ eatheader(e, full, log)
e->e_msgid = h->h_value;
while (isascii(*e->e_msgid) && isspace(*e->e_msgid))
e->e_msgid++;
+#if _FFR_MESSAGEID_MACRO
+ macdefine(&e->e_macro, A_PERM, macid("{msg_id}"),
+ e->e_msgid);
+#endif /* _FFR_MESSAGEID_MACRO */
}
}
if (tTd(32, 1))
@@ -773,11 +777,13 @@ eatheader(e, full, log)
e->e_timeoutclass = TOC_NORMAL;
else if (sm_strcasecmp(p, "non-urgent") == 0)
e->e_timeoutclass = TOC_NONURGENT;
+#if _FFR_QUEUERETURN_DSN
+ else if (bitset(EF_RESPONSE, e->e_flags))
+ e->e_timeoutclass = TOC_DSN;
+#endif /* _FFR_QUEUERETURN_DSN */
}
-
#if _FFR_QUEUERETURN_DSN
- /* If no timeoutclass picked and it's a DSN, use that timeoutclass */
- if (e->e_timeoutclass == TOC_NORMAL && bitset(EF_RESPONSE, e->e_flags))
+ else if (bitset(EF_RESPONSE, e->e_flags))
e->e_timeoutclass = TOC_DSN;
#endif /* _FFR_QUEUERETURN_DSN */
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c
index a56315c..0d8c0ce 100644
--- a/contrib/sendmail/src/main.c
+++ b/contrib/sendmail/src/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("@(#)$Id: main.c,v 8.887.2.27 2003/08/04 17:23:37 ca Exp $")
+SM_RCSID("@(#)$Id: main.c,v 8.887.2.29 2003/11/07 00:09:31 ca Exp $")
#if NETINET || NETINET6
@@ -2234,8 +2234,32 @@ main(argc, argv, envp)
int status;
pid_t ret;
+ errno = 0;
while ((ret = sm_wait(&status)) <= 0)
+ {
+ if (errno == ECHILD)
+ {
+ /*
+ ** Oops... something got messed
+ ** up really bad. Waiting for
+ ** non-existent children
+ ** shouldn't happen. Let's get
+ ** out of here.
+ */
+
+ CurChildren = 0;
+ break;
+ }
continue;
+ }
+
+ /* something is really really wrong */
+ if (errno == ECHILD)
+ {
+ sm_syslog(LOG_ERR, NOQID,
+ "queue control process: lost all children: wait returned ECHILD");
+ break;
+ }
/* Only drop when a child gives status */
if (WIFSTOPPED(status))
@@ -2371,8 +2395,31 @@ main(argc, argv, envp)
int group;
CHECK_RESTART;
+ errno = 0;
while ((ret = sm_wait(&status)) <= 0)
+ {
+ /*
+ ** Waiting for non-existent
+ ** children shouldn't happen.
+ ** Let's get out of here if
+ ** it occurs.
+ */
+
+ if (errno == ECHILD)
+ {
+ CurChildren = 0;
+ break;
+ }
continue;
+ }
+
+ /* something is really really wrong */
+ if (errno == ECHILD)
+ {
+ sm_syslog(LOG_ERR, NOQID,
+ "persistent queue runner control process: lost all children: wait returned ECHILD");
+ break;
+ }
if (WIFSTOPPED(status))
continue;
diff --git a/contrib/sendmail/src/milter.c b/contrib/sendmail/src/milter.c
index c91ad12..c25101c 100644
--- a/contrib/sendmail/src/milter.c
+++ b/contrib/sendmail/src/milter.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: milter.c,v 8.197.2.9 2003/09/07 00:18:29 ca Exp $")
+SM_RCSID("@(#)$Id: milter.c,v 8.197.2.10 2003/12/01 23:57:44 msk Exp $")
#if MILTER
# include <libmilter/mfapi.h>
@@ -34,6 +34,9 @@ static char *MilterConnectMacros[MAXFILTERMACROS + 1];
static char *MilterHeloMacros[MAXFILTERMACROS + 1];
static char *MilterEnvFromMacros[MAXFILTERMACROS + 1];
static char *MilterEnvRcptMacros[MAXFILTERMACROS + 1];
+#if _FFR_MILTER_MACROS_EOM
+static char *MilterEOMMacros[MAXFILTERMACROS + 1];
+#endif /* _FFR_MILTER_MACROS_EOM */
# define MILTER_CHECK_DONE_MSG() \
if (*state == SMFIR_REPLYCODE || \
@@ -1415,6 +1418,10 @@ static struct milteropt
{ "macros.envrcpt", MO_MACROS_ENVRCPT },
# define MO_LOGLEVEL 0x05
{ "loglevel", MO_LOGLEVEL },
+#if _FFR_MILTER_MACROS_EOM
+# define MO_MACROS_EOM 0x06
+ { "macros.eom", MO_MACROS_EOM },
+#endif /* _FFR_MILTER_MACROS_EOM */
{ NULL, 0 },
};
@@ -1488,6 +1495,13 @@ milter_set_option(name, val, sticky)
case MO_MACROS_ENVRCPT:
if (macros == NULL)
macros = MilterEnvRcptMacros;
+#if _FFR_MILTER_MACROS_EOM
+ /* FALLTHROUGH */
+
+ case MO_MACROS_EOM:
+ if (macros == NULL)
+ macros = MilterEOMMacros;
+#endif /* _FFR_MILTER_MACROS_EOM */
p = newstr(val);
while (*p != '\0')
@@ -3594,6 +3608,11 @@ milter_data(e, state)
MILTER_CHECK_RESULTS();
}
+#if _FFR_MILTER_MACROS_EOM
+ if (MilterEOMMacros[0] != NULL)
+ milter_send_macros(m, MilterEOMMacros, SMFIC_BODYEOB, e);
+#endif /* _FFR_MILTER_MACROS_EOM */
+
/* send the final body chunk */
(void) milter_write(m, SMFIC_BODYEOB, NULL, 0,
m->mf_timeout[SMFTO_WRITE], e);
diff --git a/contrib/sendmail/src/mime.c b/contrib/sendmail/src/mime.c
index 62d1617..a9a26c4 100644
--- a/contrib/sendmail/src/mime.c
+++ b/contrib/sendmail/src/mime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1994, 1996-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1994
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <string.h>
-SM_RCSID("@(#)$Id: mime.c,v 8.130.2.1 2003/04/15 01:05:59 ca Exp $")
+SM_RCSID("@(#)$Id: mime.c,v 8.130.2.3 2004/01/08 21:42:56 ca Exp $")
/*
** MIME support.
@@ -33,6 +33,11 @@ SM_RCSID("@(#)$Id: mime.c,v 8.130.2.1 2003/04/15 01:05:59 ca Exp $")
** the problem.
*/
+/* use "old" mime 7 to 8 algorithm by default */
+#ifndef MIME7TO8_OLD
+# define MIME7TO8_OLD 1
+#endif /* ! MIME7TO8_OLD */
+
#if MIME8TO7
static int isboundary __P((char *, char **));
static int mimeboundary __P((char *, char **));
@@ -1064,54 +1069,41 @@ mime7to8(mci, header, e)
c1 = CHAR64(c1);
c2 = CHAR64(c2);
+#if MIME7TO8_OLD
+#define CHK_EOL if (*--fbufp != '\n' || (fbufp > fbuf && *--fbufp != '\r')) \
+ ++fbufp;
+#else /* MIME7TO8_OLD */
+#define CHK_EOL if (*--fbufp != '\n' || (fbufp > fbuf && *--fbufp != '\r')) \
+ { \
+ ++fbufp; \
+ pxflags |= PXLF_NOADDEOL; \
+ }
+#endif /* MIME7TO8_OLD */
+
+#define PUTLINE64 \
+ do \
+ { \
+ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) \
+ { \
+ CHK_EOL; \
+ putxline((char *) fbuf, fbufp - fbuf, mci, pxflags); \
+ pxflags &= ~PXLF_NOADDEOL; \
+ fbufp = fbuf; \
+ } \
+ } while (0)
+
*fbufp = (c1 << 2) | ((c2 & 0x30) >> 4);
- if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE])
- {
- if (*--fbufp != '\n' ||
- (fbufp > fbuf && *--fbufp != '\r'))
- {
- pxflags |= PXLF_NOADDEOL;
- fbufp++;
- }
- putxline((char *) fbuf, fbufp - fbuf,
- mci, pxflags);
- pxflags &= ~PXLF_NOADDEOL;
- fbufp = fbuf;
- }
+ PUTLINE64;
if (c3 == '=')
continue;
c3 = CHAR64(c3);
*fbufp = ((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2);
- if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE])
- {
- if (*--fbufp != '\n' ||
- (fbufp > fbuf && *--fbufp != '\r'))
- {
- pxflags |= PXLF_NOADDEOL;
- fbufp++;
- }
- putxline((char *) fbuf, fbufp - fbuf,
- mci, pxflags);
- pxflags &= ~PXLF_NOADDEOL;
- fbufp = fbuf;
- }
+ PUTLINE64;
if (c4 == '=')
continue;
c4 = CHAR64(c4);
*fbufp = ((c3 & 0x03) << 6) | c4;
- if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE])
- {
- if (*--fbufp != '\n' ||
- (fbufp > fbuf && *--fbufp != '\r'))
- {
- pxflags |= PXLF_NOADDEOL;
- fbufp++;
- }
- putxline((char *) fbuf, fbufp - fbuf,
- mci, pxflags);
- pxflags &= ~PXLF_NOADDEOL;
- fbufp = fbuf;
- }
+ PUTLINE64;
}
}
else
diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c
index 6f91ed9..e71b8f2 100644
--- a/contrib/sendmail/src/queue.c
+++ b/contrib/sendmail/src/queue.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: queue.c,v 8.863.2.61 2003/09/03 19:58:26 ca Exp $")
+SM_RCSID("@(#)$Id: queue.c,v 8.863.2.67 2003/12/02 23:56:01 ca Exp $")
#include <dirent.h>
@@ -22,7 +22,16 @@ SM_RCSID("@(#)$Id: queue.c,v 8.863.2.61 2003/09/03 19:58:26 ca Exp $")
# define sm_file_exists(errno) ((errno) == EEXIST)
-# define TF_OPEN_FLAGS (O_CREAT|O_WRONLY|O_EXCL)
+# if HASFLOCK && defined(O_EXLOCK)
+# define SM_OPEN_EXLOCK 1
+# define TF_OPEN_FLAGS (O_CREAT|O_WRONLY|O_EXCL|O_EXLOCK)
+# else /* HASFLOCK && defined(O_EXLOCK) */
+# define TF_OPEN_FLAGS (O_CREAT|O_WRONLY|O_EXCL)
+# endif /* HASFLOCK && defined(O_EXLOCK) */
+
+#ifndef SM_OPEN_EXLOCK
+# define SM_OPEN_EXLOCK 0
+#endif /* ! SM_OPEN_EXLOCK */
/*
** Historical notes:
@@ -358,6 +367,18 @@ queueup(e, announce, msync)
** Create control file.
*/
+#define OPEN_TF do \
+ { \
+ MODE_T oldumask = 0; \
+ \
+ if (bitset(S_IWGRP, QueueFileMode)) \
+ oldumask = umask(002); \
+ tfd = open(tf, TF_OPEN_FLAGS, QueueFileMode); \
+ if (bitset(S_IWGRP, QueueFileMode)) \
+ (void) umask(oldumask); \
+ } while (0)
+
+
newid = (e->e_id == NULL) || !bitset(EF_INQUEUE, e->e_flags);
(void) sm_strlcpy(tf, queuename(e, NEWQFL_LETTER), sizeof tf);
tfp = e->e_lockfp;
@@ -370,9 +391,11 @@ queueup(e, announce, msync)
*/
(void) sm_strlcpy(tf, queuename(e, ANYQFL_LETTER), sizeof tf);
- tfd = open(tf, TF_OPEN_FLAGS, FileMode);
+ OPEN_TF;
if (tfd < 0 ||
+#if !SM_OPEN_EXLOCK
!lockfile(tfd, tf, NULL, LOCK_EX|LOCK_NB) ||
+#endif /* !SM_OPEN_EXLOCK */
(tfp = sm_io_open(SmFtStdiofd, SM_TIME_DEFAULT,
(void *) &tfd, SM_IO_WRONLY_B,
NULL)) == NULL)
@@ -396,14 +419,7 @@ queueup(e, announce, msync)
{
if (tfd < 0)
{
- MODE_T oldumask = 0;
-
- if (bitset(S_IWGRP, QueueFileMode))
- oldumask = umask(002);
- tfd = open(tf, TF_OPEN_FLAGS, QueueFileMode);
- if (bitset(S_IWGRP, QueueFileMode))
- (void) umask(oldumask);
-
+ OPEN_TF;
if (tfd < 0)
{
if (errno != EEXIST)
@@ -414,12 +430,22 @@ queueup(e, announce, msync)
tf, (int) geteuid(),
sm_errstring(errno));
}
+#if SM_OPEN_EXLOCK
+ else
+ break;
+#endif /* SM_OPEN_EXLOCK */
}
if (tfd >= 0)
{
+#if SM_OPEN_EXLOCK
+ /* file is locked by open() */
+ break;
+#else /* SM_OPEN_EXLOCK */
if (lockfile(tfd, tf, NULL, LOCK_EX|LOCK_NB))
break;
- else if (LogLevel > 0 && (i % 32) == 0)
+ else
+#endif /* SM_OPEN_EXLOCK */
+ if (LogLevel > 0 && (i % 32) == 0)
sm_syslog(LOG_ALERT, e->e_id,
"queueup: cannot lock %s: %s",
tf, sm_errstring(errno));
@@ -5172,6 +5198,36 @@ queuename(e, type)
sm_dprintf("queuename: %s\n", buf);
return buf;
}
+
+/*
+** INIT_QID_ALG -- Initialize the (static) parameters that are used to
+** generate a queue ID.
+**
+** This function is called by the daemon to reset
+** LastQueueTime and LastQueuePid which are used by assign_queueid().
+** Otherwise the algorithm may cause problems because
+** LastQueueTime and LastQueuePid are set indirectly by main()
+** before the daemon process is started, hence LastQueuePid is not
+** the pid of the daemon and therefore a child of the daemon can
+** actually have the same pid as LastQueuePid which means the section
+** in assign_queueid():
+** * see if we need to get a new base time/pid *
+** is NOT triggered which will cause the same queue id to be generated.
+**
+** Parameters:
+** none
+**
+** Returns:
+** none.
+*/
+
+void
+init_qid_alg()
+{
+ LastQueueTime = 0;
+ LastQueuePid = -1;
+}
+
/*
** ASSIGN_QUEUEID -- assign a queue ID for this envelope.
**
@@ -5188,8 +5244,20 @@ queuename(e, type)
** none.
*/
-static const char QueueIdChars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx";
+static const char QueueIdChars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
# define QIC_LEN 60
+# define QIC_LEN_R 62
+
+/*
+** Note: the length is "officially" 60 because minutes and seconds are
+** usually only 0-59. However (Linux):
+** tm_sec The number of seconds after the minute, normally in
+** the range 0 to 59, but can be up to 61 to allow for
+** leap seconds.
+** Hence the real length of the string is 62 to take this into account.
+** Alternatively % QIC_LEN can (should) be used for access everywhere.
+*/
+
# define queuenextid() CurrentPid
@@ -5244,8 +5312,8 @@ assign_queueid(e)
idbuf[1] = QueueIdChars[tm->tm_mon];
idbuf[2] = QueueIdChars[tm->tm_mday];
idbuf[3] = QueueIdChars[tm->tm_hour];
- idbuf[4] = QueueIdChars[tm->tm_min];
- idbuf[5] = QueueIdChars[tm->tm_sec];
+ idbuf[4] = QueueIdChars[tm->tm_min % QIC_LEN_R];
+ idbuf[5] = QueueIdChars[tm->tm_sec % QIC_LEN_R];
idbuf[6] = QueueIdChars[seq / QIC_LEN];
idbuf[7] = QueueIdChars[seq % QIC_LEN];
(void) sm_snprintf(&idbuf[8], sizeof idbuf - 8, "%06d",
@@ -7357,10 +7425,10 @@ cmpidx(a, b)
void
makeworkgroups()
{
- int i, j, total_runners = 0;
- int dir;
+ int i, j, total_runners, dir, h;
SORTQGRP_T si[MAXQUEUEGROUPS + 1];
+ total_runners = 0;
if (NumQueue == 1 && strcmp(Queue[0]->qg_name, "mqueue") == 0)
{
/*
@@ -7456,18 +7524,19 @@ makeworkgroups()
(WorkGrp[j].wg_numqgrp + 1)));
}
- WorkGrp[j].wg_qgs[WorkGrp[j].wg_numqgrp] = Queue[si[i].sg_idx];
+ h = si[i].sg_idx;
+ WorkGrp[j].wg_qgs[WorkGrp[j].wg_numqgrp] = Queue[h];
WorkGrp[j].wg_numqgrp++;
- WorkGrp[j].wg_runners += Queue[i]->qg_maxqrun;
- Queue[si[i].sg_idx]->qg_wgrp = j;
+ WorkGrp[j].wg_runners += Queue[h]->qg_maxqrun;
+ Queue[h]->qg_wgrp = j;
if (WorkGrp[j].wg_maxact == 0)
{
/* can't have more runners than allowed total */
if (MaxQueueChildren > 0 &&
- Queue[i]->qg_maxqrun > MaxQueueChildren)
- Queue[i]->qg_maxqrun = MaxQueueChildren;
- WorkGrp[j].wg_maxact = Queue[i]->qg_maxqrun;
+ Queue[h]->qg_maxqrun > MaxQueueChildren)
+ Queue[h]->qg_maxqrun = MaxQueueChildren;
+ WorkGrp[j].wg_maxact = Queue[h]->qg_maxqrun;
}
/*
@@ -7477,9 +7546,9 @@ makeworkgroups()
*/
/* keep track of the lowest interval for a persistent runner */
- if (Queue[si[i].sg_idx]->qg_queueintvl > 0 &&
- WorkGrp[j].wg_lowqintvl < Queue[si[i].sg_idx]->qg_queueintvl)
- WorkGrp[j].wg_lowqintvl = Queue[si[i].sg_idx]->qg_queueintvl;
+ if (Queue[h]->qg_queueintvl > 0 &&
+ WorkGrp[j].wg_lowqintvl < Queue[h]->qg_queueintvl)
+ WorkGrp[j].wg_lowqintvl = Queue[h]->qg_queueintvl;
j += dir;
}
if (tTd(41, 9))
diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c
index 2a40e82..161e7d5 100644
--- a/contrib/sendmail/src/readcf.c
+++ b/contrib/sendmail/src/readcf.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: readcf.c,v 8.607.2.11 2003/04/03 23:04:06 ca Exp $")
+SM_RCSID("@(#)$Id: readcf.c,v 8.607.2.12 2003/10/07 17:45:28 ca Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@@ -3153,7 +3153,7 @@ setoption(opt, val, safe, sticky, e)
RunAsGid = pw->pw_gid;
else if (UseMSP && *p == '\0')
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
- "WARNING: RunAsGid for MSP ignored, check group ids (egid=%d, want=%d)\n",
+ "WARNING: RunAsUser for MSP ignored, check group ids (egid=%d, want=%d)\n",
(int) EffGid,
(int) pw->pw_gid);
}
@@ -3177,7 +3177,7 @@ setoption(opt, val, safe, sticky, e)
else if (UseMSP)
(void) sm_io_fprintf(smioout,
SM_TIME_DEFAULT,
- "WARNING: RunAsGid for MSP ignored, check group ids (egid=%d, want=%d)\n",
+ "WARNING: RunAsUser for MSP ignored, check group ids (egid=%d, want=%d)\n",
(int) EffGid,
(int) runasgid);
}
@@ -3194,7 +3194,7 @@ setoption(opt, val, safe, sticky, e)
else if (UseMSP)
(void) sm_io_fprintf(smioout,
SM_TIME_DEFAULT,
- "WARNING: RunAsGid for MSP ignored, check group ids (egid=%d, want=%d)\n",
+ "WARNING: RunAsUser for MSP ignored, check group ids (egid=%d, want=%d)\n",
(int) EffGid,
(int) gr->gr_gid);
}
diff --git a/contrib/sendmail/src/recipient.c b/contrib/sendmail/src/recipient.c
index 7452897..b7b6660 100644
--- a/contrib/sendmail/src/recipient.c
+++ b/contrib/sendmail/src/recipient.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: recipient.c,v 8.330.2.2 2003/09/16 19:56:25 ca Exp $")
+SM_RCSID("@(#)$Id: recipient.c,v 8.330.2.4 2003/10/06 20:43:29 ca Exp $")
static void includetimeout __P((void));
static ADDRESS *self_reference __P((ADDRESS *));
@@ -397,7 +397,8 @@ removefromlist(list, sendq, e)
for (pq = sendq; (q = *pq) != NULL; pq = &q->q_next)
{
if (!QS_IS_DEAD(q->q_state) &&
- sameaddr(q, &a))
+ (sameaddr(q, &a) ||
+ strcmp(q->q_paddr, a.q_paddr) == 0))
{
if (tTd(25, 5))
{
diff --git a/contrib/sendmail/src/sendmail.8 b/contrib/sendmail/src/sendmail.8
index eb67358..eacfbd0 100644
--- a/contrib/sendmail/src/sendmail.8
+++ b/contrib/sendmail/src/sendmail.8
@@ -9,9 +9,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: sendmail.8,v 8.51.2.1 2003/05/20 16:38:15 gshapiro Exp $
+.\" $Id: sendmail.8,v 8.51.2.3 2003/12/01 17:02:00 ca Exp $
.\"
-.TH SENDMAIL 8 "$Date: 2003/05/20 16:38:15 $"
+.TH SENDMAIL 8 "$Date: 2003/12/01 17:02:00 $"
.SH NAME
sendmail
\- an electronic mail transport agent
@@ -150,11 +150,32 @@ users or mailing lists.
.BI \-C file
Use alternate configuration file.
.B Sendmail
-refuses to run as root if an alternate configuration file is specified.
-.TP
-.BI \-d X
-Set debugging value to
-.IR X .
+gives up any enhanced (set-user-ID or set-group-ID) privileges
+if an alternate configuration file is specified.
+.TP
+.BI \-d category . level...
+Set the debugging flag for
+.I category
+to
+.IR level .
+.I Category
+is either an integer or a name specifying the topic, and
+.I level
+an integer specifying the level of debugging output desired.
+Higher levels generally mean more output.
+More than one flag can be specified by separating them with commas.
+A list of numeric debugging categories can be found in the TRACEFLAGS file
+in the sendmail source distribution.
+.br
+The option
+.B \-d0.1
+prints the version of
+.B sendmail
+and the options it was compiled with.
+.br
+Most other categories are only useful with, and documented in,
+.BR sendmail 's
+source code.
.ne 1i
.TP
.BI \-F fullname
diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h
index 07e59bc..2e1b732 100644
--- a/contrib/sendmail/src/sendmail.h
+++ b/contrib/sendmail/src/sendmail.h
@@ -48,7 +48,7 @@
#ifdef _DEFINE
# ifndef lint
-SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.919.2.28 2003/09/03 19:58:27 ca Exp $";
+SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.919.2.29 2003/11/07 00:08:02 ca Exp $";
# endif /* ! lint */
#endif /* _DEFINE */
@@ -1973,6 +1973,7 @@ extern void setup_queues __P((bool));
extern bool setnewqueue __P((ENVELOPE *));
extern bool shouldqueue __P((long, time_t));
extern void sync_queue_time __P((void));
+extern void init_qid_alg __P((void));
extern int print_single_queue __P((int, int));
#if REQUIRES_DIR_FSYNC
# define SYNC_DIR(path, panic) sync_dir(path, panic)
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c
index 52d47a1..e752aa0 100644
--- a/contrib/sendmail/src/srvrsmtp.c
+++ b/contrib/sendmail/src/srvrsmtp.c
@@ -16,7 +16,7 @@
# include <libmilter/mfdef.h>
#endif /* MILTER */
-SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.829.2.31 2003/07/01 17:30:01 ca Exp $")
+SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.829.2.34 2004/01/14 19:13:46 ca Exp $")
#if SASL || STARTTLS
# include <sys/time.h>
@@ -1288,6 +1288,7 @@ smtp(nullserver, d_flags, e)
case CMDEHLO:
case CMDNOOP:
case CMDRSET:
+ case CMDERROR:
/* process normally */
break;
@@ -2338,6 +2339,29 @@ tlsfail:
case CMDRCPT: /* rcpt -- designate recipient */
DELAY_CONN("RCPT");
+ if (BadRcptThrottle > 0 &&
+ n_badrcpts >= BadRcptThrottle)
+ {
+ if (LogLevel > 5 &&
+ n_badrcpts == BadRcptThrottle)
+ {
+ sm_syslog(LOG_INFO, e->e_id,
+ "%s: Possible SMTP RCPT flood, throttling.",
+ CurSmtpClient);
+
+ /* To avoid duplicated message */
+ n_badrcpts++;
+ }
+
+ /*
+ ** Don't use exponential backoff for now.
+ ** Some servers will open more connections
+ ** and actually overload the receiver even
+ ** more.
+ */
+
+ (void) sleep(1);
+ }
if (!smtp.sm_gotmail)
{
usrerr("503 5.0.0 Need MAIL before RCPT");
@@ -2384,29 +2408,6 @@ tlsfail:
e, true);
macdefine(&e->e_macro, A_PERM,
macid("{addr_type}"), NULL);
- if (BadRcptThrottle > 0 &&
- n_badrcpts >= BadRcptThrottle)
- {
- if (LogLevel > 5 &&
- n_badrcpts == BadRcptThrottle)
- {
- sm_syslog(LOG_INFO, e->e_id,
- "%s: Possible SMTP RCPT flood, throttling.",
- CurSmtpClient);
-
- /* To avoid duplicated message */
- n_badrcpts++;
- }
-
- /*
- ** Don't use exponential backoff for now.
- ** Some servers will open more connections
- ** and actually overload the receiver even
- ** more.
- */
-
- (void) sleep(1);
- }
if (Errors > 0)
goto rcpt_done;
if (a == NULL)
@@ -3146,7 +3147,7 @@ smtp_data(smtp, e)
doublequeue = false;
aborting = Errors > 0;
- if (!aborting &&
+ if (!(aborting || bitset(EF_DISCARD, e->e_flags)) &&
#if _FFR_QUARANTINE
(QueueMode == QM_QUARANTINE || e->e_quarmsg == NULL) &&
#endif /* _FFR_QUARANTINE */
diff --git a/contrib/sendmail/src/tls.c b/contrib/sendmail/src/tls.c
index a74c691..598c187 100644
--- a/contrib/sendmail/src/tls.c
+++ b/contrib/sendmail/src/tls.c
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: tls.c,v 8.79.4.4 2003/03/20 00:03:42 ca Exp $")
+SM_RCSID("@(#)$Id: tls.c,v 8.79.4.5 2003/12/28 04:23:28 gshapiro Exp $")
#if STARTTLS
# include <openssl/err.h>
@@ -344,30 +344,36 @@ 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 */
+/* Type of variable */
+# define TLS_T_OTHER 0
+# define TLS_T_SRV 1
+# define TLS_T_CLT 2
+
/*
** TLS_OK_F -- can var be an absolute filename?
**
** Parameters:
** var -- filename
** fn -- what is the filename used for?
-** srv -- server side?
+** type -- type of variable
**
** Returns:
** ok?
*/
static bool
-tls_ok_f(var, fn, srv)
+tls_ok_f(var, fn, type)
char *var;
char *fn;
- bool srv;
+ int type;
{
/* must be absolute pathname */
if (var != NULL && *var == '/')
return true;
if (LogLevel > 12)
sm_syslog(LOG_WARNING, NOQID, "STARTTLS: %s%s missing",
- srv ? "Server" : "Client", fn);
+ type == TLS_T_SRV ? "Server" :
+ (type == TLS_T_CLT ? "Client" : ""), var);
return false;
}
/*
@@ -407,16 +413,16 @@ tls_safe_f(var, sff, srv)
** fn -- what is the filename used for?
** req -- is the file required?
** st -- status bit to set if ok
-** srv -- server side?
+** type -- type of variable
**
** Side Effects:
** uses r, ok; may change ok and status.
**
*/
-# define TLS_OK_F(var, fn, req, st, srv) if (ok) \
+# define TLS_OK_F(var, fn, req, st, type) if (ok) \
{ \
- r = tls_ok_f(var, fn, srv); \
+ r = tls_ok_f(var, fn, type); \
if (r) \
status |= st; \
else if (req) \
@@ -539,13 +545,13 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
*/
TLS_OK_F(certfile, "CertFile", bitset(TLS_I_CERT_EX, req),
- TLS_S_CERT_EX, srv);
+ TLS_S_CERT_EX, srv ? TLS_T_SRV : TLS_T_CLT);
TLS_OK_F(keyfile, "KeyFile", bitset(TLS_I_KEY_EX, req),
- TLS_S_KEY_EX, srv);
+ TLS_S_KEY_EX, srv ? TLS_T_SRV : TLS_T_CLT);
TLS_OK_F(cacertpath, "CACertPath", bitset(TLS_I_CERTP_EX, req),
- TLS_S_CERTP_EX, srv);
+ TLS_S_CERTP_EX, TLS_T_OTHER);
TLS_OK_F(cacertfile, "CACertFile", bitset(TLS_I_CERTF_EX, req),
- TLS_S_CERTF_EX, srv);
+ TLS_S_CERTF_EX, TLS_T_OTHER);
# if _FFR_TLS_1
/*
@@ -556,12 +562,12 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
if (cf2 != NULL)
{
TLS_OK_F(cf2, "CertFile", bitset(TLS_I_CERT_EX, req),
- TLS_S_CERT2_EX, srv);
+ TLS_S_CERT2_EX, srv ? TLS_T_SRV : TLS_T_CLT);
}
if (kf2 != NULL)
{
TLS_OK_F(kf2, "KeyFile", bitset(TLS_I_KEY_EX, req),
- TLS_S_KEY2_EX, srv);
+ TLS_S_KEY2_EX, srv ? TLS_T_SRV : TLS_T_CLT);
}
# endif /* _FFR_TLS_1 */
@@ -599,7 +605,7 @@ inittls(ctx, req, srv, certfile, keyfile, cacertpath, cacertfile, dhparam)
{
TLS_OK_F(dhparam, "DHParameters",
bitset(TLS_I_DHPAR_EX, req),
- TLS_S_DHPAR_EX, srv);
+ TLS_S_DHPAR_EX, TLS_T_OTHER);
}
}
if (!ok)
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c
index dc0b1e4..911f692 100644
--- a/contrib/sendmail/src/util.c
+++ b/contrib/sendmail/src/util.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: util.c,v 8.363.2.7 2003/06/02 03:25:39 gshapiro Exp $")
+SM_RCSID("@(#)$Id: util.c,v 8.363.2.10 2003/10/15 17:19:14 ca Exp $")
#include <sysexits.h>
#include <sm/xtrap.h>
@@ -2380,7 +2380,8 @@ str2prt(s)
*h++ = 'r';
break;
default:
- (void) sm_snprintf(h, l, "%03o", (int) c);
+ (void) sm_snprintf(h, l, "%03o",
+ (unsigned int)((unsigned char) c));
/*
** XXX since l is unsigned this may
diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c
index 9f7eb12..ec91cfe 100644
--- a/contrib/sendmail/src/version.c
+++ b/contrib/sendmail/src/version.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,6 +13,6 @@
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: version.c,v 8.104.2.22 2003/09/16 20:02:04 ca Exp $")
+SM_RCSID("@(#)$Id: version.c,v 8.104.2.26 2004/01/13 00:29:26 ca Exp $")
-char Version[] = "8.12.10";
+char Version[] = "8.12.11";
OpenPOWER on IntegriCloud