diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2005-02-14 02:30:00 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2005-02-14 02:30:00 +0000 |
commit | 9883351c45502bc6aec878ba11d8ef5fe1843397 (patch) | |
tree | d9cfa9f19110fa167a0fec9f07c6fcfacd77aafb /contrib | |
parent | 1fc446a819a244515d9461fa50d34ee191414d6f (diff) | |
download | FreeBSD-src-9883351c45502bc6aec878ba11d8ef5fe1843397.zip FreeBSD-src-9883351c45502bc6aec878ba11d8ef5fe1843397.tar.gz |
Import sendmail 8.13.3
Diffstat (limited to 'contrib')
77 files changed, 707 insertions, 264 deletions
diff --git a/contrib/sendmail/KNOWNBUGS b/contrib/sendmail/KNOWNBUGS index 1d45bef..c13be19 100644 --- a/contrib/sendmail/KNOWNBUGS +++ b/contrib/sendmail/KNOWNBUGS @@ -41,6 +41,12 @@ This list is not guaranteed to be complete. characters then no header check is done even if one is configured for the header. +* Header lines which are too long will be split incorrectly. + + Header lines which are longer than 2045 characters will be split + but some characters might be lost. Fix: obey RFC (2)822 and do not + send lines that are longer than 1000 characters. + * Sender addresses whose domain part cause a temporary A record lookup failure but have a valid MX record will be temporarily rejected in the default configuration. Solution: fix the DNS at the sender side. @@ -241,4 +247,4 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.56 $, Last updated $Date: 2002/12/18 22:39:06 $ +$Revision: 8.57 $, Last updated $Date: 2004/12/02 23:39:01 $ diff --git a/contrib/sendmail/PGPKEYS b/contrib/sendmail/PGPKEYS index ddd08ba..45ca18c 100644 --- a/contrib/sendmail/PGPKEYS +++ b/contrib/sendmail/PGPKEYS @@ -89,6 +89,78 @@ y+PVZ1MwnEXfTQReVSla0AAOIRirHEh4YnUVZzFSNEJqoDRZQwVd7Q== -----END PGP PUBLIC KEY BLOCK----- Type Bits KeyID Created Expires Algorithm Use +pub 1024 0x1EF99251 2004-12-30 ---------- RSA Sign & Encrypt +f16 Fingerprint16 = 4B 38 0E 0B 41 E8 FC 79 E9 7E 82 9B 04 23 EC 8A +uid Sendmail Signing Key/2005 <sendmail@Sendmail.ORG> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.6 (OpenBSD) + +mQCNA0HULI4AAAEEAMA3Tq8fneEtiNHeTU/i5YqaoV1g6oq26sZpCPjvdUnC2ebK +A4GwHv+HHDs/4nDhuRR42f/HRaSt8xzAIaYp9H/gAhY9J9OMTVvohv0vISMJOxNF +GdcNrBfUupnvkobe/Muizof+d+xT+Clik6Qh902nCOriXkWcRnCgJE0e+ZJRAAUR +tDFTZW5kbWFpbCBTaWduaW5nIEtleS8yMDA1IDxzZW5kbWFpbEBTZW5kbWFpbC5P +Ukc+iQCVAwUQQdQsjnCgJE0e+ZJRAQGUQAP+NzZIG06+vs1qEcZezheGPE4zMf8m +2v7XqAa5d9Wz9xKyZUwOaY3UXbP1qFpbqq2BQDapFE7nMLi06Z3Dgt7i0jqWWEdr +bPbFPEejgbujjLHXkDlMOnGs17n0Bvkov/+irTvT3ONVGxypsIc2hA8pRfldCZ90 +BnpOvEVpAX/XDK6JAJUDBRNB1C+MyNXtKZX2F3EBAeGwA/wKTBsoaBTt5YPDIxOc +d2f0uBlPdMyjmZ5OPLfkJj3wnYSnJWYLPX2JrBydSaE1ZlRXNBn90rqTQgqbmPU+ +r5IIXVf8UWL068yV1+G43PR7btuj7f1NTXOL77r5FfI6v12wnqZdC20W4ZJiLQ3A +veW00r6jQeVrofaTnY++Fg5cUIkAlQMFE0HUL5zvWJZk1DLhnQEBBi8D/2w0AGLz +vBlqPWQfZaj3jcEQhoiIGp0HyFPPicS7pM3NSQ3R8itF7AgSgqh37QhbBHV+g0Y9 +wcDsSvZg2WqAil9KZccKbqumt2DyxIrYyHY9Z3FJDBPb7zQEMUN9AoHvr4YTYuhY +FivXEAjdzpAluSjpbXtUyl7IPCGUiBSSOHF6iQCVAwUTQdQv1m9Sk9ijm6ZVAQFD +EQQApeIanx771wuf9T6hXxhfK591zKcLjQ4fUT34SbJgqt434lWwv4j7cr4eJ5ni +g3AJAU4Fa5mR09R4dmGFxEEJNYxVtK71ylmP5vKx+sj6kmBDNvzsIT69juFdtWCE +ojCRVwlNMl3xJ6tECdy2BdyecE21+f3qFbn8IOLv+ODClZyJAJUDBRNB1C/pnBy9 +4uNcVjUBAerHA/0ceUV3mPPM/41N64oon5bkzy+ZHUrF/35OglT2hbo68u3D5M/s +XrPbm1FKKlW2zfeQX3j1cSwqsTsrOFPPRmUkR35WX/3G1Nk/2Nbq/n9wJOHDGnn2 +Rz07i5/NIiAvQ0r5WeGH1v1tpXv08sTlvr+BhQ9flQoPG94sys6hUzo7hIkAlQMF +E0HUMBM4IttHzDdPLQEBgWYEAImlnypvC72A7RIpPUlVasE6KAWTC1KSqF7mNo4w +zzdrztkONepBT8wZ+PNShWO1ZvK5Dpm6/1B+he9FDVwLyA9oQgDptHDvnQbSSc4P +NuA4e3F8jabeHKcQaYXODN66roy6IuI8W2kfX8AJTcr+YnJRNljk3ZeLavwzidzI ++tqMiQCVAwUTQdQwHolpYrhnjAoDAQHu/gP+JaFLkI4L22YZJYckxxuRoP+tM5Y/ +wQvUJO5EhSqAmxUyMY6mAG1TqnHDBD6o++PoAY+ZsjJ9/RherLlWmdUNAnvEln61 +QUYsZA7jZ8RxaejfEAQi2jIKVUanNax86lZayhQFsJNeDMVEVaftdFQGbK45Sxe7 +6IQrNM6yGKjVNbCJAJUDBRNB1DAvIYPhsTlvB4kBASCMBACiwv8V3TxoMgJi5Gse +IBW26T8R48Hl2x8v09xFWcjl1b2nDo/f8f3GwqgUykmyEZlsBC0tjZIA0iX0SvNT +uOrTxxi7iAKI0AeVoCthFX3O2FSax2rHMqqO7addL4aOmTDztOEbIn1fheVU8RSc +vJEhj5HZpQnDdjJ9HADCaK2v8YkAlQMFE0HUMErAKcpAFvTM6QEBFL4D/jAi7xsz +qM3dmWGT2klGmeOttAZJLJscfsDusdc2WpFQgJqFXOz1jo5r4AhfeHn5jYrqa+V2 +OpOW9BYn5hkkdeghaDYYvewAGLRvzYGK8zQMBnhGYtfWi4DaadWSCbdKUuCKctOC +GxDQKj0hR419/aC6Om16JYTrqFjpefqeScZqiQCVAwUTQdQwX8GcHSUS00YdAQFE +CgP/RT2QYuNzLqYa/6JLFHW+fXxydNjumBlEQk87Oc9V4O1VpaYdYrgv7MEAHafZ +uzRjJbDUW2phB+2kH8fErFPdJpCYwjVS9BvZMUD04UDY7GTxcYR6fUgjF3uzXNcD +6GDaveh8+xEDACrgM/n/UYy4rG8WVDHQU4q7SrF8ZvtBksGJAJUDBRNB1DB+fEtn +baAOFWMBASdMBACmoFq4r4cFsB/UTw/vLJJyaiKqicVGVUSm4tWyk0uieY64QvUT +FieuAa/2cVJ561KBor38kw3w23O8giFzQL+jWPycGPSthwK0o62EaDS2EbvUdrdE +qP3rJ6BQj6ZtDpQwJT1ZisSUIw6Qu6pYX6VHNFXEQZrR9Kn3jT5l1NU92okAlQMF +E0HUMIrW4KH+T74q3QEBbMcD/RO9NdesEUG7BOOL5nODyiKQZwcDBG2NwffViNUW +ul2VYMvO/JGFu0yePNar/exsi85T4gh/ZDDCgpR1HuwkXAu89ErTFpx/Uypjmjag +aCBGSHRjRZ3Tdua4xzw7tngiKXxgr3k4frZMn8xp0WOwkFp2jBRNmrHvKPa2RN2v +NRleiQCVAwUTQdTjQM8etQMiMnoBAQHupwP/TDjFRNDqX4oiVqhN2RShKi6OrXVg +Ek6C5xtBMs0aeXZCsS5hOxAYk9oAPf45ZFcQ5Nyeq+pFnUZOlyi9aM/uJ5z7Tck/ +5tPoKhtu7rDf9z0+kjJ8tVk2rLhS5a1/5CKcLZ6IjeFJnZ69cgmgHfCFDHY48USc +mQj/mna2duSQgoGIRgQSEQIABgUCQdW+UAAKCRAJp6JK0eWCB5lUAJ4zuWYkKG70 +HWimq/WgcXuoHCmt2ACgkYDoaTkqGWMuqH1aGz39VlAeIiCJAJUDBRBB1cgi4dT8 +FObQdHEBAW9OA/9lokAoFOu8JMzjZO+9xOmBNMtLTJ54KTKDJuMtXKqJu583Q9sz +gbaOjEMHcxzGuiLsyNiyIEl3d0vNdFM4FHq5xxSOIWQ9k3IqsdKP5P6uG/FbDHdg +zvJiu6Silw7L40dBJuRsGRtUrhOBYwl7lWWT6M1F70tT8M67Tlrs1UAeZokAlQMF +EkHV2EdfHshviAyeVQEBKkAD/34ZxQq84HMJjUBOfYuEIb8WJ8KHvX3QOESAF1WC +e2UgcVdWAy0PWldcgXYnBAzGJU47uiVvItJCggs3Wfc7DBQakhpnV7cME50b7qbr +IwvfkUJ9DMv0dZTBZxK6Li+/S3oKZ/ooNHhjVvw9BaP5Dr1mxvD7Fs02EorFuls7 +BAbEiEYEExECAAYFAkHWz0QACgkQorv7JAz5VveWtgCfeUwKVUfraOMNHG8McORO +U7WwodAAnjl/fVJW7p3uiux2x0QISAZr//lHiEYEEhECAAYFAkHWomgACgkQxLEH +mIV5aiOhygCfeeBg8DesCD66kF6J/lVxm90Rg6gAn1MExYty5y9hgqiMY3j7K7DM +SL8DiEYEEhECAAYFAkHZuT0ACgkQoE/7G33K6dMQlQCgwPVGqmYnWBCtHY8SRiYi +B3fKwiUAn0fzl2EbbqKbPdpGSu7X7L3nPwxViQCVAwUQQd4B3gZ+Xti/tWVpAQHZ +RQP/TBlYIYY5o0lscTJY/5tkcVqq4n+BT/BlSWD9gjk3oSq0/dJte+UQiad2FZPb +omDXzzuedh60edemiXgXkJlkrJ2SSYuTSP7cnUhXnIV9RP3IVcrj+L8we+F5oPWd +SlYCp6uJL+QCsIzIFNfWvLjR38mIYsTqdPTdHzVu17e6wjY= +=ZslF +-----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> @@ -1022,4 +1094,4 @@ SIXqPke2iCW6+zdG1T/gS5T9T9/Lf2c9FQf0FjURAi3ynDA2RBLA5FDsI8v3 =dbDm -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.17 $, Last updated $Date: 2004/01/13 21:17:49 $ +$Revision: 8.21 $, Last updated $Date: 2005/01/07 04:39:10 $ diff --git a/contrib/sendmail/RELEASE_NOTES b/contrib/sendmail/RELEASE_NOTES index 6df95cf..01e949d 100644 --- a/contrib/sendmail/RELEASE_NOTES +++ b/contrib/sendmail/RELEASE_NOTES @@ -1,11 +1,76 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.1679 2004/07/30 18:03:07 ca Exp $ + $Id: RELEASE_NOTES,v 8.1709 2005/01/12 04:32:31 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.13.3/8.13.3 2005/01/11 + Enhance handling of I/O errors, especially EOF, when STARTTLS + is active. + Make sure a connection is not reused after it has been closed + due to a 421 error. Problem found by Allan E Johannesen + of Worcester Polytechnic Institute. + Avoid triggering an assertion when sendmail is interrupted while + closing a connection. Problem found by Allan E Johannesen + of Worcester Polytechnic Institute. + Regression: a change in 8.13.2 caused sendmail not to try the + next MX host (or FallbackMXhost if configured) when, at + connection open, the current server returns a 4xy or 5xy + SMTP reply code. Problem noted by Mark Tranchant. + +8.13.2/8.13.2 2004/12/15 + Do not split the first header even if it exceeds the internal + buffer size. Previously a part of such a header would + end up in the body of the message. Problem noted by + Simple Nomad of BindView. + Do not complain about "cataddr: string too long" when checking + headers that do not contain RFC 2822 addresses. + Problem noted by Rich Graves of Brandeis University. + If a server returns a 421 reply to the RSET command between + message deliveries, do not attempt to deliver any more + messages on that connection. This prevents bogus "Bad + file number" recipient status. Problem noted by + Allan E Johannesen of Worcester Polytechnic Institute. + Allow trailing white space in EHLO command as recommended by RFC + 2821. Problem noted by Ralph Santagato of SBC Services. + Deal with clients which use AUTH but negotiate a smaller buffer size + for data exchanges than the value used by sendmail, e.g., + Cyrus IMAP lmtp server. Based on patch by Jamie Clark. + When passing ESMTP arguments for RCPT to a milter, do not cut + them off at a comma. Problem noted by Krzysztof Oledzki. + Add more logging to milter change header functions to + complement existing logging. Based on patch from + Gurusamy Sarathy of Active State. + Include <lber.h> in include/sm/config.h when LDAPMAP is defined. + Patch from Edgar Hoch of the University of Stuttgart. + Fix DNS lookup if IPv6 is enabled when converting an IP address + to a hostname for use with SASL. Problem noted by Ken Jones; + patch from Hajimu UMEMOTO. + CONFIG: For consistency enable MODIFY_MAILER_FLAGS for the prog + mailer. Patch from John Beck of Sun Microsystems. + LIBMILTER: It was possible that xxfi_abort() was called after + xxfi_eom() for a message if some timeouts were triggered. + Patch from Alexey Kravchuk. + LIBMILTER: Slightly rearrange mutex use in listener.c to allow + different threads to call smfi_opensocket() and smfi_main(). + Patch from Jordan Ritter of Cloudmark. + MAIL.LOCAL: Properly terminate MBDB before exiting. Problem + noted by Nelson Fung. + MAIL.LOCAL: make strip-mail.local used a wrong path to access + mail.local. Problem noted by William Park. + VACATION: Properly terminate MBDB before exiting. Problem noted + by Nelson Fung. + Portability: + Add support for DragonFly BSD. + New Files: + cf/ostype/dragonfly.m4 + devtools/OS/DragonFly + include/sm/os/sm_os_dragonfly.h + Deleted Files: + libsm/vsscanf.c + 8.13.1/8.13.1 2004/07/30 Using the default AliasFile ldap: specification would cause the objectClasses of the LDAP response to be included in the @@ -121,7 +186,7 @@ summary of the changes in that release. sendmail will now remove its pidfile when it exits. This was done to prevent confusion caused by running sendmail stop scripts two or more times, where the second and subsequent - runs would report misleading error messages about sendmail's + runs would report misleading error messages about sendmail's pid no longer existing. See section 1.3.15 of doc/op/op.me for a discussion of the implications of this, including how to correct broken scripts which may have depended on diff --git a/contrib/sendmail/cf/cf/Makefile b/contrib/sendmail/cf/cf/Makefile index 04d5eee..eb4f568 100644 --- a/contrib/sendmail/cf/cf/Makefile +++ b/contrib/sendmail/cf/cf/Makefile @@ -1,7 +1,7 @@ # # Makefile for configuration files. # -# $Id: Makefile,v 8.58 2003/10/20 22:01:00 ca Exp $ +# $Id: Makefile,v 8.59 2004/08/06 03:54:05 gshapiro Exp $ # # @@ -164,6 +164,7 @@ M4FILES=\ ${CFDIR}/ostype/bsdi2.0.m4 \ ${CFDIR}/ostype/dgux.m4 \ ${CFDIR}/ostype/domainos.m4 \ + ${CFDIR}/ostype/dragonfly.m4 \ ${CFDIR}/ostype/dynix3.2.m4 \ ${CFDIR}/ostype/freebsd4.m4 \ ${CFDIR}/ostype/freebsd5.m4 \ diff --git a/contrib/sendmail/cf/cf/submit.cf b/contrib/sendmail/cf/cf/submit.cf index ee9ae09..d5a8272 100644 --- a/contrib/sendmail/cf/cf/submit.cf +++ b/contrib/sendmail/cf/cf/submit.cf @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@wiz.smi.sendmail.com on Fri Jul 30 11:06:26 PDT 2004 -##### in /extra/home/ca/sm-8.13.1/OpenSource/sendmail-8.13.1/cf/cf +##### built by ca@wiz.smi.sendmail.com on Tue Jan 11 20:36:44 PST 2005 +##### in /extra/home/ca/sm-8.13.3/OpenSource/sendmail-8.13.3/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -35,7 +35,7 @@ ##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ ##### -##### $Id: proto.m4,v 8.710 2004/07/27 17:32:48 ca Exp $ ##### +##### $Id: proto.m4,v 8.711 2004/08/04 21:29:55 ca Exp $ ##### # level 10 config file format V10/Berkeley @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.13.1/Submit +DZ8.13.3/Submit ############### @@ -371,7 +371,7 @@ O TimeZoneSpec= #O RetryFactor=90000 # default character set -#O DefaultCharSet=iso-8859-1 +#O DefaultCharSet=unknown-8bit # service switch file (name hardwired on Solaris, Ultrix, OSF/1, others) #O ServiceSwitchFile=/etc/mail/service.switch @@ -1283,7 +1283,7 @@ R$* $#relay $@ ${MTAHost} $: $1 < @ $j > ### Local and Program Mailer specification ### ################################################## -##### $Id: local.m4,v 8.58 2000/10/26 01:58:29 ca Exp $ ##### +##### $Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $ ##### # # Envelope sender rewriting diff --git a/contrib/sendmail/cf/m4/proto.m4 b/contrib/sendmail/cf/m4/proto.m4 index 2397bc7..ccad77c 100644 --- a/contrib/sendmail/cf/m4/proto.m4 +++ b/contrib/sendmail/cf/m4/proto.m4 @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: proto.m4,v 8.710 2004/07/27 17:32:48 ca Exp $') +VERSIONID(`$Id: proto.m4,v 8.711 2004/08/04 21:29:55 ca Exp $') # level CF_LEVEL config file format V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley') @@ -511,7 +511,7 @@ _OPTION(ClassFactor, `confWORK_CLASS_FACTOR', `1800') _OPTION(RetryFactor, `confWORK_TIME_FACTOR', `90000') # default character set -_OPTION(DefaultCharSet, `confDEF_CHAR_SET', `iso-8859-1') +_OPTION(DefaultCharSet, `confDEF_CHAR_SET', `unknown-8bit') # service switch file (name hardwired on Solaris, Ultrix, OSF/1, others) _OPTION(ServiceSwitchFile, `confSERVICE_SWITCH_FILE', `MAIL_SETTINGS_DIR`'service.switch') diff --git a/contrib/sendmail/cf/m4/version.m4 b/contrib/sendmail/cf/m4/version.m4 index d06e15d..b374e87 100644 --- a/contrib/sendmail/cf/m4/version.m4 +++ b/contrib/sendmail/cf/m4/version.m4 @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2005 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.117 2004/07/30 18:03:07 ca Exp $') +VERSIONID(`$Id: version.m4,v 8.127 2005/01/12 04:32:32 ca Exp $') # divert(0) # Configuration version number -DZ8.13.1`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.13.3`'ifdef(`confCF_VERSION', `/confCF_VERSION') diff --git a/contrib/sendmail/cf/mailer/local.m4 b/contrib/sendmail/cf/mailer/local.m4 index c1946c9..e2f9711 100644 --- a/contrib/sendmail/cf/mailer/local.m4 +++ b/contrib/sendmail/cf/mailer/local.m4 @@ -1,6 +1,6 @@ PUSHDIVERT(-1) # -# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2000, 2004 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -32,7 +32,7 @@ POPDIVERT ### Local and Program Mailer specification ### ################################################## -VERSIONID(`$Id: local.m4,v 8.58 2000/10/26 01:58:29 ca Exp $') +VERSIONID(`$Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $') # # Envelope sender rewriting @@ -88,6 +88,6 @@ R$+ $@ $1 < @ *LOCAL* > add local qualification', Mlocal, P=LOCAL_MAILER_PATH, F=_MODMF_(CONCAT(_DEF_LOCAL_MAILER_FLAGS, LOCAL_MAILER_FLAGS), `LOCAL'), LOCAL_RWR,_OPTINS(`LOCAL_MAILER_EOL', ` E=', `, ') _OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')_OPTINS(`LOCAL_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`LOCAL_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`LOCAL_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/LOCAL_MAILER_DSN_DIAGNOSTIC_CODE,_LOCAL_QGRP A=LOCAL_MAILER_ARGS -Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(_DEF_LOCAL_SHELL_FLAGS, LOCAL_SHELL_FLAGS), S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=LOCAL_SHELL_DIR, +Mprog, P=LOCAL_SHELL_PATH, F=_MODMF_(CONCAT(_DEF_LOCAL_SHELL_FLAGS, LOCAL_SHELL_FLAGS), `SHELL'), S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=LOCAL_SHELL_DIR, _OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')T=X-Unix/X-Unix/X-Unix,_PROG_QGRP A=LOCAL_SHELL_ARGS diff --git a/contrib/sendmail/cf/ostype/dragonfly.m4 b/contrib/sendmail/cf/ostype/dragonfly.m4 new file mode 100644 index 0000000..c1266af --- /dev/null +++ b/contrib/sendmail/cf/ostype/dragonfly.m4 @@ -0,0 +1,20 @@ +divert(-1) +# +# Copyright (c) 2001, 2004 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. +# +# + +divert(0) +VERSIONID(`$Id: dragonfly.m4,v 1.1 2004/08/06 03:54:05 gshapiro Exp $') +ifdef(`STATUS_FILE',, `define(`STATUS_FILE', `/var/log/sendmail.st')')dnl +dnl turn on S flag for local mailer +MODIFY_MAILER_FLAGS(`LOCAL', `+S')dnl +ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)')dnl +ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail $u')')dnl +ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', `/usr/local/bin/uux')')dnl +ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$g $h!rmail ($u)')')dnl diff --git a/contrib/sendmail/editmap/editmap.c b/contrib/sendmail/editmap/editmap.c index fe7c2d9..138ee30 100644 --- a/contrib/sendmail/editmap/editmap.c +++ b/contrib/sendmail/editmap/editmap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1992 Eric P. Allman. All rights reserved. * Copyright (c) 1992, 1993 @@ -22,7 +22,7 @@ SM_UNUSED(static char copyright[]) = #endif /* ! lint */ #ifndef lint -SM_UNUSED(static char id[]) = "@(#)$Id: editmap.c,v 1.23 2002/03/28 17:49:33 gshapiro Exp $"; +SM_UNUSED(static char id[]) = "@(#)$Id: editmap.c,v 1.24 2004/08/03 18:40:10 ca Exp $"; #endif /* ! lint */ @@ -57,6 +57,8 @@ BITMAP256 DontBlameSendmail; #define ISSEP(c) (isascii(c) && isspace(c)) +static void usage __P((char *)); + static void usage(progname) char *progname; diff --git a/contrib/sendmail/include/libmilter/mfapi.h b/contrib/sendmail/include/libmilter/mfapi.h index b226a1a..d4a02f9 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.59 2004/07/07 21:41:31 ca Exp $ + * $Id: mfapi.h,v 8.60 2004/08/20 21:24:14 ca Exp $ */ /* @@ -425,7 +425,6 @@ LIBMILTER_API int smfi_addrcpt __P((SMFICTX *, char *)); LIBMILTER_API int smfi_delrcpt __P((SMFICTX *, char *)); -#if _FFR_SMFI_PROGRESS /* ** Send a "no-op" up to the MTA to tell it we're still alive, so long ** milter-side operations don't time out. @@ -434,7 +433,6 @@ LIBMILTER_API int smfi_delrcpt __P((SMFICTX *, char *)); */ LIBMILTER_API int smfi_progress __P((SMFICTX *)); -#endif /* _FFR_SMFI_PROGRESS */ /* ** Delete a recipient from the envelope diff --git a/contrib/sendmail/include/sm/clock.h b/contrib/sendmail/include/sm/clock.h index b0dfb43..ba7fd68 100644 --- a/contrib/sendmail/include/sm/clock.h +++ b/contrib/sendmail/include/sm/clock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2001, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -9,7 +9,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Id: clock.h,v 1.11 2001/05/14 23:25:37 gshapiro Exp $ + * $Id: clock.h,v 1.12 2004/08/03 19:57:21 ca Exp $ */ /* @@ -52,9 +52,8 @@ typedef struct sm_event SM_EVENT; /* functions */ extern void sm_clrevent __P((SM_EVENT *)); extern void sm_clear_events __P((void)); -extern SM_EVENT *sm_setevent __P((time_t, void(*)(), int)); -extern SM_EVENT *sm_seteventm __P((int, void(*)(), int)); -extern SM_EVENT *sm_sigsafe_seteventm __P((int, void(*)(), int)); +extern SM_EVENT *sm_seteventm __P((int, void(*)__P((int)), int)); +extern SM_EVENT *sm_sigsafe_seteventm __P((int, void(*)__P((int)), int)); extern SIGFUNC_DECL sm_tick __P((int)); /* diff --git a/contrib/sendmail/include/sm/conf.h b/contrib/sendmail/include/sm/conf.h index 355d427..fa3801e 100644 --- a/contrib/sendmail/include/sm/conf.h +++ b/contrib/sendmail/include/sm/conf.h @@ -10,7 +10,7 @@ * the sendmail distribution. * * - * $Id: conf.h,v 1.116 2004/07/26 18:08:35 ca Exp $ + * $Id: conf.h,v 1.118 2004/08/20 20:30:32 ca Exp $ */ /* @@ -866,7 +866,7 @@ extern unsigned int sleepX __P((unsigned int seconds)); /* -** FreeBSD / NetBSD / OpenBSD (all architectures, all versions) +** DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions) ** ** 4.3BSD clone, closer to 4.4BSD for FreeBSD 1.x and NetBSD 0.9x ** 4.4BSD-Lite based for FreeBSD 2.x and NetBSD 1.x @@ -874,7 +874,7 @@ extern unsigned int sleepX __P((unsigned int seconds)); ** See also BSD defines. */ -# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +# if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # include <paths.h> # define HASUNSETENV 1 /* has unsetenv(3) call */ # define HASSETSID 1 /* has POSIX setsid(2) call */ @@ -919,6 +919,23 @@ extern unsigned int sleepX __P((unsigned int seconds)); # include <sys/param.h> # include <sys/sysctl.h> # endif +# if defined(__DragonFly__) +# define HASSETLOGIN 1 /* has setlogin(2) */ +# define HASSRANDOMDEV 1 /* has srandomdev(3) */ +# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ +# undef SPT_TYPE +# include <libutil.h> +# define SPT_TYPE SPT_BUILTIN +# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ +# ifndef SMRSH_CMDDIR +# define SMRSH_CMDDIR "/usr/libexec/sm.bin" +# endif /* ! SMRSH_CMDDIR */ +# ifndef SMRSH_PATH +# define SMRSH_PATH "/bin:/usr/bin" +# endif /* ! SMRSH_PATH */ +# define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ +# include <sys/sysctl.h> +# endif /* defined(__DragonFly__) */ # if defined(__FreeBSD__) # define HASSETLOGIN 1 /* has setlogin(2) */ # if __FreeBSD_version >= 227001 @@ -970,7 +987,7 @@ extern unsigned int sleepX __P((unsigned int seconds)); # define HASCLOSEFROM 1 /* closefrom(3) added in 3.5 */ # endif /* OpenBSD >= 200405 */ # endif /* defined(__OpenBSD__) */ -# endif /* defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ +# endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ /* @@ -2924,7 +2941,7 @@ struct sm_align long al_l; void *al_p; double al_d; - void (*al_f)(); + void (*al_f) __P((void)); } al_u; }; # define SM_ALIGN_SIZE offsetof(struct sm_align, al_u) diff --git a/contrib/sendmail/include/sm/config.h b/contrib/sendmail/include/sm/config.h index 3e4a912..5ebe548 100644 --- a/contrib/sendmail/include/sm/config.h +++ b/contrib/sendmail/include/sm/config.h @@ -6,7 +6,7 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * - * $Id: config.h,v 1.46 2003/12/10 03:19:06 gshapiro Exp $ + * $Id: config.h,v 1.47 2004/10/26 21:41:07 gshapiro Exp $ */ /* @@ -145,6 +145,7 @@ /* LDAP Checks */ # if LDAPMAP +# include <lber.h> # include <ldap.h> /* Does the LDAP library have ldap_memfree()? */ diff --git a/contrib/sendmail/include/sm/os/sm_os_dragonfly.h b/contrib/sendmail/include/sm/os/sm_os_dragonfly.h new file mode 100644 index 0000000..4428cab --- /dev/null +++ b/contrib/sendmail/include/sm/os/sm_os_dragonfly.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2000-2001, 2004 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. + * + * $Id: sm_os_dragonfly.h,v 1.1 2004/08/06 03:54:07 gshapiro Exp $ + */ + +/* +** Platform definitions for DragonFly BSD +*/ + +#define SM_OS_NAME "dragonfly" + +#define SM_CONF_SYS_CDEFS_H 1 + +#define MI_SOMAXCONN -1 /* listen() max backlog for milter */ + +#ifndef SM_CONF_STRL +# define SM_CONF_STRL 1 +#endif /* SM_CONF_STRL */ +#ifndef SM_CONF_SHM +# define SM_CONF_SHM 1 +#endif /* SM_CONF_SHM */ +#ifndef SM_CONF_SEM +# define SM_CONF_SEM 1 +#endif /* SM_CONF_SEM */ +#ifndef SM_CONF_MSG +# define SM_CONF_MSG 1 +#endif /* SM_CONF_MSG */ diff --git a/contrib/sendmail/libmilter/comm.c b/contrib/sendmail/libmilter/comm.c index 552e7e4..accb956 100644 --- a/contrib/sendmail/libmilter/comm.c +++ b/contrib/sendmail/libmilter/comm.c @@ -9,12 +9,13 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: comm.c,v 8.65 2004/07/07 21:41:30 ca Exp $") +SM_RCSID("@(#)$Id: comm.c,v 8.66 2004/08/20 20:38:35 ca Exp $") #include "libmilter.h" #include <sm/errstring.h> #include <sys/uio.h> +static ssize_t retry_writev __P((socket_t, struct iovec *, int, struct timeval *)); static size_t Maxdatasize = MILTER_MAX_DATA_SIZE; #if _FFR_MAXDATASIZE diff --git a/contrib/sendmail/libmilter/engine.c b/contrib/sendmail/libmilter/engine.c index 66ed992..eeeb2c5 100644 --- a/contrib/sendmail/libmilter/engine.c +++ b/contrib/sendmail/libmilter/engine.c @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: engine.c,v 8.119 2003/12/02 18:53:57 ca Exp $") +SM_RCSID("@(#)$Id: engine.c,v 8.120 2004/10/20 21:09:00 ca Exp $") #include "libmilter.h" @@ -347,6 +347,7 @@ mi_engine(ctx) ctx->ctx_state = curstate; } arg.a_idx = cmds[i].cm_macros; + call_abort = ST_IN_MAIL(curstate); /* call function to deal with command */ r = (*f)(&arg); @@ -361,7 +362,6 @@ mi_engine(ctx) break; } - call_abort = ST_IN_MAIL(curstate); if (r == SMFIS_ACCEPT) { /* accept mail, no further actions taken */ diff --git a/contrib/sendmail/libmilter/listener.c b/contrib/sendmail/libmilter/listener.c index ee88f23..adecc5a 100644 --- a/contrib/sendmail/libmilter/listener.c +++ b/contrib/sendmail/libmilter/listener.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2004 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: listener.c,v 8.109 2004/02/04 22:55:59 ca Exp $") +SM_RCSID("@(#)$Id: listener.c,v 8.111 2004/09/20 21:11:15 msk Exp $") /* ** listener.c -- threaded network listener @@ -32,6 +32,7 @@ static SOCKADDR_LEN_T L_socksize; static socket_t listenfd = INVALID_SOCKET; static socket_t mi_milteropen __P((char *, int, bool, char *)); +static void *mi_thread_handle_wrapper __P((void *)); /* ** MI_OPENSOCKET -- create the socket where this filter and the MTA will meet @@ -88,6 +89,7 @@ mi_opensocket(conn, backlog, dbg, rmsocket, smfi) return MI_FAILURE; } #endif /* !SM_CONF_POLL */ + (void) smutex_unlock(&L_Mutex); return MI_SUCCESS; } @@ -553,7 +555,7 @@ mi_milteropen(conn, backlog, rmsocket, name) ** results from mi_handle_session() */ -void * +static void * mi_thread_handle_wrapper(arg) void *arg; { @@ -722,7 +724,6 @@ mi_listener(conn, dbg, smfi, timeout, backlog) return MI_FAILURE; clilen = L_socksize; - (void) smutex_unlock(&L_Mutex); while ((mistop = mi_stop()) == MILTER_CONT) { (void) smutex_lock(&L_Mutex); diff --git a/contrib/sendmail/libmilter/signal.c b/contrib/sendmail/libmilter/signal.c index eed8b7c..d55ab57 100644 --- a/contrib/sendmail/libmilter/signal.c +++ b/contrib/sendmail/libmilter/signal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2004 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.41 2003/11/19 00:25:20 ca Exp $") +SM_RCSID("@(#)$Id: signal.c,v 8.42 2004/08/20 21:10:30 ca Exp $") #include "libmilter.h" @@ -21,6 +21,9 @@ static smutex_t M_Mutex; static int MilterStop = MILTER_CONT; +static void *mi_signal_thread __P((void *)); +static int mi_spawn_signal_thread __P((char *)); + /* ** MI_STOP -- return value of MilterStop ** diff --git a/contrib/sendmail/libmilter/sm_gethost.c b/contrib/sendmail/libmilter/sm_gethost.c index 1714741..5706b89 100644 --- a/contrib/sendmail/libmilter/sm_gethost.c +++ b/contrib/sendmail/libmilter/sm_gethost.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2001, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,12 +9,13 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: sm_gethost.c,v 8.26 2001/09/11 04:04:45 gshapiro Exp $") +SM_RCSID("@(#)$Id: sm_gethost.c,v 8.27 2004/08/20 21:12:37 ca Exp $") #include <sendmail.h> #if NETINET || NETINET6 # include <arpa/inet.h> #endif /* NETINET || NETINET6 */ +#include "libmilter.h" /* ** MI_GETHOSTBY{NAME,ADDR} -- compatibility routines for gethostbyXXX @@ -29,6 +30,8 @@ SM_RCSID("@(#)$Id: sm_gethost.c,v 8.26 2001/09/11 04:04:45 gshapiro Exp $") #if NETINET6 && NEEDSGETIPNODE +static struct hostent *getipnodebyname __P((char *, int, int, int *)); + # ifndef AI_ADDRCONFIG # define AI_ADDRCONFIG 0 /* dummy */ # endif /* ! AI_ADDRCONFIG */ diff --git a/contrib/sendmail/libmilter/smfi.c b/contrib/sendmail/libmilter/smfi.c index ead2c04..d5f54c9 100644 --- a/contrib/sendmail/libmilter/smfi.c +++ b/contrib/sendmail/libmilter/smfi.c @@ -9,11 +9,12 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: smfi.c,v 8.72 2004/05/05 00:07:21 msk Exp $") +SM_RCSID("@(#)$Id: smfi.c,v 8.73 2004/09/20 21:26:57 ca Exp $") #include <sm/varargs.h> #include "libmilter.h" static int smfi_header __P((SMFICTX *, int, int, char *, char *)); +static int myisenhsc __P((const char *, int)); /* for smfi_set{ml}reply, let's be generous. 256/16 should be sufficient */ #define MAXREPLYLEN 980 /* max. length of a reply string */ diff --git a/contrib/sendmail/libsm/Makefile.m4 b/contrib/sendmail/libsm/Makefile.m4 index f028c24..8896a1e 100644 --- a/contrib/sendmail/libsm/Makefile.m4 +++ b/contrib/sendmail/libsm/Makefile.m4 @@ -1,11 +1,11 @@ -dnl $Id: Makefile.m4,v 1.66 2003/11/03 18:28:26 ca Exp $ +dnl $Id: Makefile.m4,v 1.67 2004/08/20 20:42:14 ca Exp $ define(`confREQUIRE_LIBUNIX') include(confBUILDTOOLSDIR`/M4/switch.m4') define(`confREQUIRE_LIBSM', `true') PREPENDDEF(`confENVDEF', `confMAPDEF') bldPRODUCT_START(`library', `libsm') -define(`bldSOURCES', ` assert.c debug.c errstring.c exc.c heap.c match.c rpool.c strdup.c strerror.c strl.c clrerr.c fclose.c feof.c ferror.c fflush.c fget.c fpos.c findfp.c flags.c fopen.c fprintf.c fpurge.c fput.c fread.c fscanf.c fseek.c fvwrite.c fwalk.c fwrite.c get.c makebuf.c put.c refill.c rewind.c setvbuf.c smstdio.c snprintf.c sscanf.c stdio.c strio.c ungetc.c vasprintf.c vfprintf.c vfscanf.c vprintf.c vsnprintf.c vsscanf.c wbuf.c wsetup.c string.c stringf.c xtrap.c strto.c test.c path.c strcasecmp.c strrevcmp.c signal.c clock.c config.c shm.c mbdb.c strexit.c cf.c ldap.c niprop.c mpeix.c ') +define(`bldSOURCES', ` assert.c debug.c errstring.c exc.c heap.c match.c rpool.c strdup.c strerror.c strl.c clrerr.c fclose.c feof.c ferror.c fflush.c fget.c fpos.c findfp.c flags.c fopen.c fprintf.c fpurge.c fput.c fread.c fscanf.c fseek.c fvwrite.c fwalk.c fwrite.c get.c makebuf.c put.c refill.c rewind.c setvbuf.c smstdio.c snprintf.c sscanf.c stdio.c strio.c ungetc.c vasprintf.c vfprintf.c vfscanf.c vprintf.c vsnprintf.c wbuf.c wsetup.c string.c stringf.c xtrap.c strto.c test.c path.c strcasecmp.c strrevcmp.c signal.c clock.c config.c shm.c mbdb.c strexit.c cf.c ldap.c niprop.c mpeix.c ') bldPRODUCT_END dnl sem.c msg.c dnl syslogio.c diff --git a/contrib/sendmail/libsm/b-strcmp.c b/contrib/sendmail/libsm/b-strcmp.c index a713bc6..e6d0bb0 100644 --- a/contrib/sendmail/libsm/b-strcmp.c +++ b/contrib/sendmail/libsm/b-strcmp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2004 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: b-strcmp.c,v 1.12 2001/09/11 04:04:47 gshapiro Exp $") +SM_RCSID("@(#)$Id: b-strcmp.c,v 1.13 2004/08/03 20:07:59 ca Exp $") #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -21,6 +21,10 @@ SM_RCSID("@(#)$Id: b-strcmp.c,v 1.12 2001/09/11 04:04:47 gshapiro Exp $") #define LOOPS 4000000L /* initial number of loops */ #define MAXTIME 30L /* "maximum" time to run single test */ +void fatal __P((char *)); +void purpose __P((void)); +int main __P((int, char *[])); + void fatal(str) char *str; diff --git a/contrib/sendmail/libsm/clock.c b/contrib/sendmail/libsm/clock.c index 5805554..c09b2d1 100644 --- a/contrib/sendmail/libsm/clock.c +++ b/contrib/sendmail/libsm/clock.c @@ -12,7 +12,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: clock.c,v 1.45 2004/01/19 19:32:08 ca Exp $") +SM_RCSID("@(#)$Id: clock.c,v 1.46 2004/08/03 19:57:22 ca Exp $") #include <unistd.h> #include <time.h> #include <errno.h> @@ -63,7 +63,7 @@ static SM_EVENT *volatile SmFreeEventList; /* list of free events */ SM_EVENT * sm_seteventm(intvl, func, arg) int intvl; - void (*func)(); + void (*func)__P((int)); int arg; { ENTER_CRITICAL(); @@ -86,7 +86,7 @@ sm_seteventm(intvl, func, arg) SM_EVENT * sm_sigsafe_seteventm(intvl, func, arg) int intvl; - void (*func)(); + void (*func)__P((int)); int arg; { register SM_EVENT **evp; @@ -394,7 +394,7 @@ sm_tick(sig) #endif /* SM_CONF_SETITIMER */ )) { - void (*f)(); + void (*f)__P((int)); int arg; pid_t pid; @@ -497,7 +497,7 @@ sm_tick(sig) # if !HAVE_NANOSLEEP -static void sm_endsleep __P((void)); +static void sm_endsleep __P((int)); static bool volatile SmSleepDone; # endif /* !HAVE_NANOSLEEP */ @@ -625,7 +625,8 @@ sleep(intvl) #if !HAVE_NANOSLEEP static void -sm_endsleep() +sm_endsleep(ignore) + int ignore; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD diff --git a/contrib/sendmail/libsm/debug.c b/contrib/sendmail/libsm/debug.c index a6582ae..f9281fd 100644 --- a/contrib/sendmail/libsm/debug.c +++ b/contrib/sendmail/libsm/debug.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, 2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000, 2001, 2003, 2004 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: debug.c,v 1.29 2003/01/10 00:26:06 ca Exp $") +SM_RCSID("@(#)$Id: debug.c,v 1.30 2004/08/03 20:10:26 ca Exp $") /* ** libsm debugging and tracing @@ -26,6 +26,9 @@ SM_RCSID("@(#)$Id: debug.c,v 1.29 2003/01/10 00:26:06 ca Exp $") #include <sm/varargs.h> #include <sm/heap.h> +static void sm_debug_reset __P((void)); +static const char *parse_named_setting_x __P((const char *)); + /* ** Abstractions for printing trace messages. */ @@ -187,7 +190,7 @@ const char SmDebugMagic[] = "sm_debug"; ** none. */ -void +static void sm_debug_reset() { SM_DEBUG_T *debug; @@ -254,7 +257,7 @@ sm_debug_addsetting_x(pattern, level) static const char * parse_named_setting_x(s) - register const char *s; + const char *s; { const char *pat, *endpat; int level; @@ -315,7 +318,7 @@ parse_named_setting_x(s) void sm_debug_addsettings_x(s) - register const char *s; + const char *s; { for (;;) { diff --git a/contrib/sendmail/libsm/fclose.c b/contrib/sendmail/libsm/fclose.c index 2de1413..1a469fb 100644 --- a/contrib/sendmail/libsm/fclose.c +++ b/contrib/sendmail/libsm/fclose.c @@ -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. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: fclose.c,v 1.42 2002/02/01 02:28:00 ca Exp $") +SM_RCSID("@(#)$Id: fclose.c,v 1.43 2004/08/03 20:17:38 ca Exp $") #include <errno.h> #include <stdlib.h> #include <sys/time.h> @@ -26,6 +26,7 @@ SM_RCSID("@(#)$Id: fclose.c,v 1.42 2002/02/01 02:28:00 ca Exp $") #include <sm/clock.h> #include "local.h" +static void closealrm __P((int)); static jmp_buf CloseTimeOut; /* diff --git a/contrib/sendmail/libsm/fopen.c b/contrib/sendmail/libsm/fopen.c index a2fae9d..1737998 100644 --- a/contrib/sendmail/libsm/fopen.c +++ b/contrib/sendmail/libsm/fopen.c @@ -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. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: fopen.c,v 1.60 2002/01/07 21:41:35 ca Exp $") +SM_RCSID("@(#)$Id: fopen.c,v 1.61 2004/08/03 20:17:38 ca Exp $") #include <errno.h> #include <setjmp.h> #include <sys/time.h> @@ -24,6 +24,8 @@ SM_RCSID("@(#)$Id: fopen.c,v 1.60 2002/01/07 21:41:35 ca Exp $") #include <sm/clock.h> #include "local.h" +static void openalrm __P((int)); +static void reopenalrm __P((int)); extern int sm_io_fclose __P((SM_FILE_T *)); static jmp_buf OpenTimeOut, ReopenTimeOut; diff --git a/contrib/sendmail/libsm/fpos.c b/contrib/sendmail/libsm/fpos.c index a8083fd..f75496a 100644 --- a/contrib/sendmail/libsm/fpos.c +++ b/contrib/sendmail/libsm/fpos.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: fpos.c,v 1.37 2001/09/11 04:04:48 gshapiro Exp $") +SM_RCSID("@(#)$Id: fpos.c,v 1.38 2004/08/03 20:17:38 ca Exp $") #include <errno.h> #include <setjmp.h> #include <sys/time.h> @@ -24,6 +24,7 @@ SM_RCSID("@(#)$Id: fpos.c,v 1.37 2001/09/11 04:04:48 gshapiro Exp $") #include <sm/assert.h> #include "local.h" +static void tellalrm __P((int)); static jmp_buf TellTimeOut; /* diff --git a/contrib/sendmail/libsm/fseek.c b/contrib/sendmail/libsm/fseek.c index 6985e0d..e85d41a 100644 --- a/contrib/sendmail/libsm/fseek.c +++ b/contrib/sendmail/libsm/fseek.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: fseek.c,v 1.45 2001/09/11 04:04:48 gshapiro Exp $") +SM_RCSID("@(#)$Id: fseek.c,v 1.46 2004/08/03 20:17:38 ca Exp $") #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -29,6 +29,7 @@ SM_RCSID("@(#)$Id: fseek.c,v 1.45 2001/09/11 04:04:48 gshapiro Exp $") #define POS_ERR (-(off_t)1) +static void seekalrm __P((int)); static jmp_buf SeekTimeOut; /* diff --git a/contrib/sendmail/libsm/heap.c b/contrib/sendmail/libsm/heap.c index 50bb631..8ee4396 100644 --- a/contrib/sendmail/libsm/heap.c +++ b/contrib/sendmail/libsm/heap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2004 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: heap.c,v 1.50 2001/09/11 04:04:48 gshapiro Exp $") +SM_RCSID("@(#)$Id: heap.c,v 1.51 2004/08/03 20:32:00 ca Exp $") /* ** debugging memory allocation package @@ -43,6 +43,7 @@ SM_RCSID("@(#)$Id: heap.c,v 1.50 2001/09/11 04:04:48 gshapiro Exp $") SM_DEBUG_T SmHeapCheck = SM_DEBUG_INITIALIZER("sm_check_heap", "@(#)$Debug: sm_check_heap - check sm_malloc, sm_realloc, sm_free calls $"); # define HEAP_CHECK sm_debug_active(&SmHeapCheck, 1) +static int ptrhash __P((void *p)); #endif /* SM_HEAP_CHECK */ const SM_EXC_TYPE_T SmHeapOutOfMemoryType = diff --git a/contrib/sendmail/libsm/ldap.c b/contrib/sendmail/libsm/ldap.c index 570c3cdb..5e6557d 100644 --- a/contrib/sendmail/libsm/ldap.c +++ b/contrib/sendmail/libsm/ldap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 2001-2004 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.59 2003/12/23 21:20:15 gshapiro Exp $") +SM_RCSID("@(#)$Id: ldap.c,v 1.60 2004/08/03 20:42:21 ca Exp $") #if LDAPMAP # include <sys/types.h> @@ -33,6 +33,8 @@ SM_DEBUG_T SmLDAPTrace = SM_DEBUG_INITIALIZER("sm_trace_ldap", "@(#)$Debug: sm_trace_ldap - trace LDAP operations $"); static void ldaptimeout __P((int)); +static bool sm_ldap_has_objectclass __P((SM_LDAP_STRUCT *, LDAPMessage *, char *)); +static SM_LDAP_RECURSE_ENTRY *sm_ldap_add_recurse __P((SM_LDAP_RECURSE_LIST **, char *, int, SM_RPOOL_T *)); /* ** SM_LDAP_CLEAR -- set default values for SM_LDAP_STRUCT @@ -126,7 +128,7 @@ sm_ldap_start(name, lmap) SM_LDAP_STRUCT *lmap; { int bind_result; - int save_errno; + int save_errno = 0; char *id; SM_EVENT *ev = NULL; LDAP *ld = NULL; diff --git a/contrib/sendmail/libsm/rpool.c b/contrib/sendmail/libsm/rpool.c index 57c0393..39344c2 100644 --- a/contrib/sendmail/libsm/rpool.c +++ b/contrib/sendmail/libsm/rpool.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2004 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: rpool.c,v 1.27 2003/10/09 17:49:47 ca Exp $") +SM_RCSID("@(#)$Id: rpool.c,v 1.28 2004/08/03 20:44:04 ca Exp $") /* ** resource pools @@ -32,6 +32,9 @@ typedef union char align[SM_ALIGN_SIZE]; } SM_POOLHDR_T; +static char *sm_rpool_allocblock_x __P((SM_RPOOL_T *, size_t)); +static char *sm_rpool_allocblock __P((SM_RPOOL_T *, size_t)); + /* ** Tune this later */ diff --git a/contrib/sendmail/libsm/smstdio.c b/contrib/sendmail/libsm/smstdio.c index e8637c1..27552e5 100644 --- a/contrib/sendmail/libsm/smstdio.c +++ b/contrib/sendmail/libsm/smstdio.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_IDSTR(id, "@(#)$Id: smstdio.c,v 1.33 2004/03/03 19:14:51 ca Exp $") +SM_IDSTR(id, "@(#)$Id: smstdio.c,v 1.34 2004/08/03 20:46:34 ca Exp $") #include <unistd.h> #include <stdio.h> #include <fcntl.h> @@ -19,6 +19,8 @@ SM_IDSTR(id, "@(#)$Id: smstdio.c,v 1.33 2004/03/03 19:14:51 ca Exp $") #include <sm/string.h> #include "local.h" +static void setup __P((SM_FILE_T *)); + /* ** Overall: ** This is a file type which implements a layer on top of the system diff --git a/contrib/sendmail/libsm/stdio.c b/contrib/sendmail/libsm/stdio.c index 0df98ab..345a62c 100644 --- a/contrib/sendmail/libsm/stdio.c +++ b/contrib/sendmail/libsm/stdio.c @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: stdio.c,v 1.68 2004/03/03 19:20:29 ca Exp $") +SM_RCSID("@(#)$Id: stdio.c,v 1.69 2004/08/03 20:46:34 ca Exp $") #include <unistd.h> #include <errno.h> #include <fcntl.h> @@ -29,6 +29,9 @@ SM_RCSID("@(#)$Id: stdio.c,v 1.68 2004/03/03 19:20:29 ca Exp $") #include <sm/fdset.h> #include "local.h" +static int sm_stdsetmode __P((SM_FILE_T *, const int *)); +static int sm_stdgetmode __P((SM_FILE_T *, int *)); + /* ** Overall: ** Small standard I/O/seek/close functions. @@ -260,7 +263,7 @@ sm_stdsetmode(fp, mode) ** Success: external mode value */ -int +static int sm_stdgetmode(fp, mode) SM_FILE_T *fp; int *mode; diff --git a/contrib/sendmail/libsm/strio.c b/contrib/sendmail/libsm/strio.c index 2b7e9d0..9f1f4af 100644 --- a/contrib/sendmail/libsm/strio.c +++ b/contrib/sendmail/libsm/strio.c @@ -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. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_IDSTR(id, "@(#)$Id: strio.c,v 1.42 2002/02/11 23:05:50 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: strio.c,v 1.43 2004/08/03 20:48:30 ca Exp $") #include <stdlib.h> #include <unistd.h> #include <fcntl.h> @@ -25,6 +25,9 @@ SM_IDSTR(id, "@(#)$Id: strio.c,v 1.42 2002/02/11 23:05:50 gshapiro Exp $") #include <sm/conf.h> #include "local.h" +static int sm_strsetmode __P((SM_FILE_T*, const int *)); +static int sm_strgetmode __P((SM_FILE_T*, int *)); + /* ** Cookie structure for the "strio" file type */ @@ -313,7 +316,7 @@ sm_strclose(fp) ** Failure: -1 and sets errno */ -int +static int sm_strsetmode(fp, mode) SM_FILE_T *fp; const int *mode; diff --git a/contrib/sendmail/libsm/t-event.c b/contrib/sendmail/libsm/t-event.c index 6073776..c6eb82e 100644 --- a/contrib/sendmail/libsm/t-event.c +++ b/contrib/sendmail/libsm/t-event.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 2001-2002, 2004 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: t-event.c,v 1.11 2002/04/25 01:50:25 ca Exp $") +SM_RCSID("@(#)$Id: t-event.c,v 1.12 2004/08/03 20:50:32 ca Exp $") #include <stdio.h> @@ -22,9 +22,12 @@ SM_RCSID("@(#)$Id: t-event.c,v 1.11 2002/04/25 01:50:25 ca Exp $") #include <sm/clock.h> #include <sm/test.h> -int check; +static void evcheck __P((int)); +static void ev1 __P((int)); -void +static int check; + +static void evcheck(arg) int arg; { @@ -33,7 +36,7 @@ evcheck(arg) check++; } -void +static void ev1(arg) int arg; { diff --git a/contrib/sendmail/libsm/t-shm.c b/contrib/sendmail/libsm/t-shm.c index b20040a..16ea131 100644 --- a/contrib/sendmail/libsm/t-shm.c +++ b/contrib/sendmail/libsm/t-shm.c @@ -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. * * By using this file, you agree to the terms and conditions set @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: t-shm.c,v 1.19 2004/04/20 23:14:21 ca Exp $") +SM_RCSID("@(#)$Id: t-shm.c,v 1.20 2004/08/03 20:51:36 ca Exp $") #include <stdio.h> @@ -145,6 +145,8 @@ shmbig(owner, size) # define MAX_CNT 10 +int shmtest __P((int)); + int shmtest(owner) int owner; diff --git a/contrib/sendmail/libsm/ungetc.c b/contrib/sendmail/libsm/ungetc.c index 7794af0..289c7be 100644 --- a/contrib/sendmail/libsm/ungetc.c +++ b/contrib/sendmail/libsm/ungetc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_IDSTR(id, "@(#)$Id: ungetc.c,v 1.28 2001/09/11 04:04:49 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: ungetc.c,v 1.29 2004/08/03 20:54:49 ca Exp $") #include <stdlib.h> #include <string.h> @@ -26,6 +26,8 @@ SM_IDSTR(id, "@(#)$Id: ungetc.c,v 1.28 2001/09/11 04:04:49 gshapiro Exp $") #include <sm/conf.h> #include "local.h" +static void sm_submore_x __P((SM_FILE_T *)); + /* ** SM_SUBMORE_X -- expand ungetc buffer ** @@ -46,7 +48,7 @@ SM_IDSTR(id, "@(#)$Id: ungetc.c,v 1.28 2001/09/11 04:04:49 gshapiro Exp $") static void sm_submore_x(fp) - register SM_FILE_T *fp; + SM_FILE_T *fp; { register int i; register unsigned char *p; diff --git a/contrib/sendmail/libsm/vfprintf.c b/contrib/sendmail/libsm/vfprintf.c index e2115bd..e77c335 100644 --- a/contrib/sendmail/libsm/vfprintf.c +++ b/contrib/sendmail/libsm/vfprintf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990 * The Regents of the University of California. All rights reserved. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_IDSTR(id, "@(#)$Id: vfprintf.c,v 1.52 2001/09/11 04:04:49 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: vfprintf.c,v 1.53 2004/08/03 20:54:49 ca Exp $") /* ** Overall: @@ -33,6 +33,7 @@ SM_IDSTR(id, "@(#)$Id: vfprintf.c,v 1.52 2001/09/11 04:04:49 gshapiro Exp $") #include "local.h" #include "fvwrite.h" +static int sm_bprintf __P((SM_FILE_T *, const char *, va_list)); static void sm_find_arguments __P((const char *, va_list , va_list **)); static void sm_grow_type_table_x __P((unsigned char **, int *)); static int sm_print __P((SM_FILE_T *, int, struct sm_uio *)); @@ -95,7 +96,7 @@ sm_print(fp, timeout, uio) static int sm_bprintf(fp, fmt, ap) - register SM_FILE_T *fp; + SM_FILE_T *fp; const char *fmt; SM_VA_LOCAL_DECL { diff --git a/contrib/sendmail/libsm/vfscanf.c b/contrib/sendmail/libsm/vfscanf.c index 5a19733..d7f1a3d 100644 --- a/contrib/sendmail/libsm/vfscanf.c +++ b/contrib/sendmail/libsm/vfscanf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2001, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_IDSTR(id, "@(#)$Id: vfscanf.c,v 1.51 2001/09/11 04:04:49 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: vfscanf.c,v 1.52 2004/08/03 20:56:32 ca Exp $") #include <ctype.h> #include <stdlib.h> @@ -60,8 +60,9 @@ SM_IDSTR(id, "@(#)$Id: vfscanf.c,v 1.51 2001/09/11 04:04:49 gshapiro Exp $") #define CT_INT 3 /* integer, i.e., strtoll or strtoull */ #define CT_FLOAT 4 /* floating, i.e., strtod */ -static unsigned char *sm_sccl __P((char *, unsigned char *)); -static jmp_buf ScanTimeOut; +static void scanalrm __P((int)); +static unsigned char *sm_sccl __P((char *, unsigned char *)); +static jmp_buf ScanTimeOut; /* ** SCANALRM -- handler when timeout activated for sm_io_vfscanf() diff --git a/contrib/sendmail/libsmdb/smdb.c b/contrib/sendmail/libsmdb/smdb.c index ad0b926..6eb4033 100644 --- a/contrib/sendmail/libsmdb/smdb.c +++ b/contrib/sendmail/libsmdb/smdb.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: smdb.c,v 8.57 2002/05/24 23:09:11 gshapiro Exp $") +SM_RCSID("@(#)$Id: smdb.c,v 8.58 2004/08/03 20:58:38 ca Exp $") #include <fcntl.h> #include <stdlib.h> @@ -18,6 +18,8 @@ SM_RCSID("@(#)$Id: smdb.c,v 8.57 2002/05/24 23:09:11 gshapiro Exp $") #include <sendmail/sendmail.h> #include <libsmdb/smdb.h> +static bool smdb_lockfile __P((int, int)); + /* ** SMDB_MALLOC_DATABASE -- Allocates a database structure. ** diff --git a/contrib/sendmail/libsmdb/smdb1.c b/contrib/sendmail/libsmdb/smdb1.c index a971e5e..e45de7c 100644 --- a/contrib/sendmail/libsmdb/smdb1.c +++ b/contrib/sendmail/libsmdb/smdb1.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: smdb1.c,v 8.58 2002/05/24 23:09:11 gshapiro Exp $") +SM_RCSID("@(#)$Id: smdb1.c,v 8.59 2004/08/03 20:58:39 ca Exp $") #include <unistd.h> #include <stdlib.h> @@ -35,6 +35,24 @@ struct smdb_db1_cursor }; typedef struct smdb_db1_cursor SMDB_DB1_CURSOR; +static DBTYPE smdb_type_to_db1_type __P((SMDB_DBTYPE)); +static unsigned int smdb_put_flags_to_db1_flags __P((SMDB_FLAG)); +static int smdb_cursor_get_flags_to_smdb1 __P((SMDB_FLAG)); +static SMDB_DB1_DATABASE *smdb1_malloc_database __P((void)); +static int smdb1_close __P((SMDB_DATABASE *)); +static int smdb1_del __P((SMDB_DATABASE *, SMDB_DBENT *, unsigned int)); +static int smdb1_fd __P((SMDB_DATABASE *, int *)); +static int smdb1_lockfd __P((SMDB_DATABASE *)); +static int smdb1_get __P((SMDB_DATABASE *, SMDB_DBENT *, SMDB_DBENT *, unsigned int)); +static int smdb1_put __P((SMDB_DATABASE *, SMDB_DBENT *, SMDB_DBENT *, unsigned int)); +static int smdb1_set_owner __P((SMDB_DATABASE *, uid_t, gid_t)); +static int smdb1_sync __P((SMDB_DATABASE *, unsigned int)); +static int smdb1_cursor_close __P((SMDB_CURSOR *)); +static int smdb1_cursor_del __P((SMDB_CURSOR *, unsigned int)); +static int smdb1_cursor_get __P((SMDB_CURSOR *, SMDB_DBENT *, SMDB_DBENT *, SMDB_FLAG)); +static int smdb1_cursor_put __P((SMDB_CURSOR *, SMDB_DBENT *, SMDB_DBENT *, SMDB_FLAG)); +static int smdb1_cursor __P((SMDB_DATABASE *, SMDB_CURSOR **, unsigned int)); + /* ** SMDB_TYPE_TO_DB1_TYPE -- Translates smdb database type to db1 type. ** @@ -47,7 +65,7 @@ typedef struct smdb_db1_cursor SMDB_DB1_CURSOR; ** */ -DBTYPE +static DBTYPE smdb_type_to_db1_type(type) SMDB_DBTYPE type; { @@ -77,7 +95,7 @@ smdb_type_to_db1_type(type) ** */ -unsigned int +static unsigned int smdb_put_flags_to_db1_flags(flags) SMDB_FLAG flags; { @@ -104,7 +122,7 @@ smdb_put_flags_to_db1_flags(flags) ** */ -int +static int smdb_cursor_get_flags_to_smdb1(flags) SMDB_FLAG flags; { @@ -131,7 +149,7 @@ smdb_cursor_get_flags_to_smdb1(flags) ** The rest of these functions correspond to the interface laid out in smdb.h. */ -SMDB_DB1_DATABASE * +static SMDB_DB1_DATABASE * smdb1_malloc_database() { SMDB_DB1_DATABASE *db1; @@ -147,7 +165,7 @@ smdb1_malloc_database() return db1; } -int +static int smdb1_close(database) SMDB_DATABASE *database; { @@ -165,7 +183,7 @@ smdb1_close(database) return result; } -int +static int smdb1_del(database, key, flags) SMDB_DATABASE *database; SMDB_DBENT *key; @@ -180,7 +198,7 @@ smdb1_del(database, key, flags) return db->del(db, &dbkey, flags); } -int +static int smdb1_fd(database, fd) SMDB_DATABASE *database; int *fd; @@ -194,7 +212,7 @@ smdb1_fd(database, fd) return SMDBE_OK; } -int +static int smdb1_lockfd(database) SMDB_DATABASE *database; { @@ -204,7 +222,7 @@ smdb1_lockfd(database) } -int +static int smdb1_get(database, key, data, flags) SMDB_DATABASE *database; SMDB_DBENT *key; @@ -232,7 +250,7 @@ smdb1_get(database, key, data, flags) return SMDBE_OK; } -int +static int smdb1_put(database, key, data, flags) SMDB_DATABASE *database; SMDB_DBENT *key; @@ -253,7 +271,7 @@ smdb1_put(database, key, data, flags) smdb_put_flags_to_db1_flags(flags)); } -int +static int smdb1_set_owner(database, uid, gid) SMDB_DATABASE *database; uid_t uid; @@ -276,7 +294,7 @@ smdb1_set_owner(database, uid, gid) return SMDBE_OK; } -int +static int smdb1_sync(database, flags) SMDB_DATABASE *database; unsigned int flags; @@ -286,7 +304,7 @@ smdb1_sync(database, flags) return db->sync(db, flags); } -int +static int smdb1_cursor_close(cursor) SMDB_CURSOR *cursor; { @@ -302,7 +320,7 @@ smdb1_cursor_close(cursor) return SMDBE_OK; } -int +static int smdb1_cursor_del(cursor, flags) SMDB_CURSOR *cursor; unsigned int flags; @@ -314,7 +332,7 @@ smdb1_cursor_del(cursor, flags) return db->del(db, NULL, R_CURSOR); } -int +static int smdb1_cursor_get(cursor, key, value, flags) SMDB_CURSOR *cursor; SMDB_DBENT *key; @@ -344,7 +362,7 @@ smdb1_cursor_get(cursor, key, value, flags) return SMDBE_OK; } -int +static int smdb1_cursor_put(cursor, key, value, flags) SMDB_CURSOR *cursor; SMDB_DBENT *key; @@ -366,7 +384,7 @@ smdb1_cursor_put(cursor, key, value, flags) return db->put(db, &dbkey, &dbdata, R_CURSOR); } -int +static int smdb1_cursor(database, cursor, flags) SMDB_DATABASE *database; SMDB_CURSOR **cursor; diff --git a/contrib/sendmail/libsmutil/safefile.c b/contrib/sendmail/libsmutil/safefile.c index c6cfb53..8488534 100644 --- a/contrib/sendmail/libsmutil/safefile.c +++ b/contrib/sendmail/libsmutil/safefile.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002 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 @@ -15,7 +15,7 @@ #include <sm/io.h> #include <sm/errstring.h> -SM_RCSID("@(#)$Id: safefile.c,v 8.127 2004/05/27 22:37:51 msk Exp $") +SM_RCSID("@(#)$Id: safefile.c,v 8.128 2004/09/30 18:15:49 ca Exp $") /* @@ -489,6 +489,7 @@ safedirpath(fn, uid, gid, user, flags, level, offset) int linklen; char *target; char buf[MAXPATHLEN]; + char fullbuf[MAXLINKPATHLEN]; memset(buf, '\0', sizeof buf); linklen = readlink(s, buf, sizeof buf); @@ -544,7 +545,6 @@ safedirpath(fn, uid, gid, user, flags, level, offset) else { char *sptr; - char fullbuf[MAXLINKPATHLEN]; sptr = strrchr(s, '/'); if (sptr != NULL) diff --git a/contrib/sendmail/mail.local/Makefile.m4 b/contrib/sendmail/mail.local/Makefile.m4 index 3a06a3b..c9af26f 100644 --- a/contrib/sendmail/mail.local/Makefile.m4 +++ b/contrib/sendmail/mail.local/Makefile.m4 @@ -1,4 +1,4 @@ -dnl $Id: Makefile.m4,v 8.50 2002/06/21 22:01:39 ca Exp $ +dnl $Id: Makefile.m4,v 8.51 2004/11/18 22:29:52 ca Exp $ include(confBUILDTOOLSDIR`/M4/switch.m4') define(`confREQUIRE_LIBSM', `true') @@ -8,6 +8,7 @@ PREPENDDEF(`confENVDEF', `confMAPDEF') PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ') bldPRODUCT_START(`executable', `mail.local') +define(`bldINSTALL_DIR', `E') define(`bldNO_INSTALL', `true') define(`bldSOURCES', `mail.local.c ') bldPUSH_SMLIB(`sm') diff --git a/contrib/sendmail/mail.local/mail.local.c b/contrib/sendmail/mail.local/mail.local.c index 7230584..0da5e7d 100644 --- a/contrib/sendmail/mail.local/mail.local.c +++ b/contrib/sendmail/mail.local/mail.local.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) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -13,12 +13,12 @@ #include <sm/gen.h> SM_IDSTR(copyright, -"@(#) Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.\n\ +"@(#) Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.\n\ All rights reserved.\n\ Copyright (c) 1990, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Id: mail.local.c,v 8.251 2003/11/03 18:38:29 ca Exp $") +SM_IDSTR(id, "@(#)$Id: mail.local.c,v 8.253 2004/11/01 20:42:42 ca Exp $") #include <stdlib.h> #include <sm/errstring.h> @@ -144,6 +144,7 @@ int ExitVal = EX_OK; /* sysexits.h error value. */ bool HoldErrs = false; /* Hold errors in ErrBuf */ bool LMTPMode = false; bool BounceQuota = false; /* permanent error when over quota */ +bool CloseMBDB = false; char *HomeMailFile = NULL; /* store mail in homedir */ #if HASHSPOOL @@ -155,6 +156,9 @@ bool StripRcptDomain = true; #endif /* HASHSPOOL */ char SpoolPath[MAXPATHLEN]; +char *parseaddr __P((char *, bool)); +char *process_recipient __P((char *)); +void dolmtp __P((void)); void deliver __P((int, char *)); int e_to_sys __P((int)); void notifybiff __P((char *)); @@ -169,6 +173,18 @@ const char *hashname __P((char *)); #endif /* HASHSPOOL */ +static void +sm_exit(status) + int status; +{ + if (CloseMBDB) + { + sm_mbdb_terminate(); + CloseMBDB = false; /* not really necessary, but ... */ + } + exit(status); +} + int main(argc, argv) int argc; @@ -198,11 +214,13 @@ main(argc, argv) # endif /* LOG_MAIL */ from = NULL; + + /* XXX can this be converted to a compile time check? */ if (sm_strlcpy(SpoolPath, _PATH_MAILDIR, sizeof(SpoolPath)) >= sizeof(SpoolPath)) { mailerr("421", "Configuration error: _PATH_MAILDIR too large"); - exit(EX_CONFIG); + sm_exit(EX_CONFIG); } #if HASHSPOOL while ((ch = getopt(argc, argv, "7bdD:f:h:r:lH:p:n")) != -1) @@ -328,22 +346,21 @@ main(argc, argv) mailerr(errcode, "Can not open mailbox database %s: %s", mbdbname, sm_strexit(err)); - exit(err); + sm_exit(err); } + CloseMBDB = true; if (LMTPMode) { - extern void dolmtp __P((void)); - if (argc > 0) { mailerr("421", "Users should not be specified in command line if LMTP required"); - exit(EX_TEMPFAIL); + sm_exit(EX_TEMPFAIL); } dolmtp(); /* NOTREACHED */ - exit(EX_OK); + sm_exit(EX_OK); } /* Non-LMTP from here on out */ @@ -378,11 +395,11 @@ main(argc, argv) if (fd < 0) { flush_error(); - exit(ExitVal); + sm_exit(ExitVal); } for (; *argv != NULL; ++argv) deliver(fd, *argv); - exit(ExitVal); + sm_exit(ExitVal); /* NOTREACHED */ return ExitVal; } @@ -472,7 +489,7 @@ parseaddr(s, rcpt) if (p == NULL) { mailerr("421 4.3.0", "Memory exhausted"); - exit(EX_TEMPFAIL); + sm_exit(EX_TEMPFAIL); } (void) sm_strlcpy(p, s, l); @@ -528,7 +545,7 @@ dolmtp() { (void) fflush(stdout); if (fgets(buf, sizeof(buf) - 1, stdin) == NULL) - exit(EX_OK); + sm_exit(EX_OK); p = buf + strlen(buf) - 1; if (p >= buf && *p == '\n') *p-- = '\0'; @@ -642,7 +659,7 @@ dolmtp() if (sm_strcasecmp(buf, "quit") == 0) { printf("221 2.0.0 Bye\r\n"); - exit(EX_OK); + sm_exit(EX_OK); } goto syntaxerr; /* NOTREACHED */ @@ -669,7 +686,7 @@ dolmtp() { mailerr("421 4.3.0", "Memory exhausted"); - exit(EX_TEMPFAIL); + sm_exit(EX_TEMPFAIL); } } if (sm_strncasecmp(buf + 5, "to:", 3) != 0 || @@ -888,7 +905,7 @@ store(from, inbody) if (LMTPMode) { /* Got a premature EOF -- toss message and exit */ - exit(EX_OK); + sm_exit(EX_OK); } /* If message not newline terminated, need an extra. */ @@ -1548,7 +1565,7 @@ usage() { ExitVal = EX_USAGE; mailerr(NULL, "usage: mail.local [-7] [-b] [-d] [-l] [-f from|-r from] [-h filename] user ..."); - exit(ExitVal); + sm_exit(ExitVal); } void diff --git a/contrib/sendmail/makemap/makemap.c b/contrib/sendmail/makemap/makemap.c index bf3d282..344d5b9 100644 --- a/contrib/sendmail/makemap/makemap.c +++ b/contrib/sendmail/makemap/makemap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002, 2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1992 Eric P. Allman. All rights reserved. * Copyright (c) 1992, 1993 @@ -14,13 +14,13 @@ #include <sm/gen.h> SM_IDSTR(copyright, -"@(#) Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.\n\ +"@(#) Copyright (c) 1998-2002, 2004 Sendmail, Inc. and its suppliers.\n\ All rights reserved.\n\ Copyright (c) 1992 Eric P. Allman. All rights reserved.\n\ Copyright (c) 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Id: makemap.c,v 8.176 2002/06/27 23:41:04 gshapiro Exp $") +SM_IDSTR(id, "@(#)$Id: makemap.c,v 8.177 2004/08/03 23:57:24 ca Exp $") #include <sys/types.h> @@ -52,6 +52,8 @@ BITMAP256 DontBlameSendmail; #define BUFSIZE 1024 #define ISSEP(c) (sep == '\0' ? isascii(c) && isspace(c) : (c) == sep) +static void usage __P((char *)); + static void usage(progname) char *progname; diff --git a/contrib/sendmail/smrsh/smrsh.8 b/contrib/sendmail/smrsh/smrsh.8 index e209fe4..b84c9e2 100644 --- a/contrib/sendmail/smrsh/smrsh.8 +++ b/contrib/sendmail/smrsh/smrsh.8 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. +.\" Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. .\" All rights reserved. .\" Copyright (c) 1993 Eric P. Allman. All rights reserved. .\" Copyright (c) 1993 @@ -9,9 +9,9 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: smrsh.8,v 8.20 2003/10/07 18:05:12 ca Exp $ +.\" $Id: smrsh.8,v 8.22 2004/08/06 03:55:35 gshapiro Exp $ .\" -.TH SMRSH 8 "$Date: 2003/10/07 18:05:12 $" +.TH SMRSH 8 "$Date: 2004/08/06 03:55:35 $" .SH NAME smrsh \- restricted shell for sendmail .SH SYNOPSIS @@ -92,7 +92,7 @@ to change the default program directory .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) +/usr/libexec/sm.bin \- directory for restricted programs on FreeBSD (>= 3.3) and DragonFly BSD .SH SEE ALSO sendmail(8) diff --git a/contrib/sendmail/smrsh/smrsh.c b/contrib/sendmail/smrsh/smrsh.c index 4aab7ba..284ffef 100644 --- a/contrib/sendmail/smrsh/smrsh.c +++ b/contrib/sendmail/smrsh/smrsh.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1993 Eric P. Allman. All rights reserved. * Copyright (c) 1993 @@ -14,13 +14,13 @@ #include <sm/gen.h> SM_IDSTR(copyright, -"@(#) Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.\n\ +"@(#) Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.\n\ All rights reserved.\n\ Copyright (c) 1993 Eric P. Allman. All rights reserved.\n\ Copyright (c) 1993\n\ The Regents of the University of California. All rights reserved.\n") -SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.63 2003/12/15 17:12:29 ca Exp $") +SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.65 2004/08/06 18:54:22 ca Exp $") /* ** SMRSH -- sendmail restricted shell @@ -96,6 +96,8 @@ SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.63 2003/12/15 17:12:29 ca Exp $") char newcmdbuf[1000]; char *prg, *par; +static void addcmd __P((char *, bool, size_t)); + /* ** ADDCMD -- add a string to newcmdbuf, check for overflow ** @@ -109,7 +111,7 @@ char *prg, *par; ** */ -void +static void addcmd(s, cmd, len) char *s; bool cmd; diff --git a/contrib/sendmail/src/README b/contrib/sendmail/src/README index b2e11c4..1d0b117 100644 --- a/contrib/sendmail/src/README +++ b/contrib/sendmail/src/README @@ -9,7 +9,7 @@ # the sendmail distribution. # # -# $Id: README,v 8.384 2004/07/26 18:03:55 ca Exp $ +# $Id: README,v 8.385 2004/11/25 06:52:06 msk Exp $ # This directory contains the source files for sendmail(TM). @@ -624,7 +624,7 @@ STARTTLS Enables SMTP STARTTLS (RFC 2487). This requires OpenSSL TLS_NO_RSA Turn off support for RSA algorithms in STARTTLS. MILTER Turn on support for external filters using the Milter API; this option is set by default, to turn it off use - APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER') + APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER=0') in devtools/Site/site.config.m4 (see devtools/README). See libmilter/README for more information about milter. REQUIRES_DIR_FSYNC Turn on support for file systems that require to @@ -1823,4 +1823,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.384 $, last update $Date: 2004/07/26 18:03:55 $ ) +(Version $Revision: 8.385 $, last update $Date: 2004/11/25 06:52:06 $ ) diff --git a/contrib/sendmail/src/bf.c b/contrib/sendmail/src/bf.c index 211ed02..87bef77 100644 --- a/contrib/sendmail/src/bf.c +++ b/contrib/sendmail/src/bf.c @@ -18,7 +18,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: bf.c,v 8.60 2004/04/14 18:12:49 ca Exp $") +SM_RCSID("@(#)$Id: bf.c,v 8.61 2004/08/03 23:59:02 ca Exp $") #include <sys/types.h> #include <sys/stat.h> @@ -38,6 +38,8 @@ static ssize_t sm_bfread __P((SM_FILE_T *, char *, size_t)); static ssize_t sm_bfwrite __P((SM_FILE_T *, const char *, size_t)); static off_t sm_bfseek __P((SM_FILE_T *, off_t, int)); static int sm_bfclose __P((SM_FILE_T *)); +static int sm_bfcommit __P((SM_FILE_T *)); +static int sm_bftruncate __P((SM_FILE_T *)); static int sm_bfopen __P((SM_FILE_T *, const void *, int, const void *)); static int sm_bfsetinfo __P((SM_FILE_T *, int , void *)); diff --git a/contrib/sendmail/src/collect.c b/contrib/sendmail/src/collect.c index 392941b..ac13007 100644 --- a/contrib/sendmail/src/collect.c +++ b/contrib/sendmail/src/collect.c @@ -13,9 +13,9 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: collect.c,v 8.254 2004/04/05 18:41:38 ca Exp $") +SM_RCSID("@(#)$Id: collect.c,v 8.260 2004/11/30 23:29:15 ca Exp $") -static void collecttimeout __P((time_t)); +static void collecttimeout __P((int)); static void eatfrom __P((char *volatile, ENVELOPE *)); static void collect_doheader __P((ENVELOPE *)); static SM_FILE_T *collect_dfopen __P((ENVELOPE *)); @@ -290,7 +290,7 @@ collect(fp, smtpmode, hdrp, e, rsetsize) { register SM_FILE_T *volatile df; volatile bool ignrdot; - volatile time_t dbto; + volatile int dbto; register char *volatile bp; volatile int c; volatile bool inputerr; @@ -308,7 +308,7 @@ collect(fp, smtpmode, hdrp, e, rsetsize) df = NULL; ignrdot = smtpmode ? false : IgnrDot; - dbto = smtpmode ? TimeOuts.to_datablock : 0; + dbto = smtpmode ? (int) TimeOuts.to_datablock : 0; c = SM_IO_EOF; inputerr = false; headeronly = hdrp != NULL; @@ -525,14 +525,13 @@ bufferchar: continue; } + SM_ASSERT(mstate == MS_UFROM || mstate == MS_HEADER); + /* header -- buffer up */ if (bp >= &buf[buflen - 2]) { char *obuf; - if (mstate != MS_HEADER) - break; - /* out of space for header */ obuf = buf; if (buflen < MEMCHUNKSIZE) @@ -909,7 +908,7 @@ readerr: static void collecttimeout(timeout) - time_t timeout; + int timeout; { int save_errno = errno; diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c index 5f91e45..66f80d6 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.1047 2004/07/14 21:54:23 ca Exp $") +SM_RCSID("@(#)$Id: conf.c,v 8.1052 2004/12/15 22:45:55 ca Exp $") #include <sendmail/pathnames.h> #if NEWDB @@ -35,6 +35,12 @@ static void setupmaps __P((void)); static void setupmailers __P((void)); static void setupqueues __P((void)); static int get_num_procs_online __P((void)); +static int add_hostnames __P((SOCKADDR *)); + +#if NETINET6 && NEEDSGETIPNODE +static struct hostent *getipnodebyname __P((char *, int, int, int *)); +static struct hostent *getipnodebyaddr __P((char *, int, int, int *)); +#endif /* NETINET6 && NEEDSGETIPNODE */ /* @@ -144,6 +150,9 @@ struct prival PrivacyValues[] = { "noreceipts", PRIV_NORECEIPTS }, { "nobodyreturn", PRIV_NOBODYRETN }, { "goaway", PRIV_GOAWAY }, +#if _FFR_PRIV_NOACTUALRECIPIENT + { "noactualrecipient", PRIV_NOACTUALRECIPIENT }, +#endif /* _FFR_PRIV_NOACTUALRECIPIENT */ { NULL, 0 } }; @@ -6022,10 +6031,6 @@ char *FFRCompileOptions[] = /* Allow local (not just TCP) socket connection to server. */ "_FFR_DAEMON_NETUNIX", #endif /* _FFR_DAEMON_NETUNIX */ -#if _FFR_DEAL_WITH_ERROR_SSL - /* Deal with SSL errors by recognizing them as EOF. */ - "_FFR_DEAL_WITH_ERROR_SSL", -#endif /* _FFR_DEAL_WITH_ERROR_SSL */ #if _FFR_DEPRECATE_MAILER_FLAG_I /* What it says :-) */ "_FFR_DEPRECATE_MAILER_FLAG_I", @@ -6130,7 +6135,7 @@ char *FFRCompileOptions[] = ** Gurusamy Sarathy of ActiveState */ - "_FFR_MAXDATASIZE" + "_FFR_MAXDATASIZE", #endif /* _FFR_MAXDATASIZE */ #if _FFR_MAX_FORWARD_ENTRIES /* Try to limit number of .forward entries */ @@ -6165,6 +6170,15 @@ char *FFRCompileOptions[] = /* Disable PIPELINING, delay client if used. */ "_FFR_NO_PIPE", #endif /* _FFR_NO_PIPE */ +#if _FFR_PRIV_NOACTUALRECIPIENT + /* + ** PrivacyOptions=noactualrecipient stops sendmail from putting + ** X-Actual-Recipient lines in DSNs revealing the actual + ** account that addresses map to. Patch from Dan Harkless. + */ + + "_FFR_PRIV_NOACTUALRECIPIENT" +#endif /* _FFR_PRIV_NOACTUALRECIPIENT */ #if _FFR_QUEUEDELAY /* Exponential queue delay; disabled in 8.13 since it isn't used. */ "_FFR_QUEUEDELAY", @@ -6213,7 +6227,7 @@ char *FFRCompileOptions[] = #endif /* _FFR_SHM_STATUS */ #if _FFR_SKIP_DOMAINS /* process every N'th domain instead of every N'th message */ - "_FFR_SKIP_DOMAINS" + "_FFR_SKIP_DOMAINS", #endif /* _FFR_SKIP_DOMAINS */ #if _FFR_SLEEP_USE_SELECT /* Use select(2) in libsm/clock.c to emulate sleep(2) */ diff --git a/contrib/sendmail/src/control.c b/contrib/sendmail/src/control.c index 60eab3c..0d7ee0b 100644 --- a/contrib/sendmail/src/control.c +++ b/contrib/sendmail/src/control.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. * * By using this file, you agree to the terms and conditions set @@ -10,7 +10,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: control.c,v 8.125 2003/06/24 17:46:06 ca Exp $") +SM_RCSID("@(#)$Id: control.c,v 8.126 2004/08/04 20:54:00 ca Exp $") #include <sm/fdset.h> @@ -46,6 +46,7 @@ static struct cmd CmdTab[] = +static void controltimeout __P((int)); int ControlSocket = -1; /* @@ -247,7 +248,7 @@ static jmp_buf CtxControlTimeout; /* ARGSUSED0 */ static void controltimeout(timeout) - time_t timeout; + int timeout; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c index c593901..0077e92 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.649 2004/07/14 21:57:52 ca Exp $") +SM_RCSID("@(#)$Id: daemon.c,v 8.653 2004/11/18 23:45:01 ca Exp $") #if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__) # define USE_SOCK_STREAM 1 @@ -81,10 +81,15 @@ struct daemon typedef struct daemon DAEMON_T; -static void connecttimeout __P((void)); +static void connecttimeout __P((int)); static int opendaemonsocket __P((DAEMON_T *, bool)); static unsigned short setupdaemon __P((SOCKADDR *)); static void getrequests_checkdiskspace __P((ENVELOPE *e)); +static void setsockaddroptions __P((char *, DAEMON_T *)); +static void printdaemonflags __P((DAEMON_T *)); +static int addr_family __P((char *)); +static int addrcmp __P((struct hostent *, char *, SOCKADDR *)); +static void authtimeout __P((int)); /* ** DAEMON.C -- routines to use when running as a daemon. @@ -1414,7 +1419,7 @@ chkdaemonmodifiers(flag) static void setsockaddroptions(p, d) - register char *p; + char *p; DAEMON_T *d; { #if NETISO @@ -2571,6 +2576,8 @@ gothostent: break; #endif /* NETINET6 */ } + if (tTd(16, 1)) + sm_dprintf("Connecting to [%s]...\n", anynet_ntoa(&addr)); i = connect(s, (struct sockaddr *) &addr, addrlen); save_errno = errno; if (ev != NULL) @@ -2774,7 +2781,8 @@ nextaddr: } static void -connecttimeout() +connecttimeout(ignore) + int ignore; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD @@ -3257,7 +3265,8 @@ addrcmp(hp, ha, sa) static jmp_buf CtxAuthTimeout; static void -authtimeout() +authtimeout(ignore) + int ignore; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c index 5839cbe..96e16a3 100644 --- a/contrib/sendmail/src/deliver.c +++ b/contrib/sendmail/src/deliver.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -14,7 +14,7 @@ #include <sendmail.h> #include <sys/time.h> -SM_RCSID("@(#)$Id: deliver.c,v 8.976 2004/07/23 20:45:01 gshapiro Exp $") +SM_RCSID("@(#)$Id: deliver.c,v 8.983 2005/01/07 17:43:22 ca Exp $") #if HASSETUSERCONTEXT # include <login_cap.h> @@ -28,10 +28,10 @@ SM_RCSID("@(#)$Id: deliver.c,v 8.976 2004/07/23 20:45:01 gshapiro Exp $") # include "sfsasl.h" #endif /* STARTTLS || SASL */ -void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int, bool)); static int deliver __P((ENVELOPE *, ADDRESS *)); static void dup_queue_file __P((ENVELOPE *, ENVELOPE *, int)); -static void mailfiletimeout __P((void)); +static void mailfiletimeout __P((int)); +static void endwaittimeout __P((int)); static int parse_hostsignature __P((char *, char **, MAILER *)); static void sendenvelope __P((ENVELOPE *, int)); extern MCI *mci_new __P((SM_RPOOL_T *)); @@ -1659,7 +1659,7 @@ deliver(e, firstto) } /* - ** Strip one leading backslash if requested and the + ** Strip all leading backslashes if requested and the ** next character is alphanumerical (the latter can ** probably relaxed a bit, see RFC2821). */ @@ -3769,7 +3769,8 @@ markfailure(e, q, mci, rcode, ovr) static jmp_buf EndWaitTimeout; static void -endwaittimeout() +endwaittimeout(ignore) + int ignore; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD @@ -3797,7 +3798,10 @@ endmailer(mci, e, pv) /* close output to mailer */ if (mci->mci_out != NULL) + { (void) sm_io_close(mci->mci_out, SM_TIME_DEFAULT); + mci->mci_out = NULL; + } /* copy any remaining input to transcript */ if (mci->mci_in != NULL && mci->mci_state != MCIS_ERROR && @@ -3824,8 +3828,10 @@ endmailer(mci, e, pv) /* now close the input */ if (mci->mci_in != NULL) + { (void) sm_io_close(mci->mci_in, SM_TIME_DEFAULT); - mci->mci_in = mci->mci_out = NULL; + mci->mci_in = NULL; + } mci->mci_state = MCIS_CLOSED; errno = save_errno; @@ -4001,7 +4007,7 @@ giveresponse(status, dsn, m, mci, ctladdr, xstart, e, to) #ifdef EHOSTUNREACH case EHOSTUNREACH: /* No route to host */ #endif /* EHOSTUNREACH */ - if (mci->mci_host != NULL) + if (mci != NULL && mci->mci_host != NULL) { (void) sm_strlcpyn(bp, SPACELEFT(buf, bp), @@ -5601,7 +5607,8 @@ mailfile(filename, mailer, ctladdr, sfflags, e) } static void -mailfiletimeout() +mailfiletimeout(ignore) + int ignore; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c index dd24272..c215821 100644 --- a/contrib/sendmail/src/domain.c +++ b/contrib/sendmail/src/domain.c @@ -14,9 +14,9 @@ #include <sendmail.h> #if NAMED_BIND -SM_RCSID("@(#)$Id: domain.c,v 8.194 2004/01/14 01:47:34 ca Exp $ (with name server)") +SM_RCSID("@(#)$Id: domain.c,v 8.195 2004/08/04 21:11:31 ca Exp $ (with name server)") #else /* NAMED_BIND */ -SM_RCSID("@(#)$Id: domain.c,v 8.194 2004/01/14 01:47:34 ca Exp $ (without name server)") +SM_RCSID("@(#)$Id: domain.c,v 8.195 2004/08/04 21:11:31 ca Exp $ (without name server)") #endif /* NAMED_BIND */ #if NAMED_BIND @@ -223,7 +223,7 @@ getmxrr(host, mxhosts, mxprefs, droplocalhost, rcode, tryfallback, pttl) char *fallbackMX = FallbackMX; bool trycanon = false; unsigned short *prefs; - int (*resfunc)(); + int (*resfunc) __P((const char *, int, int, u_char *, int)); unsigned short prefer[MAXMXHOSTS]; int weight[MAXMXHOSTS]; int ttl = 0; diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c index 12a567d..892a2cf 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.286 2004/07/08 17:57:32 ca Exp $") +SM_RCSID("@(#)$Id: headers.c,v 8.287 2004/12/03 18:29:51 ca Exp $") static HDR *allocheader __P((char *, char *, int, SM_RPOOL_T *)); static size_t fix_mime_header __P((HDR *, ENVELOPE *)); @@ -1811,7 +1811,7 @@ put_vanilla_header(h, v, mci) register char *nlp; register char *obp; int putflags; - char obuf[MAXLINE]; + char obuf[MAXLINE + 256]; /* additional length for h_field */ putflags = PXLF_HEADER; if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags)) diff --git a/contrib/sendmail/src/helpfile b/contrib/sendmail/src/helpfile index 931a06e..af8bd15 100644 --- a/contrib/sendmail/src/helpfile +++ b/contrib/sendmail/src/helpfile @@ -1,6 +1,6 @@ #vers 2 cpyr -cpyr Copyright (c) 1998-2000, 2002 Sendmail, Inc. and its suppliers. +cpyr Copyright (c) 1998-2000, 2002, 2004 Sendmail, Inc. and its suppliers. cpyr All rights reserved. cpyr Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. cpyr Copyright (c) 1988, 1993 @@ -11,7 +11,7 @@ cpyr By using this file, you agree to the terms and conditions set cpyr forth in the LICENSE file which can be found at the top level of cpyr the sendmail distribution. cpyr -cpyr $$Id: helpfile,v 8.40 2002/03/19 00:23:28 gshapiro Exp $$ +cpyr $$Id: helpfile,v 8.43 2004/10/29 18:05:39 ca Exp $$ cpyr smtp This is sendmail version $v smtp Topics: diff --git a/contrib/sendmail/src/map.c b/contrib/sendmail/src/map.c index ad9fa70..46bf15f 100644 --- a/contrib/sendmail/src/map.c +++ b/contrib/sendmail/src/map.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: map.c,v 8.664 2004/06/28 17:46:13 ca Exp $") +SM_RCSID("@(#)$Id: map.c,v 8.666 2004/08/17 16:50:19 gshapiro Exp $") #if LDAPMAP # include <sm/ldap.h> @@ -4431,7 +4431,10 @@ ldapmap_parseargs(map, args) } } lmap->ldap_attr[i] = NULL; + + /* Set in case needed in future code */ attrssetup = true; + if (recurse && !normalseen) { syserr("LDAP recursion requested in %s but no returnable attribute given", @@ -6470,6 +6473,9 @@ struct regex_map char *regex_delim; /* move to type MAP */ }; +static int parse_fields __P((char *, int *, int, int)); +static char *regex_map_rewrite __P((MAP *, const char*, size_t, char **)); + static int parse_fields(s, ibuf, blen, nr_substrings) char *s; diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c index dd8d7c3..4955197 100644 --- a/contrib/sendmail/src/mci.c +++ b/contrib/sendmail/src/mci.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: mci.c,v 8.211 2003/03/31 17:35:50 ca Exp $") +SM_RCSID("@(#)$Id: mci.c,v 8.212 2004/08/04 21:11:31 ca Exp $") #if NETINET || NETINET6 # include <arpa/inet.h> @@ -1045,7 +1045,7 @@ mci_store_persistent(mci) int mci_traverse_persistent(action, pathname) - int (*action)(); + int (*action)__P((char *, char *)); char *pathname; { struct stat statbuf; diff --git a/contrib/sendmail/src/milter.c b/contrib/sendmail/src/milter.c index b89fac0..21374b8 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.225 2004/07/08 21:52:20 ca Exp $") +SM_RCSID("@(#)$Id: milter.c,v 8.228 2004/11/09 18:54:55 ca Exp $") #if MILTER # include <libmilter/mfapi.h> @@ -29,7 +29,7 @@ SM_RCSID("@(#)$Id: milter.c,v 8.225 2004/07/08 21:52:20 ca Exp $") # include <sm/fdset.h> -static void milter_connect_timeout __P((void)); +static void milter_connect_timeout __P((int)); static void milter_error __P((struct milter *, ENVELOPE *)); static int milter_open __P((struct milter *, bool, ENVELOPE *)); static void milter_parse_timeouts __P((char *, struct milter *)); @@ -75,6 +75,8 @@ static size_t MilterMaxDataSize = MILTER_MAX_DATA_SIZE; } \ else if (bitnset(SMF_TEMPFAIL, m->mf_flags)) \ *state = SMFIR_TEMPFAIL; \ + else if (bitnset(SMF_TEMPDROP, m->mf_flags)) \ + *state = SMFIR_SHUTDOWN; \ else if (bitnset(SMF_REJECT, m->mf_flags)) \ *state = SMFIR_REJECT; \ else \ @@ -1127,7 +1129,8 @@ milter_open(m, parseonly, e) } static void -milter_connect_timeout() +milter_connect_timeout(ignore) + int ignore; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD @@ -2340,6 +2343,7 @@ milter_per_connection_check(e) ** ** Parameters: ** m -- the broken filter. +** e -- current envelope. ** ** Returns: ** none @@ -2351,10 +2355,8 @@ milter_error(m, e) ENVELOPE *e; { /* - ** We could send a quit here but - ** we may have gotten here due to - ** an I/O error so we don't want - ** to try to make things worse. + ** We could send a quit here but we may have gotten here due to + ** an I/O error so we don't want to try to make things worse. */ if (m->mf_sock >= 0) @@ -2832,13 +2834,21 @@ milter_changeheader(response, rlen, e) if (*val == '\0') { if (tTd(64, 10)) - sm_dprintf("Delete (noop) %s:\n", field); + sm_dprintf("Delete (noop) %s\n", field); + if (MilterLogLevel > 8) + sm_syslog(LOG_INFO, e->e_id, + "Milter delete (noop): header: %s" + , field); } else { /* treat modify value with no existing header as add */ if (tTd(64, 10)) sm_dprintf("Add %s: %s\n", field, val); + if (MilterLogLevel > 8) + sm_syslog(LOG_INFO, e->e_id, + "Milter change (add): header: %s: %s" + , field, val); addheader(newstr(field), val, H_USER, e); } return; diff --git a/contrib/sendmail/src/mime.c b/contrib/sendmail/src/mime.c index 6f4e782..fd3e65a 100644 --- a/contrib/sendmail/src/mime.c +++ b/contrib/sendmail/src/mime.c @@ -14,7 +14,7 @@ #include <sendmail.h> #include <string.h> -SM_RCSID("@(#)$Id: mime.c,v 8.136 2004/03/22 18:21:34 ca Exp $") +SM_RCSID("@(#)$Id: mime.c,v 8.137 2004/09/02 21:37:26 ca Exp $") /* ** MIME support. @@ -848,7 +848,11 @@ mimeboundary(line, boundaries) i--; /* strip off trailing whitespace */ - while (i > 0 && (line[i - 1] == ' ' || line[i - 1] == '\t')) + while (i > 0 && (line[i - 1] == ' ' || line[i - 1] == '\t' +#if _FFR_MIME_CR_OK + || line[i - 1] == '\r' +#endif /* _FFR_MIME_CR_OK */ + )) i--; savec = line[i]; line[i] = '\0'; diff --git a/contrib/sendmail/src/parseaddr.c b/contrib/sendmail/src/parseaddr.c index e1c60c8..9050b97 100644 --- a/contrib/sendmail/src/parseaddr.c +++ b/contrib/sendmail/src/parseaddr.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: parseaddr.c,v 8.378 2004/05/18 20:01:54 ca Exp $") +SM_RCSID("@(#)$Id: parseaddr.c,v 8.379 2004/08/06 22:19:36 ca Exp $") static void allocaddr __P((ADDRESS *, int, char *, ENVELOPE *)); static int callsubr __P((char**, int, ENVELOPE *)); @@ -2196,7 +2196,7 @@ cataddr(pvp, evp, buf, sz, spacesub) /* Don't silently truncate long strings */ if (sz <= 0) - syserr("cataddr: string too long"); + usrerr("cataddr: string too long"); *p = '\0'; } /* diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c index f37a293..51d6b63 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.938 2004/06/03 19:02:10 ca Exp $") +SM_RCSID("@(#)$Id: queue.c,v 8.939 2004/08/03 19:57:23 ca Exp $") #include <dirent.h> @@ -2399,7 +2399,8 @@ doqueuerun() */ void -runqueueevent() +runqueueevent(ignore) + int ignore; { int save_errno = errno; diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c index 49eb120..b362391 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.641 2004/07/23 20:45:02 gshapiro Exp $") +SM_RCSID("@(#)$Id: readcf.c,v 8.642 2004/08/04 21:17:57 ca Exp $") #if NETINET || NETINET6 # include <arpa/inet.h> @@ -29,6 +29,7 @@ static char **makeargv __P((char *)); static void settimeout __P((char *, char *, bool)); static void toomany __P((int, int)); static char *extrquotstr __P((char *, char **, char *, bool *)); +static void parse_class_words __P((int, char *)); /* ** READCF -- read configuration file. diff --git a/contrib/sendmail/src/recipient.c b/contrib/sendmail/src/recipient.c index 02ef8d7..d952a8b 100644 --- a/contrib/sendmail/src/recipient.c +++ b/contrib/sendmail/src/recipient.c @@ -13,9 +13,9 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: recipient.c,v 8.336 2004/07/23 20:45:02 gshapiro Exp $") +SM_RCSID("@(#)$Id: recipient.c,v 8.337 2004/08/03 19:57:23 ca Exp $") -static void includetimeout __P((void)); +static void includetimeout __P((int)); static ADDRESS *self_reference __P((ADDRESS *)); static int sortexpensive __P((ADDRESS *, ADDRESS *)); static int sortbysignature __P((ADDRESS *, ADDRESS *)); @@ -1874,7 +1874,8 @@ resetuid: } static void -includetimeout() +includetimeout(ignore) + int ignore; { /* ** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD diff --git a/contrib/sendmail/src/sasl.c b/contrib/sendmail/src/sasl.c index e2bf415..9e368ff 100644 --- a/contrib/sendmail/src/sasl.c +++ b/contrib/sendmail/src/sasl.c @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: sasl.c,v 8.20 2004/06/02 22:48:06 ca Exp $") +SM_RCSID("@(#)$Id: sasl.c,v 8.21 2004/11/22 23:09:00 gshapiro Exp $") #if SASL # include <stdlib.h> @@ -226,9 +226,6 @@ intersect(s1, s2, rpool) # include <arpa/inet.h> -# ifndef NI_WITHSCOPEID -# define NI_WITHSCOPEID 0 -# endif # ifndef NI_MAXHOST # define NI_MAXHOST 1025 # endif @@ -244,6 +241,9 @@ iptostring(addr, addrlen, out, outlen) unsigned outlen; { char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV]; +# if NETINET6 + int niflags; +# endif /* NETINET6 */ if (addr == NULL || out == NULL) { @@ -252,9 +252,13 @@ iptostring(addr, addrlen, out, outlen) } # if NETINET6 + niflags = (NI_NUMERICHOST | NI_NUMERICSERV); +# ifdef NI_WITHSCOPEID + if (addr->sa.sa_family == AF_INET6) + niflags |= NI_WITHSCOPEID; +# endif /* NI_WITHSCOPEID */ if (getnameinfo((struct sockaddr *) addr, addrlen, - hbuf, sizeof hbuf, pbuf, sizeof pbuf, - NI_NUMERICHOST | NI_WITHSCOPEID | NI_NUMERICSERV) != 0) + hbuf, sizeof hbuf, pbuf, sizeof pbuf, niflags) != 0) return false; # else /* NETINET6 */ if (addr->sa.sa_family != AF_INET) diff --git a/contrib/sendmail/src/savemail.c b/contrib/sendmail/src/savemail.c index 231382a..857d81f 100644 --- a/contrib/sendmail/src/savemail.c +++ b/contrib/sendmail/src/savemail.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: savemail.c,v 8.303 2004/01/14 02:56:51 ca Exp $") +SM_RCSID("@(#)$Id: savemail.c,v 8.304 2004/10/06 21:36:06 ca Exp $") static void errbody __P((MCI *, ENVELOPE *, char *)); static bool pruneroute __P((char *)); @@ -1182,6 +1182,9 @@ errbody(mci, e, separator) /* X-Actual-Recipient: -- the real problem address */ if (actual[0] != '\0' && q->q_finalrcpt != NULL && +#if _FFR_PRIV_NOACTUALRECIPIENT + !bitset(PRIV_NOACTUALRECIPIENT, PrivacyFlags) && +#endif /* _FFR_PRIV_NOACTUALRECIPIENT */ strcmp(actual, q->q_finalrcpt) != 0) { (void) sm_snprintf(buf, sizeof buf, diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h index 306605e..673cee5 100644 --- a/contrib/sendmail/src/sendmail.h +++ b/contrib/sendmail/src/sendmail.h @@ -52,7 +52,7 @@ #ifdef _DEFINE # ifndef lint -SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.984 2004/07/14 21:54:22 ca Exp $"; +SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.990 2004/11/09 19:45:46 ca Exp $"; # endif /* ! lint */ #endif /* _DEFINE */ @@ -400,7 +400,7 @@ struct mailer #define M_ESMTP 'a' /* run Extended SMTP */ #define M_ALIASABLE 'A' /* user can be LHS of an alias */ #define M_BLANKEND 'b' /* ensure blank line at end of message */ -#define M_STRIPBACKSL 'B' /* strip leading backslash from user */ +#define M_STRIPBACKSL 'B' /* strip all leading backslashes from user */ #define M_NOCOMMENT 'c' /* don't include comment part of address */ #define M_CANONICAL 'C' /* make addresses canonical "u@dom" */ #define M_NOBRACKET 'd' /* never angle bracket envelope route-addrs */ @@ -463,7 +463,7 @@ struct mailer extern void initerrmailers __P((void)); extern void makemailer __P((char *)); extern void makequeue __P((char *, bool)); -extern void runqueueevent __P((void)); +extern void runqueueevent __P((int)); #if _FFR_QUEUE_RUN_PARANOIA extern bool checkqueuerunner __P((void)); #endif /* _FFR_QUEUE_RUN_PARANOIA */ @@ -1601,6 +1601,9 @@ extern void set_delivery_mode __P((int, ENVELOPE *)); #define PRIV_NOETRN 0x00080000 /* disallow ETRN command */ #define PRIV_NOBODYRETN 0x00100000 /* do not return bodies on bounces */ #define PRIV_NORECEIPTS 0x00200000 /* disallow return receipts */ +#if _FFR_PRIV_NOACTUALRECIPIENT +# define PRIV_NOACTUALRECIPIENT 0x00400000 /* no X-Actual-Recipient in DSNs */ +#endif /* _FFR_PRIV_NOACTUALRECIPIENT */ /* don't give no info, anyway, anyhow */ #define PRIV_GOAWAY 0x0000ffff @@ -1695,6 +1698,7 @@ struct milter /* MTA flags */ # define SMF_REJECT 'R' /* Reject connection on filter fail */ # define SMF_TEMPFAIL 'T' /* tempfail connection on failure */ +# define SMF_TEMPDROP '4' /* 421 connection on failure */ /* states */ # define SMFS_CLOSED 'C' /* closed for all further actions */ @@ -2350,7 +2354,7 @@ extern void PRINTFLIKE(3, 4) sm_syslog __P((int, const char *, const char *, ... /* SMTP */ extern void giveresponse __P((int, char *, MAILER *, MCI *, ADDRESS *, time_t, ENVELOPE *, ADDRESS *)); -extern int reply __P((MAILER *, MCI *, ENVELOPE *, time_t, void (*)(), char **, int)); +extern int reply __P((MAILER *, MCI *, ENVELOPE *, time_t, void (*)__P((char *, bool, MAILER *, MCI *, ENVELOPE *)), char **, int)); extern void smtp __P((char *volatile, BITMAP256, ENVELOPE *volatile)); #if SASL extern int smtpauth __P((MAILER *, MCI *, ENVELOPE *)); @@ -2496,6 +2500,7 @@ extern void makelower __P((char *)); extern int makeconnection_ds __P((char *, MCI *)); extern int makeconnection __P((char *, volatile unsigned int, MCI *, ENVELOPE *, time_t)); extern void makeworkgroups __P((void)); +extern void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int, bool)); extern void mark_work_group_restart __P((int, int)); extern char * munchstring __P((char *, char **, int)); extern struct hostent *myhostname __P((char *, int)); diff --git a/contrib/sendmail/src/sfsasl.c b/contrib/sendmail/src/sfsasl.c index ab8aca3..38eb7af 100644 --- a/contrib/sendmail/src/sfsasl.c +++ b/contrib/sendmail/src/sfsasl.c @@ -9,10 +9,16 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: sfsasl.c,v 8.98 2004/03/03 19:20:31 ca Exp $") +SM_RCSID("@(#)$Id: sfsasl.c,v 8.101 2004/12/15 22:45:55 ca Exp $") #include <stdlib.h> #include <sendmail.h> #include <errno.h> + +/* allow to disable error handling code just in case... */ +#ifndef DEAL_WITH_ERROR_SSL +# define DEAL_WITH_ERROR_SSL 1 +#endif /* ! DEAL_WITH_ERROR_SSL */ + #if SASL # include "sfsasl.h" @@ -279,10 +285,29 @@ sasl_write(fp, buf, size) # else /* SASL >= 20000 */ char *outbuf; # endif /* SASL >= 20000 */ - unsigned int outlen; + unsigned int outlen, *maxencode; size_t ret = 0, total = 0; struct sasl_obj *so = (struct sasl_obj *) fp->f_cookie; + /* + ** Fetch the maximum input buffer size for sasl_encode(). + ** This can be less than the size set in attemptauth() + ** due to a negotation with the other side, e.g., + ** Cyrus IMAP lmtp program sets maxbuf=4096, + ** digestmd5 substracts 25 and hence we'll get 4071 + ** instead of 8192 (MAXOUTLEN). + ** Hack (for now): simply reduce the size, callers are (must be) + ** able to deal with that and invoke sasl_write() again with + ** the rest of the data. + ** Note: it would be better to store this value in the context + ** after the negotiation. + */ + + result = sasl_getprop(so->conn, SASL_MAXOUTBUF, + (const void **) &maxencode); + if (result == SASL_OK && size > *maxencode && *maxencode > 0) + size = *maxencode; + result = sasl_encode(so->conn, buf, (unsigned int) size, &outbuf, &outlen); @@ -580,19 +605,19 @@ tls_read(fp, buf, size) */ break; case SSL_ERROR_SSL: -#if _FFR_DEAL_WITH_ERROR_SSL +#if DEAL_WITH_ERROR_SSL if (r == 0 && errno == 0) /* out of protocol EOF found */ break; -#endif /* _FFR_DEAL_WITH_ERROR_SSL */ +#endif /* DEAL_WITH_ERROR_SSL */ err = "generic SSL error"; if (LogLevel > 9) tlslogerr("read"); -#if _FFR_DEAL_WITH_ERROR_SSL +#if DEAL_WITH_ERROR_SSL /* avoid repeated calls? */ if (r == 0) r = -1; -#endif /* _FFR_DEAL_WITH_ERROR_SSL */ +#endif /* DEAL_WITH_ERROR_SSL */ break; } if (err != NULL) @@ -685,11 +710,11 @@ tls_write(fp, buf, size) if (LogLevel > 9) tlslogerr("write"); -#if _FFR_DEAL_WITH_ERROR_SSL +#if DEAL_WITH_ERROR_SSL /* avoid repeated calls? */ if (r == 0) r = -1; -#endif /* _FFR_DEAL_WITH_ERROR_SSL */ +#endif /* DEAL_WITH_ERROR_SSL */ break; } if (err != NULL) diff --git a/contrib/sendmail/src/sm_resolve.c b/contrib/sendmail/src/sm_resolve.c index d788d00..affd3e5 100644 --- a/contrib/sendmail/src/sm_resolve.c +++ b/contrib/sendmail/src/sm_resolve.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 2000-2004 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -46,7 +46,7 @@ # if NAMED_BIND # include "sm_resolve.h" -SM_RCSID("$Id: sm_resolve.c,v 8.32 2003/03/22 22:57:26 ca Exp $") +SM_RCSID("$Id: sm_resolve.c,v 8.33 2004/08/04 21:17:57 ca Exp $") static struct stot { @@ -70,6 +70,8 @@ static struct stot { NULL, 0 } }; +static DNS_REPLY_T *parse_dns_reply __P((unsigned char *, int)); + /* ** DNS_STRING_TO_TYPE -- convert resource record name into type ** diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c index cb0366e..ff06bf2 100644 --- a/contrib/sendmail/src/srvrsmtp.c +++ b/contrib/sendmail/src/srvrsmtp.c @@ -17,7 +17,7 @@ # include <libmilter/mfdef.h> #endif /* MILTER */ -SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.900 2004/07/08 23:29:33 ca Exp $") +SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.902 2004/11/18 21:46:01 ca Exp $") #include <sys/time.h> #include <sm/fdset.h> @@ -1966,6 +1966,13 @@ tlsfail: /* only complain if strict check */ ok = AllowBogusHELO; + + /* allow trailing whitespace */ + while (!ok && *++q != '\0' && + isspace(*q)) + ; + if (*q == '\0') + ok = true; break; } if (strchr("[].-_#:", *q) == NULL) @@ -4110,7 +4117,9 @@ rcpt_esmtp_args(a, kp, vp, e) return; for (p = vp; p != NULL; vp = p) { - p = strchr(p, ','); + char *s; + + s = p = strchr(p, ','); if (p != NULL) *p++ = '\0'; if (sm_strcasecmp(vp, "success") == 0) @@ -4125,6 +4134,8 @@ rcpt_esmtp_args(a, kp, vp, e) vp); /* NOTREACHED */ } + if (s != NULL) + *s = ','; } } else if (sm_strcasecmp(kp, "orcpt") == 0) diff --git a/contrib/sendmail/src/tls.c b/contrib/sendmail/src/tls.c index 6a8e8a1..1867097 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.95 2004/07/13 21:37:33 ca Exp $") +SM_RCSID("@(#)$Id: tls.c,v 8.96 2004/08/04 21:17:58 ca Exp $") #if STARTTLS # include <openssl/err.h> @@ -39,6 +39,9 @@ static int x509_verify_cb __P((int, X509_STORE_CTX *)); # define CONST097 const # endif /* !defined() || OPENSSL_VERSION_NUMBER < 0x00907000L */ static void apps_ssl_info_cb __P((CONST097 SSL *, int , int)); +static bool tls_ok_f __P((char *, char *, int)); +static bool tls_safe_f __P((char *, long, bool)); +static int tls_verify_log __P((int, X509_STORE_CTX *, char *)); # if !NO_DH static DH *get_dh512 __P((void)); diff --git a/contrib/sendmail/src/usersmtp.c b/contrib/sendmail/src/usersmtp.c index 5c2b8f8..0bcbcf5 100644 --- a/contrib/sendmail/src/usersmtp.c +++ b/contrib/sendmail/src/usersmtp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,13 +13,12 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: usersmtp.c,v 8.451 2004/03/01 21:50:36 ca Exp $") +SM_RCSID("@(#)$Id: usersmtp.c,v 8.460 2005/01/11 00:24:19 ca Exp $") #include <sysexits.h> -extern void markfailure __P((ENVELOPE *, ADDRESS *, MCI *, int, bool)); -static void datatimeout __P((void)); +static void datatimeout __P((int)); static void esmtp_check __P((char *, bool, MAILER *, MCI *, ENVELOPE *)); static void helo_options __P((char *, bool, MAILER *, MCI *, ENVELOPE *)); static int smtprcptstat __P((ADDRESS *, MAILER *, MCI *, ENVELOPE *)); @@ -2560,6 +2559,20 @@ smtpdata(m, mci, e, ctladdr, xstart) mci->mci_nextaddr = mci->mci_nextaddr->q_pchain; } e->e_to = oldto; + + /* + ** Connection might be closed in response to a RCPT command, + ** i.e., the server responded with 421. In that case (at + ** least) one RCPT has a temporary failure, hence we don't + ** need to check mci_okrcpts (as it is done below) to figure + ** out which error to return. + */ + + if (mci->mci_state == MCIS_CLOSED) + { + errno = mci->mci_errno; + return EX_TEMPFAIL; + } } #endif /* PIPELINING */ @@ -2724,7 +2737,8 @@ smtpdata(m, mci, e, ctladdr, xstart) r = reply(m, mci, e, TimeOuts.to_datafinal, NULL, &enhsc, XS_DEFAULT); if (r < 0) return EX_TEMPFAIL; - mci->mci_state = MCIS_OPEN; + if (mci->mci_state == MCIS_DATA) + mci->mci_state = MCIS_OPEN; xstat = EX_NOTSTICKY; if (r == 452) rstat = EX_TEMPFAIL; @@ -2761,7 +2775,8 @@ smtpdata(m, mci, e, ctladdr, xstart) } static void -datatimeout() +datatimeout(ignore) + int ignore; { int save_errno = errno; @@ -2997,10 +3012,12 @@ smtprset(m, mci, e) ** to take when a value other than 250 is received. ** ** However, if 421 is returned for the RSET, leave - ** mci_state as MCIS_SSD (set in reply()). + ** mci_state alone (MCIS_SSD can be set in reply() + ** and MCIS_CLOSED can be set in smtpquit() if + ** reply() gets a 421 and calls smtpquit()). */ - if (mci->mci_state != MCIS_SSD) + if (mci->mci_state != MCIS_SSD && mci->mci_state != MCIS_CLOSED) mci->mci_state = MCIS_OPEN; } /* @@ -3063,7 +3080,7 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype) MCI *mci; ENVELOPE *e; time_t timeout; - void (*pfunc)(); + void (*pfunc) __P((char *, bool, MAILER *, MCI *, ENVELOPE *)); char **enhstat; int rtype; { @@ -3106,7 +3123,7 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype) if (mci->mci_state == MCIS_CLOSED) return SMTPCLOSING; - /* don't try to read from a non-existant fd */ + /* don't try to read from a non-existent fd */ if (mci->mci_in == NULL) { if (mci->mci_errno == 0) @@ -3116,6 +3133,7 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype) if (strncmp(SmtpMsgBuffer, "QUIT", 4) == 0) { errno = mci->mci_errno; + mci->mci_state = MCIS_CLOSED; return -1; } mci->mci_state = MCIS_ERROR; @@ -3139,7 +3157,10 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype) /* errors on QUIT should be ignored */ if (strncmp(SmtpMsgBuffer, "QUIT", 4) == 0) + { + mci->mci_state = MCIS_CLOSED; return -1; + } /* if the remote end closed early, fake an error */ errno = save_errno; diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c index 6945e64..e7a3ff0 100644 --- a/contrib/sendmail/src/util.c +++ b/contrib/sendmail/src/util.c @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: util.c,v 8.382 2004/03/26 19:01:10 ca Exp $") +SM_RCSID("@(#)$Id: util.c,v 8.383 2004/08/02 18:50:59 ca Exp $") #include <sysexits.h> #include <sm/xtrap.h> @@ -93,7 +93,8 @@ addquotes(s, rpool) } /* -** STRIPBACKSLASH -- Strip leading backslash from a string. +** STRIPBACKSLASH -- Strip all leading backslashes from a string, provided +** the following character is alpha-numerical. ** ** This is done in place. ** diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c index 6ea57aa..af2baa2 100644 --- a/contrib/sendmail/src/version.c +++ b/contrib/sendmail/src/version.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2005 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.130 2004/07/30 18:03:07 ca Exp $") +SM_RCSID("@(#)$Id: version.c,v 8.140 2005/01/12 04:32:32 ca Exp $") -char Version[] = "8.13.1"; +char Version[] = "8.13.3"; diff --git a/contrib/sendmail/vacation/vacation.c b/contrib/sendmail/vacation/vacation.c index 45aeba1..afccbf7 100644 --- a/contrib/sendmail/vacation/vacation.c +++ b/contrib/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, "@(#)$Id: vacation.c,v 8.141 2002/11/01 16:49:40 ca Exp $") +SM_IDSTR(id, "@(#)$Id: vacation.c,v 8.142 2004/11/02 18:25:33 ca Exp $") #include <ctype.h> @@ -78,6 +78,7 @@ ALIAS *Names = NULL; SMDB_DATABASE *Db; char From[MAXLINE]; +bool CloseMBDB = false; #if defined(__hpux) || defined(__osf__) # ifndef SM_CONF_SYSLOG_INT @@ -100,17 +101,27 @@ static void eatmsg __P((void)); static void listdb __P((void)); /* exit after reading input */ -#define EXITIT(excode) \ -{ \ - eatmsg(); \ - return excode; \ +#define EXITIT(excode) \ +{ \ + eatmsg(); \ + if (CloseMBDB) \ + { \ + sm_mbdb_terminate(); \ + CloseMBDB = false; \ + } \ + return excode; \ } -#define EXITM(excode) \ -{ \ - if (!initdb && !list) \ - eatmsg(); \ - exit(excode); \ +#define EXITM(excode) \ +{ \ + if (!initdb && !list) \ + eatmsg(); \ + if (CloseMBDB) \ + { \ + sm_mbdb_terminate(); \ + CloseMBDB = false; \ + } \ + exit(excode); \ } int @@ -330,6 +341,7 @@ main(argc, argv) sm_strexit(err)); EXITM(err); } + CloseMBDB = true; err = sm_mbdb_lookup(*argv, &user); if (err == EX_NOUSER) { |