From 9de1f6a1d7b9370b698e3d9bea6d2aef589f06a3 Mon Sep 17 00:00:00 2001
From: Wietse Venema
Date: Mon, 18 Nov 2013 00:00:00 -0500
Subject: [PATCH] postfix-2.11-20131118
---
postfix/HISTORY | 21 ++++
postfix/WISHLIST | 5 +-
postfix/html/Makefile.in | 133 +++++++++++++------------
postfix/html/smtpd.8.html | 28 +++---
postfix/man/man8/smtpd.8 | 6 +-
postfix/mantools/man2html | 30 +++---
postfix/proto/Makefile.in | 17 ++--
postfix/proto/postconf.proto | 3 +-
postfix/src/dns/dns.h | 8 +-
postfix/src/global/Makefile.in | 37 +------
postfix/src/global/mail_version.h | 2 +-
postfix/src/global/memcache_proto.c | 11 +-
postfix/src/milter/Makefile.in | 1 +
postfix/src/milter/milter8.c | 31 ++++--
postfix/src/postconf/Makefile.in | 1 +
postfix/src/posttls-finger/Makefile.in | 5 +
postfix/src/smtp/Makefile.in | 3 +
postfix/src/smtpd/smtpd.c | 22 ++--
postfix/src/smtpd/smtpd_proxy.c | 80 ++++++---------
postfix/src/smtpd/smtpd_proxy.h | 3 +-
postfix/src/smtpstone/Makefile.in | 1 +
postfix/src/smtpstone/smtp-source.c | 11 +-
postfix/src/tls/Makefile.in | 12 +++
postfix/src/tls/tls_dane.c | 21 ----
postfix/src/util/Makefile.in | 6 +-
postfix/src/util/attr_clnt.c | 21 +++-
postfix/src/util/attr_clnt.h | 5 +
postfix/src/util/attr_print0.c | 4 +-
postfix/src/util/attr_print64.c | 4 +-
postfix/src/util/attr_print_plain.c | 4 +-
postfix/src/util/compat_va_copy.h | 44 ++++++++
postfix/src/util/concatenate.c | 14 ++-
postfix/src/util/dict_surrogate.c | 14 ++-
postfix/src/util/netstring.c | 45 +++++----
postfix/src/util/slmdb.c | 1 +
postfix/src/util/slmdb.h | 1 -
36 files changed, 364 insertions(+), 291 deletions(-)
create mode 100644 postfix/src/util/compat_va_copy.h
diff --git a/postfix/HISTORY b/postfix/HISTORY
index 65846c70b..ca5a6f902 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -19144,3 +19144,24 @@ Apologies for any names omitted.
Bugfix: FreeBSD nroff workaround messed up. File:
mantools/postlink.
+
+20131118
+
+ Cleanup: FreeBSD nroff workaround. Files: man/Makefile.in,
+ proto/Makefile.in.
+
+ Cleanup: the smtpd_proxy_filter client now sends QUIT before
+ closing the connection to a content filter. Files:
+ smtpd/smtpd_proxy.c, smtpd/smtpd.c.
+
+ Portability: C99 va_copy() compatibility, in case some
+ implementation does not permit multiple va_start() calls
+ on the same argument list. Files: global/memcache_proto.c,
+ milter/milter8.c, smtpstone/smtp-source.c, util/attr_clnt.c,
+ util/concatenate.c, util/dict_surrogate.c, util/netstring.c,
+ util/compat_va_copy.h.
+
+ Cleanup: comment formatting. Viktor Dukhovni. File: dns/dns.h.
+
+ Cleanup: removed redundant sort operation. Viktor Dukhovni.
+ File: tls/tls_dane.c.
diff --git a/postfix/WISHLIST b/postfix/WISHLIST
index 92f2cb53f..e9192387a 100644
--- a/postfix/WISHLIST
+++ b/postfix/WISHLIST
@@ -10,12 +10,11 @@ Wish list:
Preserve case in smtpd_resolve_addr() and add a structure
member for the case-folded address.
- Per SASL account rate limits.
+ Per SASL account rate limits. This requires new infrastructure
+ that maintains stats by SASL account.
Watchdog timer to postmap/postalias.
- C99 va_copy() support.
-
Things to do before the stable release:
Spell-check, double-word check, and HTML validator check.
diff --git a/postfix/html/Makefile.in b/postfix/html/Makefile.in
index 39b47d707..b12e510c4 100644
--- a/postfix/html/Makefile.in
+++ b/postfix/html/Makefile.in
@@ -26,6 +26,7 @@ CONFIG = access.5.html aliases.5.html canonical.5.html relocated.5.html \
OTHER = postfix-manuals.html
AWK = awk '{ print; if (NR == 2) print ".pl 9999\n.ll 65" }'
MAN2HTML = man2html -t "Postfix manual - `IFS=.; set \`echo $@\`; echo \"$$1($$2)\"`"
+NROFF = GROFF_NO_SGR=1 nroff
update: $(DAEMONS) $(COMMANDS) $(CONFIG) $(OTHER)
@@ -39,7 +40,7 @@ clobber:
bounce.8.html: ../src/bounce/bounce.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
defer.8.html: bounce.8.html
rm -f $@
@@ -47,31 +48,31 @@ defer.8.html: bounce.8.html
discard.8.html: ../src/discard/discard.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
dnsblog.8.html: ../src/dnsblog/dnsblog.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
error.8.html: ../src/error/error.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
flush.8.html: ../src/flush/flush.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
cleanup.8.html: ../src/cleanup/cleanup.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
anvil.8.html: ../src/anvil/anvil.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
scache.8.html: ../src/scache/scache.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
lmtp.8.html: smtp.8.html
rm -f $@
@@ -79,70 +80,70 @@ lmtp.8.html: smtp.8.html
local.8.html: ../src/local/local.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
master.8.html: ../src/master/master.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
oqmgr.8.html: ../src/oqmgr/qmgr.c
PATH=../mantools:$$PATH; \
srctoman $? | sed -e 's/qmgr[^_]/o&/' \
-e 's/qmgr$$/o&/' \
-e 's/QMGR[^_]/O&/' | \
- $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
pickup.8.html: ../src/pickup/pickup.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
pipe.8.html: ../src/pipe/pipe.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postscreen.8.html: ../src/postscreen/postscreen.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
proxymap.8.html: ../src/proxymap/proxymap.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
qmgr.8.html: ../src/qmgr/qmgr.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
qmqpd.8.html: ../src/qmqpd/qmqpd.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
showq.8.html: ../src/showq/showq.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
spawn.8.html: ../src/spawn/spawn.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
smtp.8.html: ../src/smtp/smtp.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
smtpd.8.html: ../src/smtpd/smtpd.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
tlsproxy.8.html: ../src/tlsproxy/tlsproxy.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
virtual.8.html: ../src/virtual/virtual.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
tlsmgr.8.html: ../src/tlsmgr/tlsmgr.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
trace.8.html: bounce.8.html
rm -f $@
@@ -150,63 +151,63 @@ trace.8.html: bounce.8.html
trivial-rewrite.8.html: ../src/trivial-rewrite/trivial-rewrite.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
verify.8.html: ../src/verify/verify.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postalias.1.html: ../src/postalias/postalias.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postcat.1.html: ../src/postcat/postcat.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postconf.1.html: ../src/postconf/postconf.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postdrop.1.html: ../src/postdrop/postdrop.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postfix.1.html: ../src/postfix/postfix.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postkick.1.html: ../src/postkick/postkick.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postlock.1.html: ../src/postlock/postlock.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postlog.1.html: ../src/postlog/postlog.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postmap.1.html: ../src/postmap/postmap.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postmulti.1.html: ../src/postmulti/postmulti.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postqueue.1.html: ../src/postqueue/postqueue.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postsuper.1.html: ../src/postsuper/postsuper.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
sendmail.1.html: ../src/sendmail/sendmail.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
mailq.1.html: sendmail.1.html
rm -f $@
@@ -219,111 +220,111 @@ newaliases.1.html: sendmail.1.html
smtp-source.1.html: ../src/smtpstone/smtp-source.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
smtp-sink.1.html: ../src/smtpstone/smtp-sink.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
posttls-finger.1.html: ../src/posttls-finger/posttls-finger.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
qmqp-source.1.html: ../src/smtpstone/qmqp-source.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
qmqp-sink.1.html: ../src/smtpstone/qmqp-sink.c
PATH=../mantools:$$PATH; \
- srctoman $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
qshape.1.html: ../auxiliary/qshape/qshape.pl
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
access.5.html: ../proto/access
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
aliases.5.html: ../proto/aliases
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
bounce.5.html: ../proto/bounce
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
canonical.5.html: ../proto/canonical
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
cidr_table.5.html: ../proto/cidr_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
header_checks.5.html: ../proto/header_checks
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
generic.5.html: ../proto/generic
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
ldap_table.5.html: ../proto/ldap_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
master.5.html: ../proto/master
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
memcache_table.5.html: ../proto/memcache_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
mysql_table.5.html: ../proto/mysql_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
sqlite_table.5.html: ../proto/sqlite_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
nisplus_table.5.html: ../proto/nisplus_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
pcre_table.5.html: ../proto/pcre_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
pgsql_table.5.html: ../proto/pgsql_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
regexp_table.5.html: ../proto/regexp_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
relocated.5.html: ../proto/relocated
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
tcp_table.5.html: ../proto/tcp_table
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
transport.5.html: ../proto/transport
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
virtual.5.html: ../proto/virtual
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postfix-wrapper.5.html: ../proto/postfix-wrapper
PATH=../mantools:$$PATH; \
- srctoman - $? | $(AWK) | nroff -man | uniq | $(MAN2HTML) | postlink >$@
+ srctoman - $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
postfix-manuals.html: ../src/postfix/postfix.c ../mantools/makemanidx
PATH=../mantools:$$PATH; \
diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html
index 663f03ef8..fe7f16152 100644
--- a/postfix/html/smtpd.8.html
+++ b/postfix/html/smtpd.8.html
@@ -153,12 +153,12 @@ SMTPD(8) SMTPD(8)
Available in Postfix version 2.9 and later:
smtpd_per_record_deadline (normal: no, overload: yes)
- Change the behavior of the smtpd_timeout time
- limit, from a time limit per read or write system
- call, to a time limit to send or receive a complete
- record (an SMTP command line, SMTP response line,
- SMTP message content line, or TLS protocol mes-
- sage).
+ Change the behavior of the smtpd_timeout and
+ smtpd_starttls_timeout time limits, from a time
+ limit per read or write system call, to a time
+ limit to send or receive a complete record (an SMTP
+ command line, SMTP response line, SMTP message con-
+ tent line, or TLS protocol message).
ADDRESS REWRITING CONTROLS
See the ADDRESS_REWRITING_README document for a detailed
@@ -581,8 +581,8 @@ SMTPD(8) SMTPD(8)
Available in Postfix version 2.11 and later:
tlsmgr_service_name (tlsmgr)
- The name of the tlsmgr(8) service entry in mas-
- ter.cf.
+ The name of the tlsmgr(8) service entry in mas-
+ ter.cf.
OBSOLETE STARTTLS CONTROLS
The following configuration parameters exist for compati-
@@ -870,12 +870,12 @@ SMTPD(8) SMTPD(8)
Available in Postfix version 2.9 and later:
smtpd_per_record_deadline (normal: no, overload: yes)
- Change the behavior of the smtpd_timeout time
- limit, from a time limit per read or write system
- call, to a time limit to send or receive a complete
- record (an SMTP command line, SMTP response line,
- SMTP message content line, or TLS protocol mes-
- sage).
+ Change the behavior of the smtpd_timeout and
+ smtpd_starttls_timeout time limits, from a time
+ limit per read or write system call, to a time
+ limit to send or receive a complete record (an SMTP
+ command line, SMTP response line, SMTP message con-
+ tent line, or TLS protocol message).
TARPIT CONTROLS
When a remote SMTP client makes errors, the Postfix SMTP
diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8
index 3c4bc859a..3651a0538 100644
--- a/postfix/man/man8/smtpd.8
+++ b/postfix/man/man8/smtpd.8
@@ -146,7 +146,8 @@ A mechanism to transform commands from remote SMTP clients.
.PP
Available in Postfix version 2.9 and later:
.IP "\fBsmtpd_per_record_deadline (normal: no, overload: yes)\fR"
-Change the behavior of the smtpd_timeout time limit, from a
+Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
+time limits, from a
time limit per read or write system call, to a time limit to send
or receive a complete record (an SMTP command line, SMTP response
line, SMTP message content line, or TLS protocol message).
@@ -704,7 +705,8 @@ time unit.
.PP
Available in Postfix version 2.9 and later:
.IP "\fBsmtpd_per_record_deadline (normal: no, overload: yes)\fR"
-Change the behavior of the smtpd_timeout time limit, from a
+Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
+time limits, from a
time limit per read or write system call, to a time limit to send
or receive a complete record (an SMTP command line, SMTP response
line, SMTP message content line, or TLS protocol message).
diff --git a/postfix/mantools/man2html b/postfix/mantools/man2html
index f9896f07b..e443e1189 100755
--- a/postfix/mantools/man2html
+++ b/postfix/mantools/man2html
@@ -18,7 +18,7 @@ echo " $title
"
-ESC=`echo x | tr '[x]' '[\033]'`
+#ESC=`echo x | tr '[x]' '[\033]'`
sed '
s/\([<>&]\)\1/\1/g
@@ -32,20 +32,20 @@ sed '
s;_\([^_]\);\1;g
s;.\(.\);\1;g
# Why change nroff to hard-coded ANSI escape sequences?
- /'$ESC'\[0m$/{
- /'$ESC'\[1m[^'$ESC']*'$ESC'\[0m$/{
- # Here, ESC[0m means end-of-bold.
- s;0m$;22m;
- }
- /'$ESC'\[4m[^'$ESC']*'$ESC'\[0m$/{
- # Here, ESC[0m means end-of-italic.
- s;0m$;24m;
- }
- }
- s;'$ESC'\[1m;;g
- s;'$ESC'\[22m;;g
- s;'$ESC'\[4m;;g
- s;'$ESC'\[24m;;g
+ #/'$ESC'\[0m$/{
+ # /'$ESC'\[1m[^'$ESC']*'$ESC'\[0m$/{
+ # # Here, ESC[0m means end-of-bold.
+ # s;0m$;22m;
+ # }
+ # /'$ESC'\[4m[^'$ESC']*'$ESC'\[0m$/{
+ # # Here, ESC[0m means end-of-italic.
+ # s;0m$;24m;
+ # }
+ #}
+ #s;'$ESC'\[1m;;g
+ #s;'$ESC'\[22m;;g
+ #s;'$ESC'\[4m;;g
+ #s;'$ESC'\[24m;;g
# Undo gratuitous whitespace changes.
#s;\( *\)\([bi]>\);\2\1;g
# End nroff ANSI escape sequence workarounds.
diff --git a/postfix/proto/Makefile.in b/postfix/proto/Makefile.in
index 3c039ab5d..8b110ae12 100644
--- a/postfix/proto/Makefile.in
+++ b/postfix/proto/Makefile.in
@@ -96,6 +96,7 @@ AWK = awk '{ print; if (NR == 1) print ".pl 9999\n.ll 65" }'
SRCTOMAN= ../mantools/srctoman
POSTLINK= ../mantools/postlink
DETAB = pr -tre
+NROFF = GROFF_NO_SGR=1 nroff
HT2READ = ../mantools/html2readme
MAKEAAA = ../mantools/makereadme
MAKESOHO= ../mantools/make_soho_readme
@@ -115,28 +116,28 @@ clobber:
#$(HTML): $(POSTLINK)
../conf/access: access
- $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ $(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/aliases: aliases0 aliases
- (cat aliases0; $(SRCTOMAN) - aliases | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /') >$@
+ (cat aliases0; $(SRCTOMAN) - aliases | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /') >$@
../conf/canonical: canonical
- $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ $(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/generic: generic
- $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ $(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/header_checks: header_checks
- $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ $(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/relocated: relocated
- $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ $(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/transport: transport
- $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ $(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@
../conf/virtual: virtual
- $(SRCTOMAN) - $? | $(AWK) | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
+ $(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@
../html/ADDRESS_CLASS_README.html: ADDRESS_CLASS_README.html
$(DETAB) $? | $(POSTLINK) >$@
diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto
index 89be6ccbf..06b5f13fe 100644
--- a/postfix/proto/postconf.proto
+++ b/postfix/proto/postconf.proto
@@ -3518,7 +3518,8 @@ address, and one address extension per email address.
extension by the first character that matches the recipient_delimiter
set.
- When used in forward_path, ${recipient_delimiter} is replaced
+
When used in command_execution_directory, forward_path, or
+luser_relay, ${recipient_delimiter} is replaced
with the recipient delimiter that was found in the recipient email
address (Postfix 2.11 and later), or it is replaced with the main.cf
recipient_delimiter parameter value (Postfix 2.10 and earlier).
diff --git a/postfix/src/dns/dns.h b/postfix/src/dns/dns.h
index 4f94bec1f..7a5d20c86 100644
--- a/postfix/src/dns/dns.h
+++ b/postfix/src/dns/dns.h
@@ -64,10 +64,10 @@
#define RES_USE_EDNS0 0
#endif
- /*
- * TLSA: https://tools.ietf.org/html/rfc6698#section-7.1 RRSIG:
- * http://tools.ietf.org/html/rfc4034#section-3
- *
+ /*-
+ * TLSA: https://tools.ietf.org/html/rfc6698#section-7.1
+ * RRSIG: http://tools.ietf.org/html/rfc4034#section-3
+ *
* We don't request RRSIG, but we get it "for free" when we send the DO-bit.
*/
#ifndef T_TLSA
diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in
index 1b0e570fc..d85eabdce 100644
--- a/postfix/src/global/Makefile.in
+++ b/postfix/src/global/Makefile.in
@@ -922,46 +922,10 @@ dict_memcache.o: dict_memcache.c
dict_memcache.o: dict_memcache.h
dict_memcache.o: memcache_proto.h
dict_memcache.o: string_list.h
-dict_mysql.o: ../../include/argv.h
-dict_mysql.o: ../../include/dict.h
-dict_mysql.o: ../../include/events.h
-dict_mysql.o: ../../include/find_inet.h
-dict_mysql.o: ../../include/match_list.h
-dict_mysql.o: ../../include/msg.h
-dict_mysql.o: ../../include/myflock.h
-dict_mysql.o: ../../include/mymalloc.h
-dict_mysql.o: ../../include/myrand.h
-dict_mysql.o: ../../include/split_at.h
-dict_mysql.o: ../../include/stringops.h
dict_mysql.o: ../../include/sys_defs.h
-dict_mysql.o: ../../include/vbuf.h
-dict_mysql.o: ../../include/vstream.h
-dict_mysql.o: ../../include/vstring.h
-dict_mysql.o: cfg_parser.h
-dict_mysql.o: db_common.h
dict_mysql.o: dict_mysql.c
-dict_mysql.o: dict_mysql.h
-dict_mysql.o: string_list.h
-dict_pgsql.o: ../../include/argv.h
-dict_pgsql.o: ../../include/dict.h
-dict_pgsql.o: ../../include/events.h
-dict_pgsql.o: ../../include/find_inet.h
-dict_pgsql.o: ../../include/match_list.h
-dict_pgsql.o: ../../include/msg.h
-dict_pgsql.o: ../../include/myflock.h
-dict_pgsql.o: ../../include/mymalloc.h
-dict_pgsql.o: ../../include/myrand.h
-dict_pgsql.o: ../../include/split_at.h
-dict_pgsql.o: ../../include/stringops.h
dict_pgsql.o: ../../include/sys_defs.h
-dict_pgsql.o: ../../include/vbuf.h
-dict_pgsql.o: ../../include/vstream.h
-dict_pgsql.o: ../../include/vstring.h
-dict_pgsql.o: cfg_parser.h
-dict_pgsql.o: db_common.h
dict_pgsql.o: dict_pgsql.c
-dict_pgsql.o: dict_pgsql.h
-dict_pgsql.o: string_list.h
dict_proxy.o: ../../include/argv.h
dict_proxy.o: ../../include/attr.h
dict_proxy.o: ../../include/dict.h
@@ -1621,6 +1585,7 @@ mbox_open.o: dsn_buf.h
mbox_open.o: mbox_conf.h
mbox_open.o: mbox_open.c
mbox_open.o: mbox_open.h
+memcache_proto.o: ../../include/compat_va_copy.h
memcache_proto.o: ../../include/msg.h
memcache_proto.o: ../../include/sys_defs.h
memcache_proto.o: ../../include/vbuf.h
diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h
index 65a352579..b6e7770d3 100644
--- a/postfix/src/global/mail_version.h
+++ b/postfix/src/global/mail_version.h
@@ -20,7 +20,7 @@
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20131117"
+#define MAIL_RELEASE_DATE "20131118"
#define MAIL_VERSION_NUMBER "2.11"
#ifdef SNAPSHOT
diff --git a/postfix/src/global/memcache_proto.c b/postfix/src/global/memcache_proto.c
index 9d7e986b7..8262269c7 100644
--- a/postfix/src/global/memcache_proto.c
+++ b/postfix/src/global/memcache_proto.c
@@ -49,6 +49,7 @@
#include
#include
#include
+#include
/* Application-specific. */
@@ -182,12 +183,15 @@ int memcache_printf(VSTREAM *stream, const char *fmt,...)
va_list ap;
int ret;
+ va_start(ap, fmt);
+
if (msg_verbose) {
VSTRING *buf = vstring_alloc(100);
+ va_list ap2;
- va_start(ap, fmt);
- vstring_vsprintf(buf, fmt, ap);
- va_end(ap);
+ VA_COPY(ap2, ap);
+ vstring_vsprintf(buf, fmt, ap2);
+ va_end(ap2);
msg_info("%s write: %s", VSTREAM_PATH(stream), STR(buf));
vstring_free(buf);
}
@@ -195,7 +199,6 @@ int memcache_printf(VSTREAM *stream, const char *fmt,...)
/*
* Do the I/O.
*/
- va_start(ap, fmt);
ret = memcache_vprintf(stream, fmt, ap);
va_end(ap);
return (ret);
diff --git a/postfix/src/milter/Makefile.in b/postfix/src/milter/Makefile.in
index c28263a5e..99b646902 100644
--- a/postfix/src/milter/Makefile.in
+++ b/postfix/src/milter/Makefile.in
@@ -96,6 +96,7 @@ milter.o: milter.c
milter.o: milter.h
milter8.o: ../../include/argv.h
milter8.o: ../../include/attr.h
+milter8.o: ../../include/compat_va_copy.h
milter8.o: ../../include/connect.h
milter8.o: ../../include/header_opts.h
milter8.o: ../../include/iostuff.h
diff --git a/postfix/src/milter/milter8.c b/postfix/src/milter/milter8.c
index 22d4c419f..5941c5aa6 100644
--- a/postfix/src/milter/milter8.c
+++ b/postfix/src/milter/milter8.c
@@ -80,6 +80,7 @@
#include
#include
#include
+#include
/* Global library. */
@@ -911,22 +912,27 @@ static int vmilter8_write_cmd(MILTER8 *milter, int command, ssize_t data_len,
static int milter8_write_cmd(MILTER8 *milter, int command,...)
{
va_list ap;
+ va_list ap2;
ssize_t data_len;
int err;
/*
- * Size the command data.
+ * Initialize argument lists.
*/
va_start(ap, command);
+ VA_COPY(ap2, ap);
+
+ /*
+ * Size the command data.
+ */
data_len = vmilter8_size_data(ap);
va_end(ap);
/*
* Send the command and data.
*/
- va_start(ap, command);
- err = vmilter8_write_cmd(milter, command, data_len, ap);
- va_end(ap);
+ err = vmilter8_write_cmd(milter, command, data_len, ap2);
+ va_end(ap2);
return (err);
}
@@ -940,6 +946,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
{
const char *myname = "milter8_event";
va_list ap;
+ va_list ap2;
ssize_t data_len;
int err;
unsigned char cmd;
@@ -1036,20 +1043,28 @@ static const char *milter8_event(MILTER8 *milter, int event,
return (milter->def_reply);
}
+ /*
+ * Initialize argument lists.
+ */
+ va_start(ap, macros);
+ VA_COPY(ap2, ap);
+
/*
* Compute the command data size. This is necessary because the protocol
* sends length before content.
*/
- va_start(ap, macros);
data_len = vmilter8_size_data(ap);
va_end(ap);
/*
* Send the command and data.
*/
- va_start(ap, macros);
- err = vmilter8_write_cmd(milter, event, data_len, ap);
- va_end(ap);
+ err = vmilter8_write_cmd(milter, event, data_len, ap2);
+ va_end(ap2);
+
+ /*
+ * C99 requires that we finalize argument lists before returning.
+ */
if (err != 0)
return (milter->def_reply);
diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in
index 4a1d9487e..3b5d43b04 100644
--- a/postfix/src/postconf/Makefile.in
+++ b/postfix/src/postconf/Makefile.in
@@ -567,6 +567,7 @@ postconf.o: ../../include/mail_version.h
postconf.o: ../../include/msg.h
postconf.o: ../../include/msg_vstream.h
postconf.o: ../../include/myflock.h
+postconf.o: ../../include/mymalloc.h
postconf.o: ../../include/name_mask.h
postconf.o: ../../include/stringops.h
postconf.o: ../../include/sys_defs.h
diff --git a/postfix/src/posttls-finger/Makefile.in b/postfix/src/posttls-finger/Makefile.in
index 9be25502b..c5ab762be 100644
--- a/postfix/src/posttls-finger/Makefile.in
+++ b/postfix/src/posttls-finger/Makefile.in
@@ -90,10 +90,15 @@ posttls-finger.o: ../../include/vstring.h
posttls-finger.o: ../../include/vstring_vstream.h
posttls-finger.o: posttls-finger.c
posttls-finger.o: tlsmgrmem.h
+tlsmgrmem.o: ../../include/argv.h
+tlsmgrmem.o: ../../include/dict.h
tlsmgrmem.o: ../../include/htable.h
+tlsmgrmem.o: ../../include/myflock.h
tlsmgrmem.o: ../../include/sys_defs.h
tlsmgrmem.o: ../../include/tls_mgr.h
+tlsmgrmem.o: ../../include/tls_scache.h
tlsmgrmem.o: ../../include/vbuf.h
+tlsmgrmem.o: ../../include/vstream.h
tlsmgrmem.o: ../../include/vstring.h
tlsmgrmem.o: tlsmgrmem.c
tlsmgrmem.o: tlsmgrmem.h
diff --git a/postfix/src/smtp/Makefile.in b/postfix/src/smtp/Makefile.in
index 35fa14e83..a70ce1dea 100644
--- a/postfix/src/smtp/Makefile.in
+++ b/postfix/src/smtp/Makefile.in
@@ -625,6 +625,7 @@ smtp_tls_policy.o: ../../include/attr.h
smtp_tls_policy.o: ../../include/ctable.h
smtp_tls_policy.o: ../../include/deliver_request.h
smtp_tls_policy.o: ../../include/dict.h
+smtp_tls_policy.o: ../../include/dns.h
smtp_tls_policy.o: ../../include/dsn.h
smtp_tls_policy.o: ../../include/dsn_buf.h
smtp_tls_policy.o: ../../include/header_body_checks.h
@@ -636,6 +637,7 @@ smtp_tls_policy.o: ../../include/match_list.h
smtp_tls_policy.o: ../../include/mime_state.h
smtp_tls_policy.o: ../../include/msg.h
smtp_tls_policy.o: ../../include/msg_stats.h
+smtp_tls_policy.o: ../../include/myaddrinfo.h
smtp_tls_policy.o: ../../include/myflock.h
smtp_tls_policy.o: ../../include/mymalloc.h
smtp_tls_policy.o: ../../include/name_code.h
@@ -643,6 +645,7 @@ smtp_tls_policy.o: ../../include/name_mask.h
smtp_tls_policy.o: ../../include/recipient_list.h
smtp_tls_policy.o: ../../include/resolve_clnt.h
smtp_tls_policy.o: ../../include/scache.h
+smtp_tls_policy.o: ../../include/sock_addr.h
smtp_tls_policy.o: ../../include/string_list.h
smtp_tls_policy.o: ../../include/stringops.h
smtp_tls_policy.o: ../../include/sys_defs.h
diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c
index 3ff8959f7..c3cc37c68 100644
--- a/postfix/src/smtpd/smtpd.c
+++ b/postfix/src/smtpd/smtpd.c
@@ -130,7 +130,8 @@
/* .PP
/* Available in Postfix version 2.9 and later:
/* .IP "\fBsmtpd_per_record_deadline (normal: no, overload: yes)\fR"
-/* Change the behavior of the smtpd_timeout time limit, from a
+/* Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
+/* time limits, from a
/* time limit per read or write system call, to a time limit to send
/* or receive a complete record (an SMTP command line, SMTP response
/* line, SMTP message content line, or TLS protocol message).
@@ -660,7 +661,8 @@
/* .PP
/* Available in Postfix version 2.9 and later:
/* .IP "\fBsmtpd_per_record_deadline (normal: no, overload: yes)\fR"
-/* Change the behavior of the smtpd_timeout time limit, from a
+/* Change the behavior of the smtpd_timeout and smtpd_starttls_timeout
+/* time limits, from a
/* time limit per read or write system call, to a time limit to send
/* or receive a complete record (an SMTP command line, SMTP response
/* line, SMTP message content line, or TLS protocol message).
@@ -1840,7 +1842,7 @@ static int mail_open_stream(SMTPD_STATE *state)
if (smtpd_proxy_create(state, smtpd_proxy_opts, var_smtpd_proxy_filt,
var_smtpd_proxy_tmout, var_smtpd_proxy_ehlo,
state->proxy_mail) != 0) {
- smtpd_chat_reply(state, "%s", STR(state->proxy->buffer));
+ smtpd_chat_reply(state, "%s", STR(state->proxy->reply));
smtpd_proxy_free(state);
return (-1);
}
@@ -2683,7 +2685,7 @@ static int rcpt_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
proxy = state->proxy;
if (proxy != 0 && proxy->cmd(state, SMTPD_PROX_WANT_OK,
"%s", STR(state->buffer)) != 0) {
- smtpd_chat_reply(state, "%s", STR(proxy->buffer));
+ smtpd_chat_reply(state, "%s", STR(proxy->reply));
return (-1);
}
@@ -2932,7 +2934,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
proxy = state->proxy;
if (proxy != 0 && proxy->cmd(state, SMTPD_PROX_WANT_MORE,
"%s", STR(state->buffer)) != 0) {
- smtpd_chat_reply(state, "%s", STR(proxy->buffer));
+ smtpd_chat_reply(state, "%s", STR(proxy->reply));
return (-1);
}
@@ -3142,7 +3144,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
if (state->err == CLEANUP_STAT_OK) {
(void) proxy->cmd(state, SMTPD_PROX_WANT_ANY, ".");
if (state->err == CLEANUP_STAT_OK &&
- *STR(proxy->buffer) != '2')
+ *STR(proxy->reply) != '2')
state->err = CLEANUP_STAT_CONT;
}
}
@@ -3231,7 +3233,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
state->error_mask = 0;
state->junk_cmds = 0;
if (proxy)
- smtpd_chat_reply(state, "%s", STR(proxy->buffer));
+ smtpd_chat_reply(state, "%s", STR(proxy->reply));
else
smtpd_chat_reply(state,
"250 2.0.0 Ok: queued as %s", state->queue_id);
@@ -3267,7 +3269,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
state->error_mask |= MAIL_ERROR_POLICY;
detail = cleanup_stat_detail(CLEANUP_STAT_CONT);
if (proxy) {
- smtpd_chat_reply(state, "%s", STR(proxy->buffer));
+ smtpd_chat_reply(state, "%s", STR(proxy->reply));
} else if (why && LEN(why) > 0) {
/* Allow address-specific DSN status in header/body_checks. */
smtpd_chat_reply(state, "%d %s", detail->smtp, STR(why));
@@ -3282,7 +3284,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
detail->smtp, detail->dsn, detail->text);
} else if ((state->err & CLEANUP_STAT_PROXY) != 0) {
state->error_mask |= MAIL_ERROR_SOFTWARE;
- smtpd_chat_reply(state, "%s", STR(proxy->buffer));
+ smtpd_chat_reply(state, "%s", STR(proxy->reply));
} else {
state->error_mask |= MAIL_ERROR_SOFTWARE;
detail = cleanup_stat_detail(CLEANUP_STAT_BAD);
@@ -3296,7 +3298,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
if (proxy)
msg_info("proxy-%s: %s: %s;%s",
(state->err == CLEANUP_STAT_OK) ? "accept" : "reject",
- state->where, STR(proxy->buffer), smtpd_whatsup(state));
+ state->where, STR(proxy->reply), smtpd_whatsup(state));
/*
* Cleanup. The client may send another MAIL command.
diff --git a/postfix/src/smtpd/smtpd_proxy.c b/postfix/src/smtpd/smtpd_proxy.c
index aec804974..f20e673c5 100644
--- a/postfix/src/smtpd/smtpd_proxy.c
+++ b/postfix/src/smtpd/smtpd_proxy.c
@@ -388,7 +388,7 @@ static int smtpd_proxy_connect(SMTPD_STATE *state)
* Parse the EHLO reply and see if we can forward logging information.
*/
server_xforward_features = 0;
- lines = STR(proxy->buffer);
+ lines = STR(proxy->reply);
while ((words = mystrtok(&lines, "\n")) != 0) {
if (mystrtok(&words, "- ") && (word = mystrtok(&words, " \t")) != 0) {
if (strcasecmp(word, XFORWARD_CMD) == 0)
@@ -472,7 +472,7 @@ static void smtpd_proxy_fake_server_reply(SMTPD_STATE *state, int status)
* response instead.
*/
detail = cleanup_stat_detail(status);
- vstring_sprintf(state->proxy->buffer,
+ vstring_sprintf(state->proxy->reply,
"%d %s Error: %s",
detail->smtp, detail->dsn, detail->text);
}
@@ -692,27 +692,6 @@ static int smtpd_proxy_save_cmd(SMTPD_STATE *state, int expect, const char *fmt,
return (strcmp(fmt, ".") ? 0 : smtpd_proxy_replay_send(state));
}
-/* smtpd_proxy_cmd_warn - report unexpected proxy reply */
-
-static void smtpd_proxy_cmd_warn(SMTPD_STATE *state, const char *fmt,
- va_list ap)
-{
- SMTPD_PROXY *proxy = state->proxy;
- VSTRING *buf;
-
- /*
- * The command can be omitted at the start of an SMTP session. A null
- * format string is not documented as part of the official interface
- * because it is used only internally to this module.
- */
- buf = vstring_alloc(100);
- vstring_vsprintf(buf, fmt == SMTPD_PROXY_CONN_FMT ?
- "connection request" : fmt, ap);
- msg_warn("proxy %s rejected \"%s\": \"%s\"",
- proxy->service_name, STR(buf), STR(proxy->buffer));
- vstring_free(buf);
-}
-
/* smtpd_proxy_cmd - send command to proxy, receive reply */
static int smtpd_proxy_cmd(SMTPD_STATE *state, int expect, const char *fmt,...)
@@ -744,7 +723,7 @@ static int smtpd_proxy_cmd(SMTPD_STATE *state, int expect, const char *fmt,...)
* Format the command.
*/
va_start(ap, fmt);
- vstring_vsprintf(proxy->buffer, fmt, ap);
+ vstring_vsprintf(proxy->request, fmt, ap);
va_end(ap);
/*
@@ -752,13 +731,13 @@ static int smtpd_proxy_cmd(SMTPD_STATE *state, int expect, const char *fmt,...)
* what the program is trying to do.
*/
if (msg_verbose)
- msg_info("> %s: %s", proxy->service_name, STR(proxy->buffer));
+ msg_info("> %s: %s", proxy->service_name, STR(proxy->request));
/*
* Send the command to the proxy server. Since we're going to read a
* reply immediately, there is no need to flush buffers.
*/
- smtp_fputs(STR(proxy->buffer), LEN(proxy->buffer),
+ smtp_fputs(STR(proxy->request), LEN(proxy->request),
proxy->service_stream);
}
@@ -776,7 +755,7 @@ static int smtpd_proxy_cmd(SMTPD_STATE *state, int expect, const char *fmt,...)
* We can't parse or store input that exceeds var_line_limit, so we just
* skip over it to simplify the remainder of the code below.
*/
- VSTRING_RESET(proxy->buffer);
+ VSTRING_RESET(proxy->reply);
if (buffer == 0)
buffer = vstring_alloc(10);
for (;;) {
@@ -794,10 +773,10 @@ static int smtpd_proxy_cmd(SMTPD_STATE *state, int expect, const char *fmt,...)
* Defend against a denial of service attack by limiting the amount
* of multi-line text that we are willing to store.
*/
- if (LEN(proxy->buffer) < var_line_limit) {
- if (VSTRING_LEN(proxy->buffer))
- vstring_strcat(proxy->buffer, "\r\n");
- vstring_strcat(proxy->buffer, STR(buffer));
+ if (LEN(proxy->reply) < var_line_limit) {
+ if (VSTRING_LEN(proxy->reply))
+ vstring_strcat(proxy->reply, "\r\n");
+ vstring_strcat(proxy->reply, STR(buffer));
}
/*
@@ -826,12 +805,13 @@ static int smtpd_proxy_cmd(SMTPD_STATE *state, int expect, const char *fmt,...)
* proxy replies. They are a source of support problems, so we replace
* them by generic server error replies.
*/
- if (expect != SMTPD_PROX_WANT_ANY && expect != *STR(proxy->buffer)) {
- va_start(ap, fmt);
- smtpd_proxy_cmd_warn(state, fmt, ap);
- va_end(ap);
- if (*STR(proxy->buffer) == SMTPD_PROX_WANT_OK
- || *STR(proxy->buffer) == SMTPD_PROX_WANT_MORE) {
+ if (expect != SMTPD_PROX_WANT_ANY && expect != *STR(proxy->reply)) {
+ msg_warn("proxy %s rejected \"%s\": \"%s\"",
+ proxy->service_name, fmt == SMTPD_PROXY_CONN_FMT ?
+ "connection request" : STR(proxy->request),
+ STR(proxy->reply));
+ if (*STR(proxy->reply) == SMTPD_PROX_WANT_OK
+ || *STR(proxy->reply) == SMTPD_PROX_WANT_MORE) {
smtpd_proxy_rdwr_error(state, 0);
}
return (-1);
@@ -1038,10 +1018,10 @@ int smtpd_proxy_create(SMTPD_STATE *state, int flags, const char *service,
* When an operation has many arguments it is safer to use named
* parameters, and have the compiler enforce the argument count.
*/
-#define SMTPD_PROXY_ALLOC(p, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) \
+#define SMTPD_PROXY_ALLOC(p, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) \
((p) = (SMTPD_PROXY *) mymalloc(sizeof(*(p))), (p)->a1, (p)->a2, \
(p)->a3, (p)->a4, (p)->a5, (p)->a6, (p)->a7, (p)->a8, (p)->a9, \
- (p)->a10, (p)->a11, (p))
+ (p)->a10, (p)->a11, (p)->a12, (p))
/*
* Sanity check.
@@ -1054,7 +1034,8 @@ int smtpd_proxy_create(SMTPD_STATE *state, int flags, const char *service,
*/
if ((flags & SMTPD_PROXY_FLAG_SPEED_ADJUST) == 0) {
state->proxy =
- SMTPD_PROXY_ALLOC(proxy, stream = 0, buffer = vstring_alloc(10),
+ SMTPD_PROXY_ALLOC(proxy, stream = 0, request = vstring_alloc(10),
+ reply = vstring_alloc(10),
cmd = smtpd_proxy_cmd,
rec_fprintf = smtpd_proxy_rec_fprintf,
rec_put = smtpd_proxy_rec_put,
@@ -1062,7 +1043,7 @@ int smtpd_proxy_create(SMTPD_STATE *state, int flags, const char *service,
service_name = service, timeout = timeout,
ehlo_name = ehlo_name, mail_from = mail_from);
if (smtpd_proxy_connect(state) < 0) {
- /* NOT: smtpd_proxy_free(state); we still need proxy->buffer. */
+ /* NOT: smtpd_proxy_free(state); we still need proxy->reply. */
return (-1);
}
proxy->stream = proxy->service_stream;
@@ -1083,7 +1064,8 @@ int smtpd_proxy_create(SMTPD_STATE *state, int flags, const char *service,
return (-1);
state->proxy =
SMTPD_PROXY_ALLOC(proxy, stream = smtpd_proxy_replay_stream,
- buffer = vstring_alloc(10),
+ request = vstring_alloc(10),
+ reply = vstring_alloc(10),
cmd = smtpd_proxy_save_cmd,
rec_fprintf = smtpd_proxy_save_rec_fprintf,
rec_put = smtpd_proxy_save_rec_put,
@@ -1102,18 +1084,14 @@ void smtpd_proxy_close(SMTPD_STATE *state)
SMTPD_PROXY *proxy = state->proxy;
/*
- * XXX We can't send QUIT if the stream is still good, because that would
- * overwrite the last server reply in proxy->buffer. We probably should
- * just bite the bullet and allocate separate buffers for sending and
- * receiving.
+ * Specify SMTPD_PROX_WANT_NONE so that the server reply will not clobber
+ * the END-OF-DATA reply.
*/
if (proxy->service_stream != 0) {
-#if 0
if (vstream_feof(proxy->service_stream) == 0
&& vstream_ferror(proxy->service_stream) == 0)
(void) smtpd_proxy_cmd(state, SMTPD_PROX_WANT_NONE,
SMTPD_CMD_QUIT);
-#endif
(void) vstream_fclose(proxy->service_stream);
if (proxy->stream == proxy->service_stream)
proxy->stream = 0;
@@ -1132,8 +1110,10 @@ void smtpd_proxy_free(SMTPD_STATE *state)
*/
if (proxy->service_stream != 0)
(void) smtpd_proxy_close(state);
- if (proxy->buffer != 0)
- vstring_free(proxy->buffer);
+ if (proxy->request != 0)
+ vstring_free(proxy->request);
+ if (proxy->reply != 0)
+ vstring_free(proxy->reply);
myfree((char *) proxy);
state->proxy = 0;
diff --git a/postfix/src/smtpd/smtpd_proxy.h b/postfix/src/smtpd/smtpd_proxy.h
index a0a7252ff..3d35d07c4 100644
--- a/postfix/src/smtpd/smtpd_proxy.h
+++ b/postfix/src/smtpd/smtpd_proxy.h
@@ -25,7 +25,8 @@ typedef int (*SMTPD_PROXY_REC_PUT_FN) (VSTREAM *, int, const char *, ssize_t);
typedef struct SMTPD_PROXY {
/* Public. */
VSTREAM *stream;
- VSTRING *buffer; /* proxy query/reply buffer */
+ VSTRING *request; /* proxy request buffer */
+ VSTRING *reply; /* proxy reply buffer */
SMTPD_PROXY_CMD_FN cmd;
SMTPD_PROXY_REC_FPRINTF_FN rec_fprintf;
SMTPD_PROXY_REC_PUT_FN rec_put;
diff --git a/postfix/src/smtpstone/Makefile.in b/postfix/src/smtpstone/Makefile.in
index f51b0f6de..79a3ecad6 100644
--- a/postfix/src/smtpstone/Makefile.in
+++ b/postfix/src/smtpstone/Makefile.in
@@ -141,6 +141,7 @@ smtp-sink.o: ../../include/vstream.h
smtp-sink.o: ../../include/vstring.h
smtp-sink.o: ../../include/vstring_vstream.h
smtp-sink.o: smtp-sink.c
+smtp-source.o: ../../include/compat_va_copy.h
smtp-source.o: ../../include/connect.h
smtp-source.o: ../../include/events.h
smtp-source.o: ../../include/get_hostname.h
diff --git a/postfix/src/smtpstone/smtp-source.c b/postfix/src/smtpstone/smtp-source.c
index 4bc531aaa..592b9b0bc 100644
--- a/postfix/src/smtpstone/smtp-source.c
+++ b/postfix/src/smtpstone/smtp-source.c
@@ -143,6 +143,7 @@
#include
#include
#include
+#include
/* Global library. */
@@ -245,6 +246,9 @@ static void command(VSTREAM *stream, char *fmt,...)
{
VSTRING *buf;
va_list ap;
+ va_list ap2;
+
+ va_start(ap, fmt);
/*
* Optionally, log the command before actually sending, so we can see
@@ -252,13 +256,12 @@ static void command(VSTREAM *stream, char *fmt,...)
*/
if (msg_verbose) {
buf = vstring_alloc(100);
- va_start(ap, fmt);
- vstring_vsprintf(buf, fmt, ap);
- va_end(ap);
+ VA_COPY(ap2, ap);
+ vstring_vsprintf(buf, fmt, ap2);
+ va_end(ap2);
msg_info("%s", vstring_str(buf));
vstring_free(buf);
}
- va_start(ap, fmt);
smtp_vprintf(stream, fmt, ap);
va_end(ap);
smtp_flush(stream);
diff --git a/postfix/src/tls/Makefile.in b/postfix/src/tls/Makefile.in
index d3d3a2f9c..614a49a52 100644
--- a/postfix/src/tls/Makefile.in
+++ b/postfix/src/tls/Makefile.in
@@ -114,9 +114,11 @@ tls_certkey.o: ../../include/vstring.h
tls_certkey.o: tls.h
tls_certkey.o: tls_certkey.c
tls_client.o: ../../include/argv.h
+tls_client.o: ../../include/dict.h
tls_client.o: ../../include/iostuff.h
tls_client.o: ../../include/mail_params.h
tls_client.o: ../../include/msg.h
+tls_client.o: ../../include/myflock.h
tls_client.o: ../../include/mymalloc.h
tls_client.o: ../../include/name_code.h
tls_client.o: ../../include/name_mask.h
@@ -128,6 +130,7 @@ tls_client.o: ../../include/vstring.h
tls_client.o: tls.h
tls_client.o: tls_client.c
tls_client.o: tls_mgr.h
+tls_client.o: tls_scache.h
tls_dane.o: ../../include/argv.h
tls_dane.o: ../../include/ctable.h
tls_dane.o: ../../include/dns.h
@@ -181,12 +184,15 @@ tls_level.o: ../../include/vstream.h
tls_level.o: ../../include/vstring.h
tls_level.o: tls.h
tls_level.o: tls_level.c
+tls_mgr.o: ../../include/argv.h
tls_mgr.o: ../../include/attr.h
tls_mgr.o: ../../include/attr_clnt.h
+tls_mgr.o: ../../include/dict.h
tls_mgr.o: ../../include/iostuff.h
tls_mgr.o: ../../include/mail_params.h
tls_mgr.o: ../../include/mail_proto.h
tls_mgr.o: ../../include/msg.h
+tls_mgr.o: ../../include/myflock.h
tls_mgr.o: ../../include/mymalloc.h
tls_mgr.o: ../../include/stringops.h
tls_mgr.o: ../../include/sys_defs.h
@@ -195,6 +201,7 @@ tls_mgr.o: ../../include/vstream.h
tls_mgr.o: ../../include/vstring.h
tls_mgr.o: tls_mgr.c
tls_mgr.o: tls_mgr.h
+tls_mgr.o: tls_scache.h
tls_misc.o: ../../include/argv.h
tls_misc.o: ../../include/mail_conf.h
tls_misc.o: ../../include/mail_params.h
@@ -298,13 +305,16 @@ tls_scache.o: ../../include/myflock.h
tls_scache.o: ../../include/mymalloc.h
tls_scache.o: ../../include/stringops.h
tls_scache.o: ../../include/sys_defs.h
+tls_scache.o: ../../include/timecmp.h
tls_scache.o: ../../include/vbuf.h
tls_scache.o: ../../include/vstream.h
tls_scache.o: ../../include/vstring.h
tls_scache.o: tls_scache.c
tls_scache.o: tls_scache.h
tls_seed.o: ../../include/argv.h
+tls_seed.o: ../../include/dict.h
tls_seed.o: ../../include/msg.h
+tls_seed.o: ../../include/myflock.h
tls_seed.o: ../../include/name_code.h
tls_seed.o: ../../include/name_mask.h
tls_seed.o: ../../include/sys_defs.h
@@ -313,6 +323,7 @@ tls_seed.o: ../../include/vstream.h
tls_seed.o: ../../include/vstring.h
tls_seed.o: tls.h
tls_seed.o: tls_mgr.h
+tls_seed.o: tls_scache.h
tls_seed.o: tls_seed.c
tls_server.o: ../../include/argv.h
tls_server.o: ../../include/dict.h
@@ -331,6 +342,7 @@ tls_server.o: ../../include/vstream.h
tls_server.o: ../../include/vstring.h
tls_server.o: tls.h
tls_server.o: tls_mgr.h
+tls_server.o: tls_scache.h
tls_server.o: tls_server.c
tls_session.o: ../../include/argv.h
tls_session.o: ../../include/msg.h
diff --git a/postfix/src/tls/tls_dane.c b/postfix/src/tls/tls_dane.c
index 6e6e1fb9c..640cb47bf 100644
--- a/postfix/src/tls/tls_dane.c
+++ b/postfix/src/tls/tls_dane.c
@@ -283,23 +283,6 @@ void tls_dane_verbose(int on)
dane_verbose = on;
}
-/* digest_info_cmp - qsort() comparator for digest_table */
-
-static int digest_info_cmp(const void *a, const void *b)
-{
- register const digest_info *ai = (const digest_info *) a;
- register const digest_info *bi = (const digest_info *) b;
-
- /*
- * Negative preferences sort last. Otherwise, sort in ascending order.
- */
- if (ai->pref == bi->pref)
- return (0);
- if (ai->pref < 0 || bi->pref < 0)
- return bi->pref - ai->pref;
- return ai->pref - bi->pref;
-}
-
/* dane_digest_info - locate digest_table entry for given IANA id */
static digest_info *dane_digest_info(uint8_t dane_id)
@@ -397,10 +380,6 @@ static void dane_init(void)
}
myfree(save);
- if (digest_pref > 0)
- qsort(digest_table, digest_pref, sizeof(digest_table[0]),
- digest_info_cmp);
-
/* Don't report old news */
ERR_clear_error();
diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in
index 312be3866..8040e419e 100644
--- a/postfix/src/util/Makefile.in
+++ b/postfix/src/util/Makefile.in
@@ -96,7 +96,7 @@ HDRS = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \
vstring_vstream.h watchdog.h format_tv.h load_file.h killme_after.h \
edit_file.h dict_cache.h dict_thash.h ip_match.h nbbio.h base32_code.h \
dict_fail.h warn_stat.h dict_sockmap.h line_number.h timecmp.h \
- slmdb.h
+ slmdb.h compat_va_copy.h
TESTSRC = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
stream_test.c dup2_pass_on_exec.c
DEFS = -I. -D$(SYSTYPE)
@@ -720,6 +720,7 @@ attr_clnt.o: attr.h
attr_clnt.o: attr_clnt.c
attr_clnt.o: attr_clnt.h
attr_clnt.o: auto_clnt.h
+attr_clnt.o: compat_va_copy.h
attr_clnt.o: htable.h
attr_clnt.o: iostuff.h
attr_clnt.o: msg.h
@@ -847,6 +848,7 @@ close_on_exec.o: close_on_exec.c
close_on_exec.o: iostuff.h
close_on_exec.o: msg.h
close_on_exec.o: sys_defs.h
+concatenate.o: compat_va_copy.h
concatenate.o: concatenate.c
concatenate.o: mymalloc.h
concatenate.o: stringops.h
@@ -1143,6 +1145,7 @@ dict_static.o: vbuf.h
dict_static.o: vstream.h
dict_static.o: vstring.h
dict_surrogate.o: argv.h
+dict_surrogate.o: compat_va_copy.h
dict_surrogate.o: dict.h
dict_surrogate.o: dict_surrogate.c
dict_surrogate.o: msg.h
@@ -1593,6 +1596,7 @@ nbbio.o: mymalloc.h
nbbio.o: nbbio.c
nbbio.o: nbbio.h
nbbio.o: sys_defs.h
+netstring.o: compat_va_copy.h
netstring.o: msg.h
netstring.o: netstring.c
netstring.o: netstring.h
diff --git a/postfix/src/util/attr_clnt.c b/postfix/src/util/attr_clnt.c
index 8210993e3..62b225bbf 100644
--- a/postfix/src/util/attr_clnt.c
+++ b/postfix/src/util/attr_clnt.c
@@ -85,6 +85,7 @@
#include
#include
#include
+#include
#include
#include
@@ -125,6 +126,7 @@ int attr_clnt_request(ATTR_CLNT *client, int send_flags,...)
const char *myname = "attr_clnt_request";
VSTREAM *stream;
int count = 0;
+ va_list saved_ap;
va_list ap;
int type;
int recv_flags;
@@ -147,17 +149,19 @@ int attr_clnt_request(ATTR_CLNT *client, int send_flags,...)
(void) va_arg(ap, t2); \
}
+ /* Finalize argument lists before returning. */
+ va_start(saved_ap, send_flags);
for (;;) {
errno = 0;
if ((stream = auto_clnt_access(client->auto_clnt)) != 0
&& readable(vstream_fileno(stream)) == 0) {
errno = 0;
- va_start(ap, send_flags);
+ VA_COPY(ap, saved_ap);
err = (client->print(stream, send_flags, ap) != 0
|| vstream_fflush(stream) != 0);
va_end(ap);
if (err == 0) {
- va_start(ap, send_flags);
+ VA_COPY(ap, saved_ap);
while ((type = va_arg(ap, int)) != ATTR_TYPE_END) {
switch (type) {
case ATTR_TYPE_STR:
@@ -183,8 +187,9 @@ int attr_clnt_request(ATTR_CLNT *client, int send_flags,...)
recv_flags = va_arg(ap, int);
ret = client->scan(stream, recv_flags, ap);
va_end(ap);
+ /* Finalize argument lists before returning. */
if (ret > 0)
- return (ret);
+ break;
}
}
if (++count >= 2
@@ -192,11 +197,17 @@ int attr_clnt_request(ATTR_CLNT *client, int send_flags,...)
|| (errno && errno != EPIPE && errno != ENOENT && errno != ECONNRESET))
msg_warn("problem talking to server %s: %m",
auto_clnt_name(client->auto_clnt));
- if (count >= 2)
- return (-1);
+ /* Finalize argument lists before returning. */
+ if (count >= 2) {
+ ret = -1;
+ break;
+ }
sleep(1); /* XXX make configurable */
auto_clnt_recover(client->auto_clnt);
}
+ /* Finalize argument lists before returning. */
+ va_end(saved_ap);
+ return (ret);
}
/* attr_clnt_control - fine control */
diff --git a/postfix/src/util/attr_clnt.h b/postfix/src/util/attr_clnt.h
index 5660f1840..0a752094e 100644
--- a/postfix/src/util/attr_clnt.h
+++ b/postfix/src/util/attr_clnt.h
@@ -11,6 +11,11 @@
/* DESCRIPTION
/* .nf
+ /*
+ * System library.
+ */
+#include
+
/*
* Utility library.
*/
diff --git a/postfix/src/util/attr_print0.c b/postfix/src/util/attr_print0.c
index 7c6767843..ba8950e62 100644
--- a/postfix/src/util/attr_print0.c
+++ b/postfix/src/util/attr_print0.c
@@ -223,14 +223,14 @@ int main(int unused_argc, char **argv)
htable_enter(table, "bar-name", mystrdup("bar-value"));
attr_print0(VSTREAM_OUT, ATTR_FLAG_NONE,
ATTR_TYPE_INT, ATTR_NAME_INT, 4711,
- ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234,
+ ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234L,
ATTR_TYPE_STR, ATTR_NAME_STR, "whoopee",
ATTR_TYPE_DATA, ATTR_NAME_DATA, strlen("whoopee"), "whoopee",
ATTR_TYPE_HASH, table,
ATTR_TYPE_END);
attr_print0(VSTREAM_OUT, ATTR_FLAG_NONE,
ATTR_TYPE_INT, ATTR_NAME_INT, 4711,
- ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234,
+ ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234L,
ATTR_TYPE_STR, ATTR_NAME_STR, "whoopee",
ATTR_TYPE_DATA, ATTR_NAME_DATA, strlen("whoopee"), "whoopee",
ATTR_TYPE_END);
diff --git a/postfix/src/util/attr_print64.c b/postfix/src/util/attr_print64.c
index 5fd3ed93b..8764758db 100644
--- a/postfix/src/util/attr_print64.c
+++ b/postfix/src/util/attr_print64.c
@@ -262,14 +262,14 @@ int main(int unused_argc, char **argv)
htable_enter(table, "bar-name", mystrdup("bar-value"));
attr_print64(VSTREAM_OUT, ATTR_FLAG_NONE,
ATTR_TYPE_INT, ATTR_NAME_INT, 4711,
- ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234,
+ ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234L,
ATTR_TYPE_STR, ATTR_NAME_STR, "whoopee",
ATTR_TYPE_DATA, ATTR_NAME_DATA, strlen("whoopee"), "whoopee",
ATTR_TYPE_HASH, table,
ATTR_TYPE_END);
attr_print64(VSTREAM_OUT, ATTR_FLAG_NONE,
ATTR_TYPE_INT, ATTR_NAME_INT, 4711,
- ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234,
+ ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234L,
ATTR_TYPE_STR, ATTR_NAME_STR, "whoopee",
ATTR_TYPE_DATA, ATTR_NAME_DATA, strlen("whoopee"), "whoopee",
ATTR_TYPE_END);
diff --git a/postfix/src/util/attr_print_plain.c b/postfix/src/util/attr_print_plain.c
index cc01c781f..51484bc61 100644
--- a/postfix/src/util/attr_print_plain.c
+++ b/postfix/src/util/attr_print_plain.c
@@ -217,14 +217,14 @@ int main(int unused_argc, char **argv)
htable_enter(table, "bar-name", mystrdup("bar-value"));
attr_print_plain(VSTREAM_OUT, ATTR_FLAG_NONE,
ATTR_TYPE_INT, ATTR_NAME_INT, 4711,
- ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234,
+ ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234L,
ATTR_TYPE_STR, ATTR_NAME_STR, "whoopee",
ATTR_TYPE_DATA, ATTR_NAME_DATA, strlen("whoopee"), "whoopee",
ATTR_TYPE_HASH, table,
ATTR_TYPE_END);
attr_print_plain(VSTREAM_OUT, ATTR_FLAG_NONE,
ATTR_TYPE_INT, ATTR_NAME_INT, 4711,
- ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234,
+ ATTR_TYPE_LONG, ATTR_NAME_LONG, 1234L,
ATTR_TYPE_STR, ATTR_NAME_STR, "whoopee",
ATTR_TYPE_DATA, ATTR_NAME_DATA, strlen("whoopee"), "whoopee",
ATTR_TYPE_END);
diff --git a/postfix/src/util/compat_va_copy.h b/postfix/src/util/compat_va_copy.h
new file mode 100644
index 000000000..6a2042be7
--- /dev/null
+++ b/postfix/src/util/compat_va_copy.h
@@ -0,0 +1,44 @@
+#ifndef _COMPAT_VA_COPY_H_INCLUDED_
+#define _COMPAT_VA_COPY_H_INCLUDED_
+
+/*++
+/* NAME
+/* compat_va_copy 3h
+/* SUMMARY
+/* compatibility
+/* SYNOPSIS
+/* #include
+/* DESCRIPTION
+/* .nf
+
+ /*
+ * C99 defines va_start and va_copy as macros, so we can probe the
+ * compilation environment with #ifdef etc. Some environments define
+ * __va_copy so we probe for that, too.
+ */
+#if !defined(va_start)
+#error "include first"
+#endif
+
+#if !defined(VA_COPY)
+#if defined(va_copy)
+#define VA_COPY(dest, src) va_copy(dest, src)
+#elif defined(__va_copy)
+#define VA_COPY(dest, src) __va_copy(dest, src)
+#else
+#define VA_COPY(dest, src) (dest) = (src)
+#endif
+#endif /* VA_COPY */
+
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* IBM T.J. Watson Research
+/* P.O. Box 704
+/* Yorktown Heights, NY 10598, USA
+/*--*/
+
+#endif
diff --git a/postfix/src/util/concatenate.c b/postfix/src/util/concatenate.c
index 1f9716074..7b6a3eb65 100644
--- a/postfix/src/util/concatenate.c
+++ b/postfix/src/util/concatenate.c
@@ -35,6 +35,7 @@
#include "mymalloc.h"
#include "stringops.h"
+#include "compat_va_copy.h"
/* concatenate - concatenate null-terminated list of strings */
@@ -42,13 +43,19 @@ char *concatenate(const char *arg0,...)
{
char *result;
va_list ap;
+ va_list ap2;
ssize_t len;
char *arg;
/*
- * Compute the length of the resulting string.
+ * Initialize argument lists.
*/
va_start(ap, arg0);
+ VA_COPY(ap2, ap);
+
+ /*
+ * Compute the length of the resulting string.
+ */
len = strlen(arg0);
while ((arg = va_arg(ap, char *)) != 0)
len += strlen(arg);
@@ -58,10 +65,9 @@ char *concatenate(const char *arg0,...)
* Build the resulting string. Don't care about wasting a CPU cycle.
*/
result = mymalloc(len + 1);
- va_start(ap, arg0);
strcpy(result, arg0);
- while ((arg = va_arg(ap, char *)) != 0)
+ while ((arg = va_arg(ap2, char *)) != 0)
strcat(result, arg);
- va_end(ap);
+ va_end(ap2);
return (result);
}
diff --git a/postfix/src/util/dict_surrogate.c b/postfix/src/util/dict_surrogate.c
index 4183d9259..ed7716ba5 100644
--- a/postfix/src/util/dict_surrogate.c
+++ b/postfix/src/util/dict_surrogate.c
@@ -61,6 +61,7 @@
#include
#include
+#include
#include
/* Application-specific. */
@@ -135,11 +136,18 @@ DICT *dict_surrogate(const char *dict_type, const char *dict_name,
const char *fmt,...)
{
va_list ap;
+ va_list ap2;
DICT_SURROGATE *dp;
VSTRING *buf;
void (*log_fn) (const char *, va_list);
int saved_errno = errno;
+ /*
+ * Initialize argument lists.
+ */
+ va_start(ap, fmt);
+ VA_COPY(ap2, ap);
+
/*
* Log the problem immediately when it is detected. The table may not be
* accessed in every program execution (that is the whole point of
@@ -147,7 +155,6 @@ DICT *dict_surrogate(const char *dict_type, const char *dict_name,
* to remain unnoticed until long after a configuration mistake is made.
*/
log_fn = dict_allow_surrogate ? vmsg_error : vmsg_fatal;
- va_start(ap, fmt);
log_fn(fmt, ap);
va_end(ap);
@@ -166,9 +173,8 @@ DICT *dict_surrogate(const char *dict_type, const char *dict_name,
dp->dict.owner.status = DICT_OWNER_TRUSTED;
buf = vstring_alloc(10);
errno = saved_errno;
- va_start(ap, fmt);
- vstring_vsprintf(buf, fmt, ap);
- va_end(ap);
+ vstring_vsprintf(buf, fmt, ap2);
+ va_end(ap2);
dp->reason = vstring_export(buf);
return (DICT_DEBUG (&dp->dict));
}
diff --git a/postfix/src/util/netstring.c b/postfix/src/util/netstring.c
index 467940640..49ab81952 100644
--- a/postfix/src/util/netstring.c
+++ b/postfix/src/util/netstring.c
@@ -164,6 +164,7 @@
#include
#include
#include
+#include
#include
/* Application-specific. */
@@ -291,41 +292,41 @@ void netstring_put_multi(VSTREAM *stream,...)
char *data;
ssize_t data_len;
va_list ap;
+ va_list ap2;
/*
- * Figure out the total result size.
+ * Initialize argument lists.
*/
va_start(ap, stream);
- for (total = 0; (data = va_arg(ap, char *)) != 0; total += data_len)
- if ((data_len = va_arg(ap, ssize_t)) < 0)
- msg_panic("netstring_put_multi: bad data length %ld", (long) data_len);
- va_end(ap);
+ VA_COPY(ap2, ap);
/*
- * Debugging support.
+ * Figure out the total result size.
*/
- if (msg_verbose > 1) {
- va_start(ap, stream);
- data = va_arg(ap, char *);
- data_len = va_arg(ap, ssize_t);
- msg_info("%s: write netstring len %ld data %.*s",
- myname, (long) total, (int) (data_len < 30 ? data_len : 30), data);
- va_end(ap);
- }
+ for (total = 0; (data = va_arg(ap, char *)) != 0; total += data_len)
+ if ((data_len = va_arg(ap, ssize_t)) < 0)
+ msg_panic("%s: bad data length %ld", myname, (long) data_len);
+ va_end(ap);
+ if (total < 0)
+ msg_panic("%s: bad total length %ld", myname, (long) total);
+ if (msg_verbose > 1)
+ msg_info("%s: write total length %ld", myname, (long) total);
/*
* Send the length, content and terminator.
*/
vstream_fprintf(stream, "%ld:", (long) total);
- va_start(ap, stream);
- while ((data = va_arg(ap, char *)) != 0) {
- data_len = va_arg(ap, ssize_t);
- if (data_len > 0)
- if (vstream_fwrite(stream, data, data_len) != data_len)
- netstring_except(stream, vstream_ftimeout(stream) ?
- NETSTRING_ERR_TIME : NETSTRING_ERR_EOF);
+ while ((data = va_arg(ap2, char *)) != 0) {
+ data_len = va_arg(ap2, ssize_t);
+ if (msg_verbose > 1)
+ msg_info("%s: write netstring len %ld data %.*s",
+ myname, (long) data_len,
+ (int) (data_len < 30 ? data_len : 30), data);
+ if (vstream_fwrite(stream, data, data_len) != data_len)
+ netstring_except(stream, vstream_ftimeout(stream) ?
+ NETSTRING_ERR_TIME : NETSTRING_ERR_EOF);
}
- va_end(ap);
+ va_end(ap2);
vstream_fwrite(stream, ",", 1);
}
diff --git a/postfix/src/util/slmdb.c b/postfix/src/util/slmdb.c
index 5a038620e..febeb488a 100644
--- a/postfix/src/util/slmdb.c
+++ b/postfix/src/util/slmdb.c
@@ -197,6 +197,7 @@
#include
#include
#include
+#include
/* Application-specific. */
diff --git a/postfix/src/util/slmdb.h b/postfix/src/util/slmdb.h
index 5a5e8021f..40fb1aeb6 100644
--- a/postfix/src/util/slmdb.h
+++ b/postfix/src/util/slmdb.h
@@ -14,7 +14,6 @@
/*
* System library.
*/
-#include
#include
#ifdef PATH_LMDB_H
--
2.47.3