diff options
author | jnemeth <jnemeth@pkgsrc.org> | 2014-06-15 20:48:49 +0000 |
---|---|---|
committer | jnemeth <jnemeth@pkgsrc.org> | 2014-06-15 20:48:49 +0000 |
commit | 73266bba8391ffa99f8ef9daf05b58a185c8d61c (patch) | |
tree | 6203588e7676b464e5b1b7edc2ac805d5fdd82b2 /mail/sendmail | |
parent | 1f47fc179d64b57d40855af38d9c113344998ddb (diff) | |
download | pkgsrc-73266bba8391ffa99f8ef9daf05b58a185c8d61c.tar.gz |
Update to sendmail 8.14.9: this fixes a minor potential security issue
pkgsrc changes:
- consolidate several patches into site.config.m4
- pkgsrc LDFLAGS should always be used
- don't bother specifying file owner/group anywhere except in Makefile
- create include/sm/os/sm_os_netbsd.h to fix warnings and OS specific stuff
- install mail.local and rmail
- convert to use res_n* functions
- allows for linking against threaded libraries
- add a TODO file
- PR/35249 - Loren M. Lang
- can't find libraries on Linux, this should be fixed by using pkgsrc LDFLAGS
- PR/46694 - Makoto Fujiwara
- bring back netbsd-proto.mc from when sendmail was part of the base system
- PR/47207 - Richard Palo
- let pkgsrc infrastructure handle file ownership and group
- PR/48566 - Emmanuel Dreyfus
- always set _FFR_USE_GETPWNAM_ERRNO on NetBSD
- roll ffr_tls_1 and the suggested ffr_tls_ec into one new ffr_tls option
- not enabled by default because it changes behaviour
8.14.9/8.14.9 2014/05/21
SECURITY: Properly set the close-on-exec flag for file descriptors
(except stdin, stdout, and stderr) before executing mailers.
Fix a misformed comment in conf.c: "/*" within comment
which may cause a compilation error on some systems.
Problem reported by John Beck of Oracle.
DEVTOOLS: Fix regression in auto-detection of libraries when only
shared libraries are available. Problem reported by
Bryan Costales.
Diffstat (limited to 'mail/sendmail')
35 files changed, 894 insertions, 137 deletions
diff --git a/mail/sendmail/Makefile b/mail/sendmail/Makefile index 61c81f9b840..21929b69514 100644 --- a/mail/sendmail/Makefile +++ b/mail/sendmail/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.120 2014/05/10 14:38:26 richard Exp $ +# $NetBSD: Makefile,v 1.121 2014/06/15 20:48:49 jnemeth Exp $ PKGNAME= sendmail-${DIST_VERS} -PKGREVISION= 1 COMMENT= The well known Mail Transport Agent CONFLICTS+= courier-mta-[0-9]* fastforward>=0.51nb2 postfix-[0-9]* @@ -33,7 +32,8 @@ PKG_GROUPS= smmsp PKG_USERS= smmsp:smmsp PKG_GECOS.smmsp= Sendmail Message Submission Program -SUBST_CLASSES+= paths +SUBST_CLASSES+= paths cf-paths + SUBST_STAGE.paths= pre-configure SUBST_FILES.paths= ../mailer.conf smrsh/smrsh.8 cf/cf/Makefile SUBST_SED.paths+= -e "s|@@BINGRP@@|${BINGRP}|g" @@ -43,13 +43,41 @@ SUBST_SED.paths+= -e "s|@@PREFIX@@|${PREFIX}|g" SUBST_SED.paths+= -e "s|@@SMRSH_CMDDIR@@|${SMRSH_CMDDIR}|g" SUBST_MESSAGE.paths= Fixing paths. +SUBST_STAGE.cf-paths= pre-build +.for f in cf/README cf/cf/generic-bsd4.4.cf cf/cf/generic-hpux10.cf \ + cf/cf/generic-hpux9.cf cf/cf/generic-linux.cf \ + cf/cf/generic-mpeix.cf cf/cf/generic-nextstep3.3.cf \ + cf/cf/generic-osf1.cf cf/cf/generic-solaris.cf \ + cf/cf/generic-sunos4.1.cf cf/cf/generic-ultrix4.cf \ + cf/cf/knecht.mc cf/cf/submit.cf cf/feature/local_lmtp.m4 \ + cf/feature/msp.m4 cf/feature/smrsh.m4 cf/m4/proto.m4 \ + cf/mailer/pop.m4 cf/mailer/usenet.m4 cf/ostype/a-ux.m4 \ + cf/ostype/aix3.m4 cf/ostype/aix4.m4 cf/ostype/aix5.m4 \ + cf/ostype/amdahl-uts.m4 cf/ostype/darwin.m4 cf/ostype/dgux.m4 \ + cf/ostype/domainos.m4 cf/ostype/dragonfly.m4 \ + cf/ostype/dynix3.2.m4 cf/ostype/freebsd4.m4 \ + cf/ostype/freebsd5.m4 cf/ostype/freebsd6.m4 cf/ostype/hpux10.m4 \ + cf/ostype/irix4.m4 cf/ostype/irix5.m4 cf/ostype/irix6.m4 \ + cf/ostype/isc4.1.m4 cf/ostype/maxion.m4 cf/ostype/nextstep.m4 \ + cf/ostype/openbsd.m4 cf/ostype/ptx2.m4 cf/ostype/riscos4.5.m4 \ + cf/ostype/sco-uw-2.1.m4 cf/ostype/sco3.2.m4 cf/ostype/sinix.m4 \ + cf/ostype/solaris11.m4 cf/ostype/solaris2.m4 \ + cf/ostype/solaris2.ml.m4 cf/ostype/solaris2.pre5.m4 \ + cf/ostype/solaris8.m4 cf/ostype/sunos3.5.m4 \ + cf/ostype/sunos4.1.m4 cf/ostype/ultrix4.m4 cf/ostype/unicos.m4 \ + cf/ostype/unicosmk.m4 cf/ostype/unicosmp.m4 \ + cf/ostype/unixware7.m4 +SUBST_FILES.cf-paths+= ${f} +.endfor +SUBST_SED.cf-paths+= -e "s|/var/spool|${VARBASE}/spool|g" +SUBST_SED.cf-paths+= -e "s|/var/run|${VARBASE}/run|g" +SUBST_SED.cf-paths+= -e "s|/usr/libexec|${PREFIX}/libexec/sendmail|g" +SUBST_SED.cf-paths+= -e "s|/usr/lib|${PREFIX}/libexec/sendmail|g" +SUBST_SED.cf-paths+= -e "s|/system/volatile|${VARBASE}/run|g" + REPLACE_PERL= contrib/socketmapClient.pl contrib/socketmapServer.pl -INSTALLATION_DIRS+= bin lib sbin -INSTALLATION_DIRS+= ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${PKGMANDIR}/man8 -INSTALLATION_DIRS+= ${PREFIX}/libexec/sendmail ${SMRSH_CMDDIR} -INSTALLATION_DIRS+= ${PREFIX}/share/examples/sendmail -INSTALLATION_DIRS+= ${PREFIX}/share/sendmail ${PREFIX}/share/doc/sendmail +AUTO_MKDIRS= yes post-patch: make-sendmail-siteconfig .if !empty(PKG_OPTIONS:Mtcpwrappers) @@ -67,8 +95,8 @@ post-patch: make-sendmail-siteconfig .if !empty(PKG_OPTIONS:Mtls) cat ${FILESDIR}/site.config.m4-starttls >>${SITECONFIG} .endif -.if !empty(PKG_OPTIONS:Mffr_tls_1) - cat ${FILESDIR}/site.config.m4-ffr_tls_1 >>${SITECONFIG} +.if !empty(PKG_OPTIONS:Mffr_tls) + cat ${FILESDIR}/site.config.m4-ffr_tls >>${SITECONFIG} .endif .if !empty(PKG_OPTIONS:Msasl) cat ${FILESDIR}/site.config.m4-sasl2 >>${SITECONFIG} @@ -79,15 +107,20 @@ post-extract: do-build: (cd ${WRKSRC} && env ${MAKE_ENV} ./Build) + (cd ${WRKSRC}/cf/cf && env ${MAKE_ENV} ./Build) post-build: cp ${PKGDIR}/MESSAGE ${MESSAGE_SRC} cp ${PKGDIR}/PLIST ${WRKDIR}/.PLIST_SRC post-install: + (cd ${WRKSRC}/mail.local && env ${INSTALL_ENV} ${MAKE_ENV} ./Build force-install) + (cd ${WRKSRC}/rmail && env ${INSTALL_ENV} ${MAKE_ENV} ./Build force-install) + ${INSTALL_DATA} ${WRKDIR}/mailer.conf \ ${DESTDIR}${PREFIX}/share/examples/sendmail/ cd ${WRKSRC}/cf && pax -rw -pp -pm -s',^.*\.orig$$,,' . ${DESTDIR}${PREFIX}/share/sendmail + cp ${FILESDIR}/netbsd-proto.mc ${DESTDIR}${PREFIX}/share/sendmail/cf ${INSTALL_DATA} ${WRKSRC}/obj.`${UNAME} -srm | tr \ . | tr \/ - | sed s/sun4./sun4/`/libsm/libsm.a \ ${DESTDIR}${PREFIX}/lib diff --git a/mail/sendmail/Makefile.common b/mail/sendmail/Makefile.common index 56a567e90e1..8f6b4d53952 100644 --- a/mail/sendmail/Makefile.common +++ b/mail/sendmail/Makefile.common @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.common,v 1.60 2014/05/10 14:38:26 richard Exp $ +# $NetBSD: Makefile.common,v 1.61 2014/06/15 20:48:49 jnemeth Exp $ # # used by mail/libmilter/Makefile # used by mail/sendmail/Makefile @@ -20,7 +20,9 @@ DISTINFO_FILE= ${.CURDIR}/../../mail/sendmail/distinfo FILESDIR= ${.CURDIR}/../../mail/sendmail/files PATCHDIR= ${.CURDIR}/../../mail/sendmail/patches -DIST_VERS= 8.14.8 +USE_LANGUAGES= c99 + +DIST_VERS= 8.14.9 MAKE_ENV+= BSD_BINOWN=${BINOWN} BSD_BINGRP=${BINGRP} \ BSD_MANOWN=${MANOWN} BSD_MANGRP=${MANGRP} \ @@ -40,6 +42,9 @@ MAKE_ENV+= M4=${TOOLS_M4} CFLAGS+= -DSOLARIS_HAS_PATHS_H .endif +pre-configure: + cp ${FILESDIR}/sm_os_netbsd.h ${WRKSRC}/include/sm/os/sm_os_netbsd.h + .PHONY: make-sendmail-siteconfig make-sendmail-siteconfig: ${CP} ${FILESDIR}/site.config.m4 ${SITECONFIG} @@ -52,7 +57,11 @@ make-sendmail-siteconfig: ${CAT} ${FILESDIR}/site.config.m4-v6-not-solaris >>${SITECONFIG} . endif .endif + ${CAT} ${FILESDIR}/site.config.m4-milter >>${SITECONFIG} .if ${OPSYS} == "SunOS" ${CAT} ${FILESDIR}/site.config.m4-libresolv >>${SITECONFIG} +. if exists(/usr/include/stdbool.h) + ${CAT} ${FILESDIR}/site.config.m4-stdbool >>${SITECONFIG} +. endif .endif diff --git a/mail/sendmail/PLIST b/mail/sendmail/PLIST index a7e43446956..0d4138c81da 100644 --- a/mail/sendmail/PLIST +++ b/mail/sendmail/PLIST @@ -1,11 +1,13 @@ -@comment $NetBSD: PLIST,v 1.19 2014/03/11 14:05:05 jperkin Exp $ +@comment $NetBSD: PLIST,v 1.20 2014/06/15 20:48:49 jnemeth Exp $ bin/hoststat bin/mailq bin/newaliases bin/purgestat +bin/rmail bin/vacation lib/libsm.a lib/libsmutil.a +libexec/sendmail/mail.local libexec/sendmail/sendmail libexec/sendmail/smrsh man/man1/mailq.1 @@ -13,9 +15,11 @@ man/man1/newaliases.1 man/man1/vacation.1 man/man5/aliases.5 man/man8/editmap.8 +man/man8/mail.local.8 man/man8/mailstats.8 man/man8/makemap.8 man/man8/praliases.8 +man/man8/rmail.8 man/man8/sendmail.8 man/man8/smrsh.8 sbin/editmap @@ -65,10 +69,12 @@ share/sendmail/cf/generic-sunos4.1.mc share/sendmail/cf/generic-ultrix4.cf share/sendmail/cf/generic-ultrix4.mc share/sendmail/cf/huginn.cs.mc +share/sendmail/cf/knecht.cf share/sendmail/cf/knecht.mc share/sendmail/cf/mail.cs.mc share/sendmail/cf/mail.eecs.mc share/sendmail/cf/mailspool.cs.mc +share/sendmail/cf/netbsd-proto.mc share/sendmail/cf/python.cs.mc share/sendmail/cf/s2k-osf1.mc share/sendmail/cf/s2k-ultrix4.mc diff --git a/mail/sendmail/TODO b/mail/sendmail/TODO new file mode 100644 index 00000000000..4a86d42b22e --- /dev/null +++ b/mail/sendmail/TODO @@ -0,0 +1,6 @@ +$NetBSD: TODO,v 1.1 2014/06/15 20:48:49 jnemeth Exp $ + +- get helpfile installed somewhere useful + - alternatively, adjust default "O HelpFile" +- install sample aliases somewhere +- look into using ${LOCALBASE}/etc/mail instead of /etc/mail diff --git a/mail/sendmail/distinfo b/mail/sendmail/distinfo index d6119bb117e..b015e6e6ec5 100644 --- a/mail/sendmail/distinfo +++ b/mail/sendmail/distinfo @@ -1,18 +1,24 @@ -$NetBSD: distinfo,v 1.50 2014/02/09 02:02:46 jnemeth Exp $ +$NetBSD: distinfo,v 1.51 2014/06/15 20:48:49 jnemeth Exp $ -SHA1 (sendmail.8.14.8.tar.gz) = dabe370ff9c6a95039e4e58e4e2a67ab48f8b9b5 -RMD160 (sendmail.8.14.8.tar.gz) = cd6a3c9a9cd154dcbff186c9391f038c72cc56c9 -Size (sendmail.8.14.8.tar.gz) = 2114959 bytes -SHA1 (patch-aa) = d58a1e2415a8fb1423536c58b460c0a49e0de2be -SHA1 (patch-ab) = a2abf6e78772e257e2a1973e7730159ff24a91aa -SHA1 (patch-ac) = 96c19300b4188dbcbd202768eea912f675dadc27 -SHA1 (patch-ad) = 7232cc7ceb46a2dbf631d61185e4c6ca4af18a13 -SHA1 (patch-ae) = ae06caa125fe4d4fc85123dc0a5d0016cd099ebd -SHA1 (patch-af) = f1fb00d9d27f512c550ad7dbcd014563122488b5 +SHA1 (sendmail.8.14.9.tar.gz) = fcf92eb0c119da1593ccda96ee24b4d0b0b21fd7 +RMD160 (sendmail.8.14.9.tar.gz) = da36f900a94c9300521a60bf917ed3e5d6c88d1e +Size (sendmail.8.14.9.tar.gz) = 2114293 bytes +SHA1 (patch-aa) = bd1ab754f7146d002eaf8c0347e114b4049a7776 +SHA1 (patch-af) = bd3e26b0e78eadd610713430ae6deac888176442 SHA1 (patch-ag) = f76de45c7e8d16207670e151265b7edbca4c045c SHA1 (patch-ah) = e6be09008b9230ffdd1560aaacbdbb2ee4fb8028 -SHA1 (patch-ai) = aca71358618e8c1dc785a8b2dc049b97232b8795 +SHA1 (patch-ai) = 0bd3676dce988cf1167fae09443da0d1a1363abb SHA1 (patch-aj) = e65e6fe44380de2f9c397c1a97677eb4ad285433 -SHA1 (patch-al) = f5d8cef8c4abba5d5ae813b754c16037190a7ef1 -SHA1 (patch-am) = d84eedbff0f037c1db341255dc9e1877866f12c7 SHA1 (patch-an) = 82d2df0c609099f295eb00f1f5e19391ae97833c +SHA1 (patch-ao) = 88dd76b71ad57a8d0efdb6e8518ff01689ecf634 +SHA1 (patch-ap) = 9c83d9ed1b4d8c851c106597638763515923a4ab +SHA1 (patch-aq) = 722382daf085ac2f4a06d0c812bb00f49bcdfd2c +SHA1 (patch-ar) = d68984a057d7a0a674a8d46cf903585c8279f7a8 +SHA1 (patch-as) = 652b107d5f68507a0b2fb7c5402186eff96c6bc0 +SHA1 (patch-at) = 7c206df88d29671faef950276a5119ef2f525f4b +SHA1 (patch-au) = 08449c9c00cc0161af94a4994abf1d12b5785dcb +SHA1 (patch-av) = 1b6bd4547930507ab67427bcf8a390c0afce0fb0 +SHA1 (patch-aw) = f1089cb4d97580097ed0449a448f1cbd874aedd9 +SHA1 (patch-ax) = adba9177404e10d5f461e1e8f0c4dd5840d78dd1 +SHA1 (patch-ay) = 5e003a2c5ec9c42556b7c2fe141ff65c86345029 +SHA1 (patch-az) = e067d46657593348e7df912d1d54c02c0dfd54ed diff --git a/mail/sendmail/files/netbsd-proto.mc b/mail/sendmail/files/netbsd-proto.mc new file mode 100644 index 00000000000..31733b82bc8 --- /dev/null +++ b/mail/sendmail/files/netbsd-proto.mc @@ -0,0 +1,66 @@ +# $NetBSD: netbsd-proto.mc,v 1.1 2014/06/15 20:48:49 jnemeth Exp $ + +divert(-1) +# +# Copyright (c) 1994 Adam Glass +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# +# This is the prototype file for a configuration that supports SMTP +# connections via TCP and some commonly required features. +# + +include(`../m4/cf.m4') +VERSIONID(`@(#)netbsd-proto.mc $Revision: 1.1 $') +OSTYPE(bsd4.4)dnl +DOMAIN(generic)dnl +FEATURE(genericstable,DATABASE_MAP_TYPE` -o 'MAIL_SETTINGS_DIR`genericstable') +FEATURE(mailertable, DATABASE_MAP_TYPE` -o 'MAIL_SETTINGS_DIR`mailertable') +FEATURE(virtusertable,DATABASE_MAP_TYPE` -o 'MAIL_SETTINGS_DIR`virtusertable') +FEATURE(domaintable, DATABASE_MAP_TYPE` -o 'MAIL_SETTINGS_DIR`domaintable') +FEATURE(access_db, DATABASE_MAP_TYPE` -T<TMPF> -o 'MAIL_SETTINGS_DIR`access') +FEATURE(`redirect') +FEATURE(`no_default_msa') +MAILER(local)dnl +MAILER(smtp)dnl + +# Enable port 587 also to serve as local submission server +DAEMON_OPTIONS(`Family=inet, address=127.0.0.1, Name=MTA, Modifiers=O, Port=smtp')dnl +DAEMON_OPTIONS(`Family=inet, address=127.0.0.1, Name=MSA, Modifiers=O, Port=submission')dnl +# Enable IPv6. IPv6 is marked as optional so the configuration file +# can be used on IPV4-only kernel as well. +DAEMON_OPTIONS(`Family=inet6, address=::1, Name=MTA6, Modifiers=O, Port=smtp')dnl +DAEMON_OPTIONS(`Family=inet6, address=::1, Name=MSA6, Modifiers=O, Port=submission')dnl +# Above setup is outgoing service only, replace +# 127.0.0.1 by 0.0.0.0 and ::1 by :: to accept incoming mails. diff --git a/mail/sendmail/files/sendmail.sh b/mail/sendmail/files/sendmail.sh index 2a255f77b41..0c504685707 100755 --- a/mail/sendmail/files/sendmail.sh +++ b/mail/sendmail/files/sendmail.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: sendmail.sh,v 1.2 2012/07/27 17:46:01 jnemeth Exp $ +# $NetBSD: sendmail.sh,v 1.3 2014/06/15 20:48:49 jnemeth Exp $ # # PROVIDE: mail @@ -13,7 +13,6 @@ name="sendmail" rcvar=$name -command="/usr/sbin/${name}" pidfile="@VARBASE@/run/${name}.pid" required_files="/etc/mail/sendmail.cf" start_precmd="sendmail_precmd" @@ -24,6 +23,7 @@ newaliases="@PREFIX@/bin/newaliases" smbin="@PREFIX@/libexec/sendmail/sendmail" check_files="aliases access genericstable virtusertable domaintable mailertable" sendmail_flags="-Lsm-mta -bd -q30m" +command=$smbin sendmail_precmd() { diff --git a/mail/sendmail/files/site.config.m4 b/mail/sendmail/files/site.config.m4 index 26bbdd445d4..c1f8ab14713 100644 --- a/mail/sendmail/files/site.config.m4 +++ b/mail/sendmail/files/site.config.m4 @@ -1,4 +1,4 @@ -# $NetBSD: site.config.m4,v 1.10 2009/12/16 09:46:36 jnemeth Exp $ +# $NetBSD: site.config.m4,v 1.11 2014/06/15 20:48:49 jnemeth Exp $ # pathnames specific to pkgsrc # @@ -17,19 +17,13 @@ define(`confMAN4EXT', `4') define(`confMAN5EXT', `5') define(`confMAN8EXT', `8') APPENDDEF(`confENVDEF', `-I${PREFIX}/include -DSMRSH_CMDDIR=\"${SMRSH_CMDDIR}\"') -APPENDDEF(`confLIBS', `-L${PREFIX}/lib') +define(`confLDOPTS', `${LDFLAGS}') APPENDDEF(`confMAPDEF', `-DSOCKETMAP') # the following are handled by pkgsrc define(`confINST_DEP',`') define(`confNO_STATISTICS_INSTALL') -# set file ownership to pkgsrc default -define(`confLIBOWN', `${BINOWN}') -define(`confLIBGRP', `${BINGRP}') -define(`confINCOWN', `${SHAREOWN}') -define(`confINCGRP', `${SHAREGRP}') - # have libmilter use poll(2) instead of select(2) # XXX all supported systems should support poll(2), if one is discovered # that doesn't, we can revisit this diff --git a/mail/sendmail/files/site.config.m4-ffr_tls b/mail/sendmail/files/site.config.m4-ffr_tls new file mode 100644 index 00000000000..9baf7c13d94 --- /dev/null +++ b/mail/sendmail/files/site.config.m4-ffr_tls @@ -0,0 +1,5 @@ +# $NetBSD: site.config.m4-ffr_tls,v 1.1 2014/06/15 20:48:49 jnemeth Exp $ + +# enable _FFR_TLS_1 +APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_TLS_1') +APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_TLS_EC') diff --git a/mail/sendmail/files/site.config.m4-ffr_tls_1 b/mail/sendmail/files/site.config.m4-ffr_tls_1 deleted file mode 100644 index 0d2ec4f6cde..00000000000 --- a/mail/sendmail/files/site.config.m4-ffr_tls_1 +++ /dev/null @@ -1,4 +0,0 @@ -# $NetBSD: site.config.m4-ffr_tls_1,v 1.1 2013/09/19 10:54:05 manu Exp $ - -# enable _FFR_TLS_1 -APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_TLS_1') diff --git a/mail/sendmail/files/site.config.m4-stdbool b/mail/sendmail/files/site.config.m4-stdbool new file mode 100644 index 00000000000..acda05c3d63 --- /dev/null +++ b/mail/sendmail/files/site.config.m4-stdbool @@ -0,0 +1,4 @@ +# $NetBSD: site.config.m4-stdbool,v 1.1 2014/06/15 20:48:49 jnemeth Exp $ + +# PM: stdbool.h on SunOS needs -std=c99 +APPENDDEF(`confENVDEF', `-DSM_CONF_STDBOOL_H=1') diff --git a/mail/sendmail/files/sm_os_netbsd.h b/mail/sendmail/files/sm_os_netbsd.h new file mode 100644 index 00000000000..aa1c5ee01cf --- /dev/null +++ b/mail/sendmail/files/sm_os_netbsd.h @@ -0,0 +1,29 @@ +/* + * $NetBSD: sm_os_netbsd.h,v 1.1 2014/06/15 20:48:49 jnemeth Exp $ + */ + +/* +** Platform definitions for NetBSD +*/ + +#define SM_OS_NAME "netbsd" + +#define SM_CONF_SYS_CDEFS_H 1 + +#include <sys/param.h> /* defines __NetBSD_version__ */ +#if __NetBSD_version__ >= 104000300 + /* 1.4.3 and later have strlcpy()/strlcat() */ +# ifndef SM_CONF_STRL +# define SM_CONF_STRL 1 +# endif +#endif + +#ifndef SM_CONF_SHM +# define SM_CONF_SHM 1 +#endif /* SM_CONF_SHM */ +#ifndef SM_CONF_SEM +# define SM_CONF_SEM 0 +#endif /* SM_CONF_SEM */ +#ifndef SM_CONF_MSG +# define SM_CONF_MSG 1 +#endif /* SM_CONF_MSG */ diff --git a/mail/sendmail/files/smmsp.sh b/mail/sendmail/files/smmsp.sh index b0ed1d7091b..4a561c97f57 100755 --- a/mail/sendmail/files/smmsp.sh +++ b/mail/sendmail/files/smmsp.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: smmsp.sh,v 1.2 2012/07/27 17:46:01 jnemeth Exp $ +# $NetBSD: smmsp.sh,v 1.3 2014/06/15 20:48:49 jnemeth Exp $ # # REQUIRE: mail @@ -18,13 +18,13 @@ name="smmsp" rcvar=$name -command="/usr/sbin/sendmail" pidfile="@VARBASE@/spool/clientmqueue/sm-client.pid" required_files="/etc/mail/submit.cf" extra_commands="reload" smbin="@PREFIX@/libexec/sendmail/sendmail" smmsp_flags="-Lsm-msp-queue -Ac -q30m" +command=$smbin load_rc_config $name run_rc_command "$1" diff --git a/mail/sendmail/options.mk b/mail/sendmail/options.mk index 4205b114017..313439e5446 100644 --- a/mail/sendmail/options.mk +++ b/mail/sendmail/options.mk @@ -1,18 +1,20 @@ -# $NetBSD: options.mk,v 1.20 2013/09/19 10:54:05 manu Exp $ +# $NetBSD: options.mk,v 1.21 2014/06/15 20:48:49 jnemeth Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.sendmail -PKG_SUPPORTED_OPTIONS= inet6 db2 ldap sasl tls tcpwrappers ffr_tls_1 +PKG_SUPPORTED_OPTIONS= inet6 db2 db4 ldap sasl tls tcpwrappers ffr-tls PKG_SUGGESTED_OPTIONS= inet6 tcpwrappers -PKG_OPTIONS_LEGACY_OPTS+= starttls:tls +PKG_OPTIONS_LEGACY_OPTS+= starttls:tls ffr_tls_1:ffr-tls .include "../../mk/bsd.options.mk" ### -### Berkeley DB version 2 format for on disk databases e.g. aliases +### Berkeley DB version 2/4 format for on disk databases e.g. aliases ### .if !empty(PKG_OPTIONS:Mdb2) . include "../../databases/db/buildlink3.mk" +.elif !empty(PKG_OPTIONS:Mdb4) +. include "../../databases/db4/buildlink3.mk" .endif ### @@ -37,7 +39,7 @@ PKG_OPTIONS_LEGACY_OPTS+= starttls:tls .endif ### -### 'For Future Release' FFR_TLS_1 options: CipherList, multiple certs +### 'For Future Release' FFR_TLS_* options: CipherList, multiple certs ### # Nothing to do here, activation is done in Makefile diff --git a/mail/sendmail/patches/patch-aa b/mail/sendmail/patches/patch-aa index d596f51aeb4..9a97251b55f 100644 --- a/mail/sendmail/patches/patch-aa +++ b/mail/sendmail/patches/patch-aa @@ -1,27 +1,22 @@ -$NetBSD: patch-aa,v 1.20 2013/03/23 10:06:12 joerg Exp $ +$NetBSD: patch-aa,v 1.21 2014/06/15 20:48:50 jnemeth Exp $ ---- devtools/OS/NetBSD.orig 2004-06-16 17:50:00.000000000 +0000 +--- devtools/OS/NetBSD.orig 2014-03-06 17:31:29.000000000 +0000 +++ devtools/OS/NetBSD -@@ -5,15 +5,16 @@ dnl Place personal settings in devtools/ +@@ -5,15 +5,11 @@ dnl Place personal settings in devtools/ define(`confMAPDEF', `-DNEWDB -DNIS -DMAP_REGEX') define(`confLIBS', `-lutil') -define(`confENVDEF', ` -DNETISO') -+define(`confENVDEF', ` -DSM_CONF_STDBOOL_H=1') ++define(`confSM_OS_HEADER', `sm_os_netbsd') define(`confDEPEND_TYPE', `CC-M') -define(`confSBINGRP', `wheel') -define(`confUBINOWN', `root') -define(`confUBINGRP', `wheel') -define(`confMANOWN', `root') -define(`confMANGRP', `wheel') -+define(`confSBINGRP', `${BSD_BINGRP}') -+define(`confUBINOWN', `${BSD_BINOWN}') -+define(`confUBINGRP', `${BSD_BINGRP}') -+define(`confMANOWN', `${BSD_MANOWN}') -+define(`confMANGRP', `${BSD_MANGRP}') define(`confMAN1EXT', `0') define(`confMAN3EXT', `0') define(`confMAN4EXT', `0') define(`confMAN5EXT', `0') define(`confMAN8EXT', `0') -+define(`confLDOPTS', `${LDFLAGS}') ++define(`conf_sendmail_ENVDEF', `-D_FFR_USE_GETPWNAM_ERRNO=1') diff --git a/mail/sendmail/patches/patch-ab b/mail/sendmail/patches/patch-ab deleted file mode 100644 index 0dda084aaad..00000000000 --- a/mail/sendmail/patches/patch-ab +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-ab,v 1.12 2002/09/23 12:57:00 markd Exp $ - ---- devtools/OS/SunOS.5.6.orig Fri Mar 22 11:59:26 2002 -+++ devtools/OS/SunOS.5.6 Mon Sep 16 15:05:30 2002 -@@ -11,6 +11,7 @@ - define(`confENVDEF', `-DSOLARIS=20600') - define(`confSM_OS_HEADER', `sm_os_sunos') - define(`confLIBS', `-lsocket -lnsl -lkstat') -+define(`confLDOPTS', `${LDFLAGS}') - define(`confMTCCOPTS', `-D_REENTRANT') - define(`confMTLDOPTS', `-lpthread') - define(`confMBINDIR', `/usr/lib') diff --git a/mail/sendmail/patches/patch-ac b/mail/sendmail/patches/patch-ac deleted file mode 100644 index 851b005737a..00000000000 --- a/mail/sendmail/patches/patch-ac +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-ac,v 1.6 2002/09/23 12:57:00 markd Exp $ - ---- devtools/OS/SunOS.5.7.orig Fri Mar 22 11:59:26 2002 -+++ devtools/OS/SunOS.5.7 Mon Sep 16 15:07:08 2002 -@@ -11,6 +11,7 @@ - define(`confENVDEF', `-DSOLARIS=20700') - define(`confSM_OS_HEADER', `sm_os_sunos') - define(`confLIBS', `-lsocket -lnsl') -+define(`confLDOPTS', `${LDFLAGS}') - define(`confMTCCOPTS', `-D_REENTRANT') - define(`confMTLDOPTS', `-lpthread') - define(`confMBINDIR', `/usr/lib') diff --git a/mail/sendmail/patches/patch-ad b/mail/sendmail/patches/patch-ad deleted file mode 100644 index da81a3aab04..00000000000 --- a/mail/sendmail/patches/patch-ad +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-ad,v 1.7 2002/09/23 12:57:01 markd Exp $ - ---- devtools/OS/SunOS.5.8.orig Fri Mar 22 11:59:26 2002 -+++ devtools/OS/SunOS.5.8 Mon Sep 16 15:09:28 2002 -@@ -10,6 +10,7 @@ - define(`confENVDEF', `-DSOLARIS=20800 -DNETINET6') - define(`confSM_OS_HEADER', `sm_os_sunos') - define(`confLIBS', `-lsocket -lnsl') -+define(`confLDOPTS', `${LDFLAGS}') - define(`confMTCCOPTS', `-D_REENTRANT') - define(`confMTLDOPTS', `-lpthread') - define(`confMBINDIR', `/usr/lib') diff --git a/mail/sendmail/patches/patch-ae b/mail/sendmail/patches/patch-ae deleted file mode 100644 index 7a607669353..00000000000 --- a/mail/sendmail/patches/patch-ae +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-ae,v 1.5 2002/09/23 12:57:01 markd Exp $ - ---- devtools/OS/SunOS.5.9.orig Fri Mar 22 11:59:26 2002 -+++ devtools/OS/SunOS.5.9 Mon Sep 16 15:11:10 2002 -@@ -10,6 +10,7 @@ - define(`confENVDEF', `-DSOLARIS=20900 -DNETINET6') - define(`confSM_OS_HEADER', `sm_os_sunos') - define(`confLIBS', `-lsocket -lnsl') -+define(`confLDOPTS', `${LDFLAGS}') - define(`confMTCCOPTS', `-D_REENTRANT') - define(`confMTLDOPTS', `-lpthread') - define(`confMBINDIR', `/usr/lib') diff --git a/mail/sendmail/patches/patch-af b/mail/sendmail/patches/patch-af index f2d79eed364..1a4a7ad42a6 100644 --- a/mail/sendmail/patches/patch-af +++ b/mail/sendmail/patches/patch-af @@ -1,8 +1,36 @@ -$NetBSD: patch-af,v 1.11 2007/04/26 06:26:27 jnemeth Exp $ +$NetBSD: patch-af,v 1.12 2014/06/15 20:48:50 jnemeth Exp $ ---- sendmail/conf.c.orig 2007-04-03 14:32:29.000000000 -0700 +--- sendmail/conf.c.orig 2014-05-20 17:24:39.000000000 +0000 +++ sendmail/conf.c -@@ -4393,7 +4393,8 @@ sm_gethostbyaddr(addr, len, type) +@@ -43,6 +43,10 @@ SM_RCSID("@(#)$Id: conf.c,v 8.1191 2014- + # include <ulimit.h> + #endif /* HASULIMIT && defined(HPUX11) */ + ++#if !HAS_GETHOSTBYNAME2 ++extern struct __res_state sm_res; ++#endif ++ + static void setupmaps __P((void)); + static void setupmailers __P((void)); + static void setupqueues __P((void)); +@@ -4242,13 +4246,13 @@ sm_getipnodebyname(name, family, flags, + if (family == AF_INET6) + { + /* From RFC2133, section 6.1 */ +- resv6 = bitset(RES_USE_INET6, _res.options); +- _res.options |= RES_USE_INET6; ++ resv6 = bitset(RES_USE_INET6, sm_res.options); ++ sm_res.options |= RES_USE_INET6; + } + SM_SET_H_ERRNO(0); + h = gethostbyname(name); + if (!resv6) +- _res.options &= ~RES_USE_INET6; ++ sm_res.options &= ~RES_USE_INET6; + + /* the function is supposed to return only the requested family */ + if (h != NULL && h->h_addrtype != family) +@@ -4463,7 +4467,8 @@ sm_gethostbyaddr(addr, len, type) #if NETINET6 if (type == AF_INET6 && diff --git a/mail/sendmail/patches/patch-ai b/mail/sendmail/patches/patch-ai index cb8fb8d0722..bd7db9b2ec1 100644 --- a/mail/sendmail/patches/patch-ai +++ b/mail/sendmail/patches/patch-ai @@ -1,8 +1,8 @@ -$NetBSD: patch-ai,v 1.8 2008/06/14 08:58:06 tron Exp $ +$NetBSD: patch-ai,v 1.9 2014/06/15 20:48:50 jnemeth Exp $ ---- sendmail/mci.c.orig 2007-11-13 23:44:25.000000000 +0000 -+++ sendmail/mci.c 2008-06-08 15:28:50.000000000 +0100 -@@ -20,6 +20,7 @@ +--- sendmail/mci.c.orig 2014-03-06 17:31:31.000000000 +0000 ++++ sendmail/mci.c +@@ -20,6 +20,7 @@ SM_RCSID("@(#)$Id: mci.c,v 8.225 2013-11 #endif /* NETINET || NETINET6 */ #include <dirent.h> @@ -10,7 +10,7 @@ $NetBSD: patch-ai,v 1.8 2008/06/14 08:58:06 tron Exp $ static int mci_generate_persistent_path __P((const char *, char *, int, bool)); -@@ -717,7 +718,11 @@ +@@ -744,7 +745,11 @@ mci_lock_host_statfile(mci) { int save_errno = errno; int retVal = EX_OK; diff --git a/mail/sendmail/patches/patch-al b/mail/sendmail/patches/patch-al deleted file mode 100644 index e84291b905b..00000000000 --- a/mail/sendmail/patches/patch-al +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-al,v 1.5 2006/12/29 21:44:09 markd Exp $ - ---- devtools/OS/SunOS.5.10.orig 2006-12-30 07:59:24.000000000 +1300 -+++ devtools/OS/SunOS.5.10 -@@ -10,6 +10,7 @@ define(`confMAPDEF', `-DNDBM -DNIS -DNIS - define(`confENVDEF', `-DSOLARIS=21000 -DNETINET6') - define(`confSM_OS_HEADER', `sm_os_sunos') - define(`confLIBS', `-lsocket -lnsl') -+define(`confLDOPTS', `${LDFLAGS}') - define(`confMTCCOPTS', `-D_REENTRANT') - define(`confMTLDOPTS', `-lpthread') - define(`confMBINDIR', `/usr/lib') diff --git a/mail/sendmail/patches/patch-am b/mail/sendmail/patches/patch-am deleted file mode 100644 index 4afb4b3323b..00000000000 --- a/mail/sendmail/patches/patch-am +++ /dev/null @@ -1,12 +0,0 @@ -$NetBSD: patch-am,v 1.3 2006/12/29 21:44:09 markd Exp $ - ---- devtools/OS/SunOS.5.11.orig 2006-12-30 07:59:28.000000000 +1300 -+++ devtools/OS/SunOS.5.11 -@@ -10,6 +10,7 @@ define(`confMAPDEF', `-DNDBM -DNIS -DNIS - define(`confENVDEF', `-DSOLARIS=21100 -DNETINET6') - define(`confSM_OS_HEADER', `sm_os_sunos') - define(`confLIBS', `-lsocket -lnsl') -+define(`confLDOPTS', `${LDFLAGS}') - define(`confMTCCOPTS', `-D_REENTRANT') - define(`confMTLDOPTS', `-lpthread') - define(`confMBINDIR', `/usr/lib') diff --git a/mail/sendmail/patches/patch-ao b/mail/sendmail/patches/patch-ao new file mode 100644 index 00000000000..38ed2c7e7e4 --- /dev/null +++ b/mail/sendmail/patches/patch-ao @@ -0,0 +1,50 @@ +$NetBSD: patch-ao,v 1.3 2014/06/15 20:48:50 jnemeth Exp $ + +--- devtools/bin/install.sh.orig 2014-03-06 17:31:29.000000000 +0000 ++++ devtools/bin/install.sh +@@ -101,25 +101,26 @@ then + $strip $dst + fi + +-# Change owner if requested +-if [ ! -z "$owner" ] +-then +- $chown $owner $dst +- if [ $? != 0 ] +- then +- exit 1 +- fi +-fi +- +-# Change group if requested +-if [ ! -z "$group" ] +-then +- chgrp $group $dst +- if [ $? != 0 ] +- then +- exit 1 +- fi +-fi ++# XXX Don't try to change owner or group, let pkgsrc infrastructure handle it. ++## Change owner if requested ++#if [ ! -z "$owner" ] ++#then ++# $chown $owner $dst ++# if [ $? != 0 ] ++# then ++# exit 1 ++# fi ++#fi ++# ++## Change group if requested ++#if [ ! -z "$group" ] ++#then ++# chgrp $group $dst ++# if [ $? != 0 ] ++# then ++# exit 1 ++# fi ++#fi + + # Change mode if requested + if [ ! -z "$mode" ] diff --git a/mail/sendmail/patches/patch-ap b/mail/sendmail/patches/patch-ap new file mode 100644 index 00000000000..63939671f57 --- /dev/null +++ b/mail/sendmail/patches/patch-ap @@ -0,0 +1,28 @@ +$NetBSD: patch-ap,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- libmilter/sm_gethost.c.orig 2014-03-06 17:31:30.000000000 +0000 ++++ libmilter/sm_gethost.c +@@ -49,19 +49,14 @@ sm_getipnodebyname(name, family, flags, + int flags; + int *err; + { +- bool resv6 = true; + struct hostent *h; + +- if (family == AF_INET6) +- { +- /* From RFC2133, section 6.1 */ +- resv6 = bitset(RES_USE_INET6, _res.options); +- _res.options |= RES_USE_INET6; +- } + SM_SET_H_ERRNO(0); ++# if NETINET6 ++ h = gethostbyname2(name, family); ++# else + h = gethostbyname(name); +- if (family == AF_INET6 && !resv6) +- _res.options &= ~RES_USE_INET6; ++# endif + + /* the function is supposed to return only the requested family */ + if (h != NULL && h->h_addrtype != family) diff --git a/mail/sendmail/patches/patch-aq b/mail/sendmail/patches/patch-aq new file mode 100644 index 00000000000..3cb94d1b922 --- /dev/null +++ b/mail/sendmail/patches/patch-aq @@ -0,0 +1,15 @@ +$NetBSD: patch-aq,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/conf.h.orig 2014-03-06 17:31:31.000000000 +0000 ++++ sendmail/conf.h +@@ -234,6 +234,10 @@ struct rusage; /* forward declaration to + # define PIPELINING 1 /* SMTP PIPELINING */ + #endif /* PIPELINING */ + ++#ifndef NAMED_RESN ++# define NAMED_RESN 1 /* res_n* functions are available */ ++#endif ++ + /********************************************************************** + ** End of site-specific configuration. + **********************************************************************/ diff --git a/mail/sendmail/patches/patch-ar b/mail/sendmail/patches/patch-ar new file mode 100644 index 00000000000..3e4f3a04e93 --- /dev/null +++ b/mail/sendmail/patches/patch-ar @@ -0,0 +1,110 @@ +$NetBSD: patch-ar,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/daemon.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/daemon.c +@@ -57,6 +57,10 @@ SM_RCSID("@(#)$Id: daemon.c,v 8.698 2013 + # endif /* HAS_IN_H */ + #endif /* IP_SRCROUTE && NETINET */ + ++#if NAMED_BIND ++extern struct __res_state sm_res; ++#endif ++ + #include <sm/fdset.h> + + #define DAEMON_C 1 +@@ -2295,16 +2299,16 @@ makeconnection(host, port, mci, e, enoug + if (hp == NULL && p[-1] == '.') + { + #if NAMED_BIND +- int oldopts = _res.options; ++ int oldopts = sm_res.options; + +- _res.options &= ~(RES_DEFNAMES|RES_DNSRCH); ++ sm_res.options &= ~(RES_DEFNAMES|RES_DNSRCH); + #endif /* NAMED_BIND */ + p[-1] = '\0'; + hp = sm_gethostbyname(&host[1], + family); + p[-1] = '.'; + #if NAMED_BIND +- _res.options = oldopts; ++ sm_res.options = oldopts; + #endif /* NAMED_BIND */ + } + *p = ']'; +@@ -2333,15 +2337,15 @@ makeconnection(host, port, mci, e, enoug + if (hp == NULL && *p == '.') + { + #if NAMED_BIND +- int oldopts = _res.options; ++ int oldopts = sm_res.options; + +- _res.options &= ~(RES_DEFNAMES|RES_DNSRCH); ++ sm_res.options &= ~(RES_DEFNAMES|RES_DNSRCH); + #endif /* NAMED_BIND */ + *p = '\0'; + hp = sm_gethostbyname(host, family); + *p = '.'; + #if NAMED_BIND +- _res.options = oldopts; ++ sm_res.options = oldopts; + #endif /* NAMED_BIND */ + } + } +@@ -4005,13 +4009,13 @@ host_map_lookup(map, name, av, statp) + #if NAMED_BIND + if (map->map_timeout > 0) + { +- retrans = _res.retrans; +- _res.retrans = map->map_timeout; ++ retrans = sm_res.retrans; ++ sm_res.retrans = map->map_timeout; + } + if (map->map_retry > 0) + { +- retry = _res.retry; +- _res.retry = map->map_retry; ++ retry = sm_res.retry; ++ sm_res.retry = map->map_retry; + } + #endif /* NAMED_BIND */ + +@@ -4074,9 +4078,9 @@ host_map_lookup(map, name, av, statp) + } + #if NAMED_BIND + if (map->map_timeout > 0) +- _res.retrans = retrans; ++ sm_res.retrans = retrans; + if (map->map_retry > 0) +- _res.retry = retry; ++ sm_res.retry = retry; + #endif /* NAMED_BIND */ + + s->s_namecanon.nc_flags |= NCF_VALID; /* will be soon */ +@@ -4407,11 +4411,11 @@ hostnamebyanyaddr(sap) + + # if NAMED_BIND + /* shorten name server timeout to avoid higher level timeouts */ +- saveretry = _res.retry; +- if (_res.retry * _res.retrans > 20) +- _res.retry = 20 / _res.retrans; +- if (_res.retry == 0) +- _res.retry = 1; ++ saveretry = sm_res.retry; ++ if (sm_res.retry * sm_res.retrans > 20) ++ sm_res.retry = 20 / sm_res.retrans; ++ if (sm_res.retry == 0) ++ sm_res.retry = 1; + # endif /* NAMED_BIND */ + + switch (sap->sa.sa_family) +@@ -4450,7 +4454,7 @@ hostnamebyanyaddr(sap) + } + + # if NAMED_BIND +- _res.retry = saveretry; ++ sm_res.retry = saveretry; + # endif /* NAMED_BIND */ + + # if NETINET || NETINET6 diff --git a/mail/sendmail/patches/patch-as b/mail/sendmail/patches/patch-as new file mode 100644 index 00000000000..3a8cdb5c9e4 --- /dev/null +++ b/mail/sendmail/patches/patch-as @@ -0,0 +1,60 @@ +$NetBSD: patch-as,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/deliver.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/deliver.c +@@ -28,6 +28,10 @@ SM_RCSID("@(#)$Id: deliver.c,v 8.1030 20 + # include "sfsasl.h" + #endif /* STARTTLS || SASL */ + ++#if NAMED_BIND ++extern struct __res_state sm_res; ++#endif ++ + static int deliver __P((ENVELOPE *, ADDRESS *)); + static void dup_queue_file __P((ENVELOPE *, ENVELOPE *, int)); + static void mailfiletimeout __P((int)); +@@ -1858,7 +1862,7 @@ deliver(e, firstto) + + #if NAMED_BIND + if (ConfigLevel < 2) +- _res.options &= ~(RES_DEFNAMES | RES_DNSRCH); /* XXX */ ++ sm_res.options &= ~(RES_DEFNAMES | RES_DNSRCH); /* XXX */ + #endif /* NAMED_BIND */ + + if (tTd(11, 1)) +@@ -3438,7 +3442,7 @@ do_transfer: + } + #if NAMED_BIND + if (ConfigLevel < 2) +- _res.options |= RES_DEFNAMES | RES_DNSRCH; /* XXX */ ++ sm_res.options |= RES_DEFNAMES | RES_DNSRCH; /* XXX */ + #endif /* NAMED_BIND */ + + if (tTd(62, 1)) +@@ -5710,7 +5714,7 @@ hostsignature(m, host) + int hl; + char *hp; + char *endp; +- int oldoptions = _res.options; ++ int oldoptions = sm_res.options; + char *mxhosts[MAXMXHOSTS + 1]; + unsigned short mxprefs[MAXMXHOSTS + 1]; + #endif /* NAMED_BIND */ +@@ -5780,7 +5784,7 @@ hostsignature(m, host) + + #if NAMED_BIND + if (ConfigLevel < 2) +- _res.options &= ~(RES_DEFNAMES | RES_DNSRCH); /* XXX */ ++ sm_res.options &= ~(RES_DEFNAMES | RES_DNSRCH); /* XXX */ + + for (hp = host; hp != NULL; hp = endp) + { +@@ -5908,7 +5912,7 @@ hostsignature(m, host) + } + makelower(s->s_hostsig.hs_sig); + if (ConfigLevel < 2) +- _res.options = oldoptions; ++ sm_res.options = oldoptions; + #else /* NAMED_BIND */ + /* not using BIND -- the signature is just the host name */ + /* diff --git a/mail/sendmail/patches/patch-at b/mail/sendmail/patches/patch-at new file mode 100644 index 00000000000..3ff681e006f --- /dev/null +++ b/mail/sendmail/patches/patch-at @@ -0,0 +1,149 @@ +$NetBSD: patch-at,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/domain.c.orig 2014-03-06 17:31:31.000000000 +0000 ++++ sendmail/domain.c +@@ -39,7 +39,7 @@ static char MXHostBuf[MXHOSTBUFSIZE]; + # endif /* ! MAXDNSRCH */ + + # ifndef RES_DNSRCH_VARIABLE +-# define RES_DNSRCH_VARIABLE _res.dnsrch ++# define RES_DNSRCH_VARIABLE sm_res.dnsrch + # endif /* ! RES_DNSRCH_VARIABLE */ + + # ifndef NO_DATA +@@ -58,6 +58,8 @@ static char MXHostBuf[MXHOSTBUFSIZE]; + # define RES_UNC_T unsigned char * + # endif /* defined(__RES) && (__RES >= 19940415) */ + ++extern struct __res_state sm_res; ++ + static int mxrand __P((char *)); + static int fallbackmxrr __P((int, unsigned short *, char **)); + +@@ -205,11 +207,9 @@ getmxrr(host, mxhosts, mxprefs, droploca + char *fallbackMX = FallbackMX; + bool trycanon = false; + unsigned short *prefs; +- int (*resfunc) __P((const char *, int, int, u_char *, int)); + unsigned short prefer[MAXMXHOSTS]; + int weight[MAXMXHOSTS]; + int ttl = 0; +- extern int res_query(), res_search(); + + if (tTd(8, 2)) + sm_dprintf("getmxrr(%s, droplocalhost=%d)\n", +@@ -246,14 +246,24 @@ getmxrr(host, mxhosts, mxprefs, droploca + + if (!UseNameServer) + goto punt; +- if (HasWildcardMX && ConfigLevel >= 6) +- resfunc = res_query; +- else +- resfunc = res_search; + + errno = 0; +- n = (*resfunc)(host, C_IN, T_MX, (unsigned char *) &answer, ++ if (HasWildcardMX && ConfigLevel >= 6) ++#if NAMED_RESN ++ n = res_nquery(&sm_res, host, C_IN, T_MX, ++ (unsigned char *) &answer, sizeof(answer)); ++#else ++ n = res_query(host, C_IN, T_MX, (unsigned char *) &answer, ++ sizeof(answer)); ++#endif ++ else ++#if NAMED_RESN ++ n = res_nsearch(&sm_res, host, C_IN, T_MX, ++ (unsigned char *) &answer, sizeof(answer)); ++#else ++ n = res_search(host, C_IN, T_MX, (unsigned char *) &answer, + sizeof(answer)); ++#endif + if (n < 0) + { + if (tTd(8, 1)) +@@ -337,7 +347,7 @@ getmxrr(host, mxhosts, mxprefs, droploca + GETSHORT(n, cp); /* rdlength */ + if (type != T_MX) + { +- if (tTd(8, 8) || _res.options & RES_DEBUG) ++ if (tTd(8, 8) || sm_res.options & RES_DEBUG) + sm_dprintf("unexpected answer type %d, size %d\n", + type, n); + cp += n; +@@ -635,7 +645,7 @@ bestmx_map_lookup(map, name, av, statp) + int *statp; + { + int nmx; +- int saveopts = _res.options; ++ int saveopts = sm_res.options; + int i; + ssize_t len = 0; + char *result; +@@ -647,9 +657,9 @@ bestmx_map_lookup(map, name, av, statp) + char buf[PSBUFSIZE / 2]; + #endif /* _FFR_BESTMX_BETTER_TRUNCATION */ + +- _res.options &= ~(RES_DNSRCH|RES_DEFNAMES); ++ sm_res.options &= ~(RES_DNSRCH|RES_DEFNAMES); + nmx = getmxrr(name, mxhosts, NULL, false, statp, false, NULL); +- _res.options = saveopts; ++ sm_res.options = saveopts; + if (nmx <= 0) + return NULL; + if (bitset(MF_MATCHONLY, map->map_mflags)) +@@ -793,10 +803,15 @@ dns_getcanonname(host, hbsize, trymx, st + if (tTd(8, 2)) + sm_dprintf("dns_getcanonname(%s, trymx=%d)\n", host, trymx); + +- if ((_res.options & RES_INIT) == 0 && res_init() == -1) +- { +- *statp = EX_UNAVAILABLE; +- return false; ++ if ((sm_res.options & RES_INIT) == 0) ++# if NAMED_RESN ++ memset(&sm_res, 0, sizeof(sm_res)); ++ if (res_ninit(&sm_res) == -1) { ++# else ++ if (res_init() == -1) { ++# endif ++ *statp = EX_UNAVAILABLE; ++ return false; + } + + *statp = EX_OK; +@@ -834,7 +849,7 @@ cnameloop: + dp = searchlist; + if (n > 0) + *dp++ = ""; +- if (n >= 0 && *--cp != '.' && bitset(RES_DNSRCH, _res.options)) ++ if (n >= 0 && *--cp != '.' && bitset(RES_DNSRCH, sm_res.options)) + { + /* make sure there are less than MAXDNSRCH domains */ + for (domain = RES_DNSRCH_VARIABLE, ret = 0; +@@ -842,9 +857,9 @@ cnameloop: + ret++) + *dp++ = *domain++; + } +- else if (n == 0 && bitset(RES_DEFNAMES, _res.options)) ++ else if (n == 0 && bitset(RES_DEFNAMES, sm_res.options)) + { +- *dp++ = _res.defdname; ++ *dp++ = sm_res.defdname; + } + else if (*cp == '.') + { +@@ -879,8 +894,13 @@ cnameloop: + qtype == T_MX ? "MX" : + "???"); + errno = 0; ++# if NAMED_RESN ++ ret = res_nquerydomain(&sm_res, host, *dp, C_IN, qtype, ++ answer.qb2, sizeof(answer.qb2)); ++# else + ret = res_querydomain(host, *dp, C_IN, qtype, + answer.qb2, sizeof(answer.qb2)); ++# endif + if (ret <= 0) + { + int save_errno = errno; diff --git a/mail/sendmail/patches/patch-au b/mail/sendmail/patches/patch-au new file mode 100644 index 00000000000..c6837cf7db4 --- /dev/null +++ b/mail/sendmail/patches/patch-au @@ -0,0 +1,76 @@ +$NetBSD: patch-au,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/main.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/main.c +@@ -148,6 +148,10 @@ int SyslogPrefixLen; /* estimated lengt + } \ + } + ++#if NAMED_BIND ++struct __res_state sm_res; ++#endif ++ + int + main(argc, argv, envp) + int argc; +@@ -683,21 +687,27 @@ main(argc, argv, envp) + */ + + #if NAMED_BIND +- if (!bitset(RES_INIT, _res.options)) +- (void) res_init(); ++# if NAMED_RESN ++ sm_res = *(struct __res_state *)sm_malloc(sizeof(struct __res_state)); ++ memset(&sm_res, 0, sizeof(struct __res_state)); ++ (void) res_ninit(&sm_res); ++# else ++ sm_res = _res; ++ (void) res_init(); ++# endif + if (tTd(8, 8)) +- _res.options |= RES_DEBUG; ++ sm_res.options |= RES_DEBUG; + else +- _res.options &= ~RES_DEBUG; ++ sm_res.options &= ~RES_DEBUG; + # ifdef RES_NOALIASES +- _res.options |= RES_NOALIASES; ++ sm_res.options |= RES_NOALIASES; + # endif /* RES_NOALIASES */ +- TimeOuts.res_retry[RES_TO_DEFAULT] = _res.retry; +- TimeOuts.res_retry[RES_TO_FIRST] = _res.retry; +- TimeOuts.res_retry[RES_TO_NORMAL] = _res.retry; +- TimeOuts.res_retrans[RES_TO_DEFAULT] = _res.retrans; +- TimeOuts.res_retrans[RES_TO_FIRST] = _res.retrans; +- TimeOuts.res_retrans[RES_TO_NORMAL] = _res.retrans; ++ TimeOuts.res_retry[RES_TO_DEFAULT] = sm_res.retry; ++ TimeOuts.res_retry[RES_TO_FIRST] = sm_res.retry; ++ TimeOuts.res_retry[RES_TO_NORMAL] = sm_res.retry; ++ TimeOuts.res_retrans[RES_TO_DEFAULT] = sm_res.retrans; ++ TimeOuts.res_retrans[RES_TO_FIRST] = sm_res.retrans; ++ TimeOuts.res_retrans[RES_TO_NORMAL] = sm_res.retrans; + #endif /* NAMED_BIND */ + + errno = 0; +@@ -1380,8 +1390,8 @@ main(argc, argv, envp) + } + + #if NAMED_BIND +- _res.retry = TimeOuts.res_retry[RES_TO_DEFAULT]; +- _res.retrans = TimeOuts.res_retrans[RES_TO_DEFAULT]; ++ sm_res.retry = TimeOuts.res_retry[RES_TO_DEFAULT]; ++ sm_res.retrans = TimeOuts.res_retrans[RES_TO_DEFAULT]; + #endif /* NAMED_BIND */ + + /* +@@ -2884,8 +2894,8 @@ main(argc, argv, envp) + sm_getla(); + GrabTo = false; + #if NAMED_BIND +- _res.retry = TimeOuts.res_retry[RES_TO_FIRST]; +- _res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; ++ sm_res.retry = TimeOuts.res_retry[RES_TO_FIRST]; ++ sm_res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; + #endif /* NAMED_BIND */ + next = e->e_sibling; + e->e_sibling = NULL; diff --git a/mail/sendmail/patches/patch-av b/mail/sendmail/patches/patch-av new file mode 100644 index 00000000000..ea288cdda25 --- /dev/null +++ b/mail/sendmail/patches/patch-av @@ -0,0 +1,33 @@ +$NetBSD: patch-av,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/queue.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/queue.c +@@ -34,6 +34,10 @@ SM_RCSID("@(#)$Id: queue.c,v 8.1000 2013 + # define SM_OPEN_EXLOCK 0 + #endif /* ! SM_OPEN_EXLOCK */ + ++#if NAMED_BIND ++extern struct __res_state sm_res; ++#endif ++ + /* + ** Historical notes: + ** QF_VERSION == 4 was sendmail 8.10/8.11 without _FFR_QUEUEDELAY +@@ -4360,13 +4364,13 @@ readqf(e, openonly) + /* adjust BIND parameters immediately */ + if (e->e_ntries == 0) + { +- _res.retry = TimeOuts.res_retry[RES_TO_FIRST]; +- _res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; ++ sm_res.retry = TimeOuts.res_retry[RES_TO_FIRST]; ++ sm_res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; + } + else + { +- _res.retry = TimeOuts.res_retry[RES_TO_NORMAL]; +- _res.retrans = TimeOuts.res_retrans[RES_TO_NORMAL]; ++ sm_res.retry = TimeOuts.res_retry[RES_TO_NORMAL]; ++ sm_res.retrans = TimeOuts.res_retrans[RES_TO_NORMAL]; + } + #endif /* NAMED_BIND */ + break; diff --git a/mail/sendmail/patches/patch-aw b/mail/sendmail/patches/patch-aw new file mode 100644 index 00000000000..3bd73f03bfa --- /dev/null +++ b/mail/sendmail/patches/patch-aw @@ -0,0 +1,32 @@ +$NetBSD: patch-aw,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/readcf.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/readcf.c +@@ -20,6 +20,10 @@ SM_RCSID("@(#)$Id: readcf.c,v 8.692 2013 + # include <arpa/inet.h> + #endif /* NETINET || NETINET6 */ + ++#if NAMED_BIND ++extern struct __res_state sm_res; ++#endif ++ + + #define SECONDS + #define MINUTES * 60 +@@ -2810,13 +2814,13 @@ setoption(opt, val, safe, sticky, e) + if (rfp->rf_name == NULL) + syserr("readcf: I option value %s unrecognized", q); + else if (clearmode) +- _res.options &= ~rfp->rf_bits; ++ sm_res.options &= ~rfp->rf_bits; + else +- _res.options |= rfp->rf_bits; ++ sm_res.options |= rfp->rf_bits; + } + if (tTd(8, 2)) + sm_dprintf("_res.options = %x, HasWildcardMX = %d\n", +- (unsigned int) _res.options, HasWildcardMX); ++ (unsigned int) sm_res.options, HasWildcardMX); + #else /* NAMED_BIND */ + usrerr("name server (I option) specified but BIND not compiled in"); + #endif /* NAMED_BIND */ diff --git a/mail/sendmail/patches/patch-ax b/mail/sendmail/patches/patch-ax new file mode 100644 index 00000000000..f0ea62fbe6a --- /dev/null +++ b/mail/sendmail/patches/patch-ax @@ -0,0 +1,18 @@ +$NetBSD: patch-ax,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/savemail.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/savemail.c +@@ -17,2 +17,6 @@ SM_RCSID("@(#)$Id: savemail.c,v 8.319 20 + ++#if NAMED_BIND ++extern struct __res_state sm_res; ++#endif ++ + static bool errbody __P((MCI *, ENVELOPE *, char *)); +@@ -594,4 +598,4 @@ returntosender(msg, returnq, flags, e) + #if NAMED_BIND +- _res.retry = TimeOuts.res_retry[RES_TO_FIRST]; +- _res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; ++ sm_res.retry = TimeOuts.res_retry[RES_TO_FIRST]; ++ sm_res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; + #endif /* NAMED_BIND */ diff --git a/mail/sendmail/patches/patch-ay b/mail/sendmail/patches/patch-ay new file mode 100644 index 00000000000..5f732797eea --- /dev/null +++ b/mail/sendmail/patches/patch-ay @@ -0,0 +1,53 @@ +$NetBSD: patch-ay,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/sm_resolve.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/sm_resolve.c +@@ -54,2 +54,6 @@ SM_RCSID("$Id: sm_resolve.c,v 8.40 2013- + ++#if NAMED_BIND ++extern struct __res_state sm_res; ++#endif ++ + static struct stot +@@ -410,4 +414,4 @@ dns_lookup_int(domain, rr_class, rr_type + { +- old_options = _res.options; +- _res.options |= RES_DEBUG; ++ old_options = sm_res.options; ++ sm_res.options |= RES_DEBUG; + sm_dprintf("dns_lookup(%s, %d, %s)\n", domain, +@@ -417,4 +421,4 @@ dns_lookup_int(domain, rr_class, rr_type + { +- save_retrans = _res.retrans; +- _res.retrans = retrans; ++ save_retrans = sm_res.retrans; ++ sm_res.retrans = retrans; + } +@@ -422,4 +426,4 @@ dns_lookup_int(domain, rr_class, rr_type + { +- save_retry = _res.retry; +- _res.retry = retry; ++ save_retry = sm_res.retry; ++ sm_res.retry = retry; + } +@@ -428,3 +432,7 @@ dns_lookup_int(domain, rr_class, rr_type + reply = (unsigned char *)&reply_buf; ++#if NAMED_RESN ++ len = res_nsearch(&sm_res, domain, rr_class, rr_type, reply, SMRBSIZE); ++#else + len = res_search(domain, rr_class, rr_type, reply, SMRBSIZE); ++#endif + if (len >= SMRBSIZE) +@@ -454,3 +462,3 @@ dns_lookup_int(domain, rr_class, rr_type + { +- _res.options = old_options; ++ sm_res.options = old_options; + sm_dprintf("dns_lookup(%s, %d, %s) --> %d\n", +@@ -466,5 +474,5 @@ dns_lookup_int(domain, rr_class, rr_type + if (retrans > 0) +- _res.retrans = save_retrans; ++ sm_res.retrans = save_retrans; + if (retry > 0) +- _res.retry = save_retry; ++ sm_res.retry = save_retry; + return r; diff --git a/mail/sendmail/patches/patch-az b/mail/sendmail/patches/patch-az new file mode 100644 index 00000000000..a8b5d368192 --- /dev/null +++ b/mail/sendmail/patches/patch-az @@ -0,0 +1,26 @@ +$NetBSD: patch-az,v 1.1 2014/06/15 20:48:50 jnemeth Exp $ + +--- sendmail/srvrsmtp.c.orig 2014-05-16 20:40:15.000000000 +0000 ++++ sendmail/srvrsmtp.c +@@ -46,6 +46,10 @@ static bool tls_ok_srv = false; + static bool NotFirstDelivery = false; + #endif /* _FFR_DM_ONE */ + ++#if NAMED_BIND ++extern struct __res_state sm_res; ++#endif ++ + /* server features */ + #define SRV_NONE 0x0000 /* none... */ + #define SRV_OFFER_TLS 0x0001 /* offer STARTTLS */ +@@ -3731,8 +3735,8 @@ smtp_data(smtp, e) + id = e->e_id; + + #if NAMED_BIND +- _res.retry = TimeOuts.res_retry[RES_TO_FIRST]; +- _res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; ++ sm_res.retry = TimeOuts.res_retry[RES_TO_FIRST]; ++ sm_res.retrans = TimeOuts.res_retrans[RES_TO_FIRST]; + #endif /* NAMED_BIND */ + + |