From c4c5776091d26b07a443b6f34c63b7ecf359df66 Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Sun, 13 Mar 2005 00:00:00 -0500 Subject: [PATCH] postfix-2.3-20050313 --- postfix/HISTORY | 18 ++++++ postfix/Makefile.in | 2 +- postfix/README_FILES/INSTALL | 2 +- postfix/html/INSTALL.html | 2 +- postfix/proto/INSTALL.html | 2 +- postfix/src/anvil/Makefile.in | 2 +- postfix/src/bounce/Makefile.in | 2 +- postfix/src/cleanup/Makefile.in | 2 +- postfix/src/discard/Makefile.in | 2 +- postfix/src/dns/Makefile.in | 2 +- postfix/src/error/Makefile.in | 2 +- postfix/src/flush/Makefile.in | 2 +- postfix/src/fsstone/Makefile.in | 2 +- postfix/src/global/Makefile.in | 2 +- postfix/src/global/db_common.c | 8 ++- postfix/src/global/mail_version.h | 2 +- postfix/src/lmtp/Makefile.in | 2 +- postfix/src/local/Makefile.in | 2 +- postfix/src/master/Makefile.in | 2 +- postfix/src/oqmgr/Makefile.in | 2 +- postfix/src/pickup/Makefile.in | 2 +- postfix/src/pipe/Makefile.in | 2 +- postfix/src/postalias/Makefile.in | 2 +- postfix/src/postcat/Makefile.in | 2 +- postfix/src/postconf/Makefile.in | 2 +- postfix/src/postdrop/Makefile.in | 2 +- postfix/src/postfix/Makefile.in | 2 +- postfix/src/postkick/Makefile.in | 2 +- postfix/src/postlock/Makefile.in | 2 +- postfix/src/postlog/Makefile.in | 2 +- postfix/src/postmap/Makefile.in | 2 +- postfix/src/postqueue/Makefile.in | 2 +- postfix/src/postsuper/Makefile.in | 2 +- postfix/src/proxymap/Makefile.in | 2 +- postfix/src/qmgr/Makefile.in | 2 +- postfix/src/qmqpd/Makefile.in | 2 +- postfix/src/scache/Makefile.in | 2 +- postfix/src/sendmail/Makefile.in | 2 +- postfix/src/showq/Makefile.in | 2 +- postfix/src/smtp/Makefile.in | 2 +- postfix/src/smtpd/Makefile.in | 2 +- postfix/src/smtpstone/Makefile.in | 2 +- postfix/src/spawn/Makefile.in | 2 +- postfix/src/tls/Makefile.in | 2 +- postfix/src/tls/tls_scache.c | 86 ++++++++++++++----------- postfix/src/tls/tls_scache.h | 4 +- postfix/src/trivial-rewrite/Makefile.in | 2 +- postfix/src/util/Makefile.in | 2 +- postfix/src/verify/Makefile.in | 2 +- postfix/src/virtual/Makefile.in | 2 +- 50 files changed, 123 insertions(+), 85 deletions(-) diff --git a/postfix/HISTORY b/postfix/HISTORY index 72120d6b1..acd8a7703 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -10457,6 +10457,24 @@ Apologies for any names omitted. is treated as its own MX host; there is no meaningful equivalent for NS access control. File: smtpd/smtpd_check.c. +20050310 + + Bugfix: the AIX and SUN compilers rightfully complained + about non-portable code in the "new" LDAP/SQL client. File: + global/db_common.c. + + Workaround: some systems no longer recognize "tail +2" as + valid command syntax. Instead they require "improved" syntax + that is not valid on several other systems that Postfix + builds on. So we have to stop using the tail command. + Files: Makefile.in, src/*/Makefile.in. + +20050312 + + Bugfix: the TLS session cache cleaning code didn't always + delete the right entry. Problem found by Victor Duchovni, + more problems found by Wietse. File: tls/tls_scache.c. + Open problems: Med: disable header address rewriting after XCLIENT? diff --git a/postfix/Makefile.in b/postfix/Makefile.in index 22b3fa19d..fde9ca2a2 100644 --- a/postfix/Makefile.in +++ b/postfix/Makefile.in @@ -20,7 +20,7 @@ makefiles Makefiles: (set -e; echo "[$$i]"; cd $$i; rm -f Makefile; \ $(MAKE) -f Makefile.in Makefile MAKELEVEL=) || exit 1; \ done; - rm -f Makefile; (tail +2 conf/makedefs.out; cat Makefile.in) >Makefile + rm -f Makefile; (cat conf/makedefs.out Makefile.in) >Makefile update printfck tests: set -e; for i in $(DIRS); do \ diff --git a/postfix/README_FILES/INSTALL b/postfix/README_FILES/INSTALL index 94bea9196..202ed4d46 100644 --- a/postfix/README_FILES/INSTALL +++ b/postfix/README_FILES/INSTALL @@ -67,7 +67,7 @@ path. % export MANPATH; MANPATH="`pwd`/man:$MANPATH" % setenv MANPATH "`pwd`/man:$MANPATH" -Of particular interest is the postconf(5) manual page that lists all the 300+ +Of particular interest is the postconf(5) manual page that lists all the 400+ configuration parameters. The HTML version of this text makes it easy to navigate around. diff --git a/postfix/html/INSTALL.html b/postfix/html/INSTALL.html index 185fb37b6..8d82a147f 100644 --- a/postfix/html/INSTALL.html +++ b/postfix/html/INSTALL.html @@ -126,7 +126,7 @@ be sure to use an absolute path.

Of particular interest is the postconf(5) manual page that -lists all the 300+ configuration parameters. The HTML version of +lists all the 400+ configuration parameters. The HTML version of this text makes it easy to navigate around.

All Postfix source files have their own built-in manual page. diff --git a/postfix/proto/INSTALL.html b/postfix/proto/INSTALL.html index fe706d2cf..2c21927e2 100644 --- a/postfix/proto/INSTALL.html +++ b/postfix/proto/INSTALL.html @@ -126,7 +126,7 @@ be sure to use an absolute path.

Of particular interest is the postconf(5) manual page that -lists all the 300+ configuration parameters. The HTML version of +lists all the 400+ configuration parameters. The HTML version of this text makes it easy to navigate around.

All Postfix source files have their own built-in manual page. diff --git a/postfix/src/anvil/Makefile.in b/postfix/src/anvil/Makefile.in index 911e49ef3..5e4035fb1 100644 --- a/postfix/src/anvil/Makefile.in +++ b/postfix/src/anvil/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/bounce/Makefile.in b/postfix/src/bounce/Makefile.in index 64c4c4b5c..7c802a6da 100644 --- a/postfix/src/bounce/Makefile.in +++ b/postfix/src/bounce/Makefile.in @@ -20,7 +20,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/cleanup/Makefile.in b/postfix/src/cleanup/Makefile.in index d2d4025bb..233baab16 100644 --- a/postfix/src/cleanup/Makefile.in +++ b/postfix/src/cleanup/Makefile.in @@ -24,7 +24,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/discard/Makefile.in b/postfix/src/discard/Makefile.in index d59a3cf51..9f87480a1 100644 --- a/postfix/src/discard/Makefile.in +++ b/postfix/src/discard/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/dns/Makefile.in b/postfix/src/dns/Makefile.in index 4ce89ec94..d18adf450 100644 --- a/postfix/src/dns/Makefile.in +++ b/postfix/src/dns/Makefile.in @@ -19,7 +19,7 @@ INC_DIR = ../../include all: $(LIB) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/error/Makefile.in b/postfix/src/error/Makefile.in index 166f7084d..8bacb92b9 100644 --- a/postfix/src/error/Makefile.in +++ b/postfix/src/error/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/flush/Makefile.in b/postfix/src/flush/Makefile.in index 2092d48e5..21603b9e8 100644 --- a/postfix/src/flush/Makefile.in +++ b/postfix/src/flush/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/fsstone/Makefile.in b/postfix/src/fsstone/Makefile.in index a7f491a62..a04617a03 100644 --- a/postfix/src/fsstone/Makefile.in +++ b/postfix/src/fsstone/Makefile.in @@ -15,7 +15,7 @@ LIBS = ../../lib/libglobal.a ../../lib/libutil.a all: $(PROG) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ fsstone: fsstone.o $(LIBS) $(CC) $(CFLAGS) -o $@ fsstone.o $(LIBS) $(SYSLIBS) diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index 1ff165321..e15cbca8b 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -98,7 +98,7 @@ MAKES = all: $(LIB) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/global/db_common.c b/postfix/src/global/db_common.c index c694caa1a..1522711d9 100644 --- a/postfix/src/global/db_common.c +++ b/postfix/src/global/db_common.c @@ -300,8 +300,12 @@ int db_common_expand(void *ctxArg, const char *format, const char *value, if (VSTRING_LEN(result) > 0) VSTRING_ADDCH(result, ','); -#define QUOTE_VAL(d, q, v, buf) \ - (q ? q(d, v, buf) : vstring_strcat(buf, v)) +#define QUOTE_VAL(d, q, v, buf) do { \ + if (q) \ + q(d, v, buf); \ + else \ + vstring_strcat(buf, v); \ + } while (0) /* * Replace all instances of %s with the address to look up. Replace diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index a1766cde0..2c0bc7fb7 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only. */ -#define MAIL_RELEASE_DATE "20050309" +#define MAIL_RELEASE_DATE "20050313" #define MAIL_VERSION_NUMBER "2.3" #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/lmtp/Makefile.in b/postfix/src/lmtp/Makefile.in index 416ce71ed..24aad7250 100644 --- a/postfix/src/lmtp/Makefile.in +++ b/postfix/src/lmtp/Makefile.in @@ -20,7 +20,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/local/Makefile.in b/postfix/src/local/Makefile.in index 36feee0d1..fb439cde6 100644 --- a/postfix/src/local/Makefile.in +++ b/postfix/src/local/Makefile.in @@ -22,7 +22,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/master/Makefile.in b/postfix/src/master/Makefile.in index 1b4ba9145..d21f674c8 100644 --- a/postfix/src/master/Makefile.in +++ b/postfix/src/master/Makefile.in @@ -25,7 +25,7 @@ BIN_DIR = ../../libexec all: $(PROG) $(LIB) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) diff --git a/postfix/src/oqmgr/Makefile.in b/postfix/src/oqmgr/Makefile.in index 2a78eba16..509875b75 100644 --- a/postfix/src/oqmgr/Makefile.in +++ b/postfix/src/oqmgr/Makefile.in @@ -20,7 +20,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/pickup/Makefile.in b/postfix/src/pickup/Makefile.in index 57282f9ac..5e7436029 100644 --- a/postfix/src/pickup/Makefile.in +++ b/postfix/src/pickup/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/pipe/Makefile.in b/postfix/src/pipe/Makefile.in index affdcd9e5..6a676ed8f 100644 --- a/postfix/src/pipe/Makefile.in +++ b/postfix/src/pipe/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postalias/Makefile.in b/postfix/src/postalias/Makefile.in index 217e98e47..2e414ad78 100644 --- a/postfix/src/postalias/Makefile.in +++ b/postfix/src/postalias/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ update: ../../bin/$(PROG) diff --git a/postfix/src/postcat/Makefile.in b/postfix/src/postcat/Makefile.in index 2d9fd3464..4cce48332 100644 --- a/postfix/src/postcat/Makefile.in +++ b/postfix/src/postcat/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in index b7f93e86e..069f951b0 100644 --- a/postfix/src/postconf/Makefile.in +++ b/postfix/src/postconf/Makefile.in @@ -26,7 +26,7 @@ $(PROG): $(OBJS) $(LIBS) ./$(PROG) -d) |egrep -v '^(myhostname|mydomain|mynetworks) ' >$@ Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postdrop/Makefile.in b/postfix/src/postdrop/Makefile.in index 06f79c548..6ddcf835e 100644 --- a/postfix/src/postdrop/Makefile.in +++ b/postfix/src/postdrop/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postfix/Makefile.in b/postfix/src/postfix/Makefile.in index 31615b51b..dad1be2c3 100644 --- a/postfix/src/postfix/Makefile.in +++ b/postfix/src/postfix/Makefile.in @@ -17,7 +17,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postkick/Makefile.in b/postfix/src/postkick/Makefile.in index a5cc48b04..568edf654 100644 --- a/postfix/src/postkick/Makefile.in +++ b/postfix/src/postkick/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postlock/Makefile.in b/postfix/src/postlock/Makefile.in index 071fe26aa..48853df79 100644 --- a/postfix/src/postlock/Makefile.in +++ b/postfix/src/postlock/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postlog/Makefile.in b/postfix/src/postlog/Makefile.in index 586aa6109..64f32b5d4 100644 --- a/postfix/src/postlog/Makefile.in +++ b/postfix/src/postlog/Makefile.in @@ -17,7 +17,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postmap/Makefile.in b/postfix/src/postmap/Makefile.in index 3f0798af6..7761292e4 100644 --- a/postfix/src/postmap/Makefile.in +++ b/postfix/src/postmap/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ update: ../../bin/$(PROG) diff --git a/postfix/src/postqueue/Makefile.in b/postfix/src/postqueue/Makefile.in index 98ba568f7..f3a523b5e 100644 --- a/postfix/src/postqueue/Makefile.in +++ b/postfix/src/postqueue/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/postsuper/Makefile.in b/postfix/src/postsuper/Makefile.in index 1930af83d..df0dfa08a 100644 --- a/postfix/src/postsuper/Makefile.in +++ b/postfix/src/postsuper/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/proxymap/Makefile.in b/postfix/src/proxymap/Makefile.in index 96c3b65b0..deb28075c 100644 --- a/postfix/src/proxymap/Makefile.in +++ b/postfix/src/proxymap/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/qmgr/Makefile.in b/postfix/src/qmgr/Makefile.in index 0a7e2caad..91f19f176 100644 --- a/postfix/src/qmgr/Makefile.in +++ b/postfix/src/qmgr/Makefile.in @@ -22,7 +22,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/qmqpd/Makefile.in b/postfix/src/qmqpd/Makefile.in index e1b3250a2..b61043840 100644 --- a/postfix/src/qmqpd/Makefile.in +++ b/postfix/src/qmqpd/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/scache/Makefile.in b/postfix/src/scache/Makefile.in index 4d54015b4..9ce850494 100644 --- a/postfix/src/scache/Makefile.in +++ b/postfix/src/scache/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/sendmail/Makefile.in b/postfix/src/sendmail/Makefile.in index 751db318a..364e6a15a 100644 --- a/postfix/src/sendmail/Makefile.in +++ b/postfix/src/sendmail/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/showq/Makefile.in b/postfix/src/showq/Makefile.in index 66ed58fdc..285d77adc 100644 --- a/postfix/src/showq/Makefile.in +++ b/postfix/src/showq/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/smtp/Makefile.in b/postfix/src/smtp/Makefile.in index 79b8aeead..16cae7bd2 100644 --- a/postfix/src/smtp/Makefile.in +++ b/postfix/src/smtp/Makefile.in @@ -21,7 +21,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/smtpd/Makefile.in b/postfix/src/smtpd/Makefile.in index ea4aba913..88a8dbe9b 100644 --- a/postfix/src/smtpd/Makefile.in +++ b/postfix/src/smtpd/Makefile.in @@ -22,7 +22,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/smtpstone/Makefile.in b/postfix/src/smtpstone/Makefile.in index 7091a797a..e05b1bc02 100644 --- a/postfix/src/smtpstone/Makefile.in +++ b/postfix/src/smtpstone/Makefile.in @@ -15,7 +15,7 @@ LIBS = ../../lib/libglobal.a ../../lib/libutil.a all: $(PROG) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ smtp-sink: smtp-sink.o $(LIBS) $(CC) $(CFLAGS) -o $@ smtp-sink.o $(LIBS) $(SYSLIBS) diff --git a/postfix/src/spawn/Makefile.in b/postfix/src/spawn/Makefile.in index 06b0d8234..a755e3610 100644 --- a/postfix/src/spawn/Makefile.in +++ b/postfix/src/spawn/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/tls/Makefile.in b/postfix/src/tls/Makefile.in index 0ef0419d4..d524015fa 100644 --- a/postfix/src/tls/Makefile.in +++ b/postfix/src/tls/Makefile.in @@ -25,7 +25,7 @@ MAKES = all: $(LIB) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/tls/tls_scache.c b/postfix/src/tls/tls_scache.c index e3144e865..c00789cc3 100644 --- a/postfix/src/tls/tls_scache.c +++ b/postfix/src/tls/tls_scache.c @@ -74,12 +74,13 @@ /* tls_scache_update() updates the specified TLS session cache /* with the specified session information. /* -/* tls_scache_sequence() iterates over the specified TLS -/* session cache and either returns the first or next entry -/* that matches the session timeout, OpenSSL version and flags -/* restrictions, or returns no data. Entries that don't -/* satisfy the requirements -/* are silently deleted. Specify TLS_SCACHE_SEQUENCE_NOTHING +/* tls_scache_sequence() iterates over the specified TLS session +/* cache and looks up the first or next entry. If that entry +/* matches the session timeout, OpenSSL version and flags +/* restrictions, tls_scache_sequence() saves the entry by +/* updating the result parameters; otherwise it deletes the +/* entry and does not update the result parameters. Specify +/* TLS_SCACHE_SEQUENCE_NOTHING /* as the third and last argument to disable OpenSSL version /* and flags restrictions, and to disable saving of cache /* entry content or cache entry ID information. This is useful @@ -450,7 +451,9 @@ int tls_scache_sequence(TLS_SCACHE *cp, int first_next, const char *member; const char *value; char *saved_cursor; - int seq_status; + int found_entry; + int keep_entry; + char *saved_member; /* * XXX Deleting entries while enumerating a map can he tricky. Some map @@ -464,52 +467,63 @@ int tls_scache_sequence(TLS_SCACHE *cp, int first_next, */ /* - * Find the first or next database entry. + * Find the first or next database entry. Activate the passivated entry + * and check the version, time stamp and flags information. Schedule the + * entry for deletion if it is bad or too old. + * + * Save the member (cache id) so that it will not be clobbered by the + * tls_scache_lookup() call below. */ - seq_status = dict_seq(cp->db, first_next, &member, &value); + found_entry = (dict_seq(cp->db, first_next, &member, &value) == 0); + if (found_entry) { + keep_entry = tls_scache_decode(cp, member, value, strlen(value), + openssl_version, flags, + out_openssl_version, + out_flags, out_session); + if (keep_entry && out_cache_id) + *out_cache_id = mystrdup(member); + saved_member = mystrdup(member); + } /* * Delete behind. This is a no-op if an expired cache entry was updated - * in the mean time. + * in the mean time. Use the saved lookup criteria so that the "delete + * behind" operation works as promised. */ - if (cp->flags & TLS_SCACHE_FLAG_DEL_CURSOR) { - cp->flags &= ~TLS_SCACHE_FLAG_DEL_CURSOR; + if (cp->flags & TLS_SCACHE_FLAG_DEL_SAVED_CURSOR) { + cp->flags &= ~TLS_SCACHE_FLAG_DEL_SAVED_CURSOR; saved_cursor = cp->saved_cursor; cp->saved_cursor = 0; - tls_scache_lookup(cp, saved_cursor, TLS_SCACHE_ANY_OPENSSL_VSN, - TLS_SCACHE_ANY_FLAGS, (long *) 0, (int *) 0, + tls_scache_lookup(cp, saved_cursor, cp->saved_openssl_version, + cp->saved_flags, (long *) 0, (int *) 0, (VSTRING *) 0); myfree(saved_cursor); - } else { + } + + /* + * Otherwise, clean up if this is not the first iteration. + */ + else { if (cp->saved_cursor) myfree(cp->saved_cursor); cp->saved_cursor = 0; } /* - * Did we find a first or next database entry? + * Protect the current first/next entry against explicit or implied + * client delete requests, and schedule a bad or expired entry for + * deletion. Save the lookup criteria so that the "delete behind" + * operation will work as promised. */ - if (seq_status != 0) - return (0); /* End of list reached */ - - /* - * Safety against client requests to delete the current first/next entry. - */ - cp->saved_cursor = mystrdup(member); - - /* - * Activate the passivated cache entry and check the version and time - * stamp information. Schedule it for deletion if it is bad or too old. - */ - if (tls_scache_decode(cp, member, value, strlen(value), openssl_version, - flags, out_openssl_version, out_flags, - out_session) == 0) { - cp->flags |= TLS_SCACHE_FLAG_DEL_CURSOR; - } else { - if (out_cache_id) - *out_cache_id = mystrdup(member); + if (found_entry) { + cp->saved_cursor = saved_member; + if (keep_entry == 0) { + cp->flags |= TLS_SCACHE_FLAG_DEL_SAVED_CURSOR; + cp->saved_openssl_version = openssl_version; + cp->saved_flags = flags; + } } - return (1); + return (found_entry); } /* tls_scache_delete - delete session from cache */ diff --git a/postfix/src/tls/tls_scache.h b/postfix/src/tls/tls_scache.h index 2c828e9cc..2e51d2803 100644 --- a/postfix/src/tls/tls_scache.h +++ b/postfix/src/tls/tls_scache.h @@ -27,9 +27,11 @@ typedef struct { int log_level; /* smtp(d)_tls_log_level */ int timeout; /* smtp(d)_tls_session_cache_timeout */ char *saved_cursor; /* cursor cache ID */ + long saved_openssl_version; /* cursor OpenSSL version */ + int saved_flags; /* cursor lookup flags */ } TLS_SCACHE; -#define TLS_SCACHE_FLAG_DEL_CURSOR (1<<0) +#define TLS_SCACHE_FLAG_DEL_SAVED_CURSOR (1<<0) extern TLS_SCACHE *tls_scache_open(const char *, const char *, int, int); extern void tls_scache_close(TLS_SCACHE *); diff --git a/postfix/src/trivial-rewrite/Makefile.in b/postfix/src/trivial-rewrite/Makefile.in index b2dc22a75..dfe21f6e2 100644 --- a/postfix/src/trivial-rewrite/Makefile.in +++ b/postfix/src/trivial-rewrite/Makefile.in @@ -21,7 +21,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index f27c6d2f8..ea4c68980 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -110,7 +110,7 @@ INC_DIR = ../../include all: $(LIB) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/verify/Makefile.in b/postfix/src/verify/Makefile.in index 25e8859ab..39215f543 100644 --- a/postfix/src/verify/Makefile.in +++ b/postfix/src/verify/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG) diff --git a/postfix/src/virtual/Makefile.in b/postfix/src/virtual/Makefile.in index 60c562e72..d0e7bca7d 100644 --- a/postfix/src/virtual/Makefile.in +++ b/postfix/src/virtual/Makefile.in @@ -16,7 +16,7 @@ $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) Makefile: Makefile.in - (echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@ + (cat ../../conf/makedefs.out $?) >$@ test: $(TESTPROG)