From: Wietse Venema Date: Tue, 24 Jan 2012 05:00:00 +0000 (-0500) Subject: postfix-2.9.0-RC2 X-Git-Tag: v2.9.0-RC2^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0460a1c9640b9b42c78fbdfc2263dbf11ab59e;p=thirdparty%2Fpostfix.git postfix-2.9.0-RC2 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index daf7b4575..8d0758c5b 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -17545,7 +17545,7 @@ Apologies for any names omitted. table is unavailable. Files: global/mail_error.[hc], smtpd/smtpd_check.c, smtp/smtp_trouble.c. -20111215 +20120115 Fine tuning: SMTP server error messages. File: smtpd/smtpd.c. @@ -17558,7 +17558,7 @@ Apologies for any names omitted. Cleanup: tiny memory leaks after surrogate database opens. Files: util/dict_cidr.c, util/dict_db.c. -20111217 +20120117 Cleanup: support for legacy-style database configuration where parameter names are generated by appending suffixes @@ -17567,3 +17567,25 @@ Apologies for any names omitted. Other: build without Berkeley DB support (make makefiles "CCARGS=$CCARGS -DNO_DB"). Files: makedefs, util/sys_defs.h, proto/DB_README.html, proto/INSTALL.html. + +20120120 + + Compatibility: added file pflogsumm_quickfix.txt with quick + patches for pflogsumm that handle the new default master.cf + entries for the submission and smtps services. + +20120121 + + Cleanup: getopt(3) compatibility in the postconf(1) master.cf + parser. Process "--" as the end-of-options indicator, and + process "-oname=value" as "-o name=value". Files: + util/argv.[hc], postconf/postconf_master.cf, + postconf/postconf_user.c. + +20120122 + + Workaround: log a warning and suggested solution for common + stat()/fstat()/lstat() problems caused by 32-bit overflow. + This is a real stinker that causes Postfix to fail without + any prior warning. File: util/warn_stat.[hc], and everything + that directly calls stat(), fstat() or lstat(). diff --git a/postfix/Makefile.in b/postfix/Makefile.in index 8a45ddd6f..e45ba73a0 100644 --- a/postfix/Makefile.in +++ b/postfix/Makefile.in @@ -35,25 +35,25 @@ update printfck tests root_tests: update: $(LIBEXEC) libexec/post-install: conf/post-install - rm -f $@ && ln -sf ../$? $@ + rm -f $@ && ln -f $? $@ libexec/postfix-files: conf/postfix-files - rm -f $@ && ln -sf ../$? $@ + rm -f $@ && ln -f $? $@ libexec/postfix-script: conf/postfix-script - rm -f $@ && ln -sf ../$? $@ + rm -f $@ && ln -f $? $@ libexec/postfix-wrapper: conf/postfix-wrapper - rm -f $@ && ln -sf ../$? $@ + rm -f $@ && ln -f $? $@ libexec/main.cf: conf/main.cf - rm -f $@ && ln -sf ../$? $@ + rm -f $@ && ln -f $? $@ libexec/master.cf: conf/master.cf - rm -f $@ && ln -sf ../$? $@ + rm -f $@ && ln -f $? $@ libexec/postmulti-script: conf/postmulti-script - rm -f $@ && ln -sf ../$? $@ + rm -f $@ && ln -f $? $@ manpages: set -e; for i in $(MANDIRS); do \ diff --git a/postfix/README_FILES/DATABASE_README b/postfix/README_FILES/DATABASE_README index 231e426c8..18e898250 100644 --- a/postfix/README_FILES/DATABASE_README +++ b/postfix/README_FILES/DATABASE_README @@ -198,7 +198,7 @@ To find out what database types your Postfix system supports, use the "ppooss eennvviirroonn The UNIX process environment array. The lookup key is the variable name. The lookup table name in "environ:table" is ignored. - ffaaiill (read-write) + ffaaiill A table that reliably fails all requests. The lookup table name is used for logging only. This table exists to simplify Postfix error tests. hhaasshh @@ -213,7 +213,7 @@ To find out what database types your Postfix system supports, use the "ppooss llddaapp (read-only) Perform lookups using the LDAP protocol. Configuration details are given in the ldap_table(5). - mmeemmccaacchhee (read-write) + mmeemmccaacchhee Perform memcache database lookups or updates. Configuration details are given in memcache_table(5). mmyyssqqll (read-only) @@ -233,7 +233,7 @@ To find out what database types your Postfix system supports, use the "ppooss ppggssqqll (read-only) Perform PostgreSQL database lookups. Configuration details are given in pgsql_table(5). - pprrooxxyy (read-only) + pprrooxxyy Access information via the Postfix proxymap(8) service. The lookup table name syntax is "proxy:type:table". rreeggeexxpp (read-only) diff --git a/postfix/README_FILES/MEMCACHE_README b/postfix/README_FILES/MEMCACHE_README index c668b177c..f89e148d4 100644 --- a/postfix/README_FILES/MEMCACHE_README +++ b/postfix/README_FILES/MEMCACHE_README @@ -44,7 +44,7 @@ CCrreeddiittss The first memcache client for Postfix was written by Omar Kilani, and was based on the libmemcache library. -Wietse wrote the current memcache client from the ground up. This -implementation does not use libmemcache, and bears no resemblance to earlier -work. +Wietse wrote the current memcache client from the ground up for Postfix version +2.9. This implementation does not use libmemcache, and bears no resemblance to +earlier work. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index eeb69a7f8..e30a34d6f 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -329,6 +329,17 @@ unavailable. Major changes - logging ---------------------------------------- +[Incompat 20120114] Logfile-based alerting systems may need to be +updated to look for "error" messages in addition to "fatal" messages. +Specify "daemon_table_open_error_is_fatal = yes" to get the historical +behavior (immediate termination with "fatal" message). + +[Incompat 20111214] Logfile-based analysis tools may need to be +updated. The submission and smtps examples in the sample master.cf +file were updated to make their logging easier to distinguish. + +See the source file pflogsumm_quickfix.txt for a "quick fix". + [Incompat 20111205] Postfix now logs the result of successful TLS negotiation with TLS logging levels of 0. See the smtp_tls_loglevel and smtpd_tls_loglevel descriptions in the postconf(5) manpage for diff --git a/postfix/html/DATABASE_README.html b/postfix/html/DATABASE_README.html index 9ce2676b5..20cd53acf 100644 --- a/postfix/html/DATABASE_README.html +++ b/postfix/html/DATABASE_README.html @@ -292,7 +292,7 @@ the ".dir" or ".pag" suffix. variable name. The lookup table name in "environ:table" is ignored. -
fail (read-write)
+
fail
A table that reliably fails all requests. The lookup table name is used for logging only. This table exists to simplify Postfix @@ -316,7 +316,7 @@ a process terminates.
Perform lookups using the LDAP protocol. Configuration details are given in the ldap_table(5).
-
memcache (read-write)
+
memcache
Perform memcache database lookups or updates. Configuration details are given in memcache_table(5).
@@ -351,7 +351,7 @@ file.
Perform PostgreSQL database lookups. Configuration details are given in pgsql_table(5).
-
proxy (read-only)
+
proxy
Access information via the Postfix proxymap(8) service. The lookup table name syntax is "proxy:type:table".
diff --git a/postfix/html/MEMCACHE_README.html b/postfix/html/MEMCACHE_README.html index 78be1733a..59b62152e 100644 --- a/postfix/html/MEMCACHE_README.html +++ b/postfix/html/MEMCACHE_README.html @@ -67,9 +67,9 @@ and is therefore built into Postfix by default.

The first memcache client for Postfix was written by Omar Kilani, and was based on the libmemcache library.

-

Wietse wrote the current memcache client from the ground up. -This implementation does not use libmemcache, and bears no resemblance -to earlier work.

+

Wietse wrote the current memcache client from the ground up for +Postfix version 2.9. This implementation does not use libmemcache, +and bears no resemblance to earlier work.

diff --git a/postfix/html/memcache_table.5.html b/postfix/html/memcache_table.5.html index c46a4d46c..01da77ed3 100644 --- a/postfix/html/memcache_table.5.html +++ b/postfix/html/memcache_table.5.html @@ -222,10 +222,7 @@ MEMCACHE_TABLE(5) MEMCACHE_TABLE(5) software. HISTORY - The first memcache client for Postfix was written by Omar - Kilani, and was based on libmemcache. The Postfix imple- - mentation does not use libmemcache, and bears no resem- - blance to earlier work. + Memcache support was introduced with Postfix version 2.9. AUTHOR(S) Wietse Venema diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html index 350cb86a8..a07120b6e 100644 --- a/postfix/html/postconf.1.html +++ b/postfix/html/postconf.1.html @@ -198,7 +198,7 @@ POSTCONF(1) POSTCONF(1) Perform lookups using the LDAP protocol. This is described in ldap_table(5). - memcache (read-write) + memcache Perform lookups using the memcache protocol. This is described in memcache_table(5). @@ -215,8 +215,7 @@ POSTCONF(1) POSTCONF(1) Perform lookups using the PostgreSQL proto- col. This is described in pgsql_table(5). - proxy (read-only) - A lookup table that is implemented via the + proxy A lookup table that is implemented via the Postfix proxymap(8) service. The table name syntax is type:name. diff --git a/postfix/html/postkick.1.html b/postfix/html/postkick.1.html index 42e579581..dd673b0e5 100644 --- a/postfix/html/postkick.1.html +++ b/postfix/html/postkick.1.html @@ -66,8 +66,8 @@ POSTKICK(1) POSTKICK(1) application_event_drain_time (100s) How long the postkick(1) command waits for a - request to enter the server's input buffer before - giving up. + request to enter the Postfix daemon process input + buffer before giving up. queue_directory (see 'postconf -d' output) The location of the Postfix top-level queue direc- diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1 index fefde2869..9717c9cf2 100644 --- a/postfix/man/man1/postconf.1 +++ b/postfix/man/man1/postconf.1 @@ -185,7 +185,7 @@ when a process terminates. .IP "\fBldap\fR (read-only)" Perform lookups using the LDAP protocol. This is described in \fBldap_table\fR(5). -.IP "\fBmemcache\fR (read-write)" +.IP "\fBmemcache\fR" Perform lookups using the memcache protocol. This is described in \fBmemcache_table\fR(5). .IP "\fBmysql\fR (read-only)" @@ -197,7 +197,7 @@ file format is described in \fBpcre_table\fR(5). .IP "\fBpgsql\fR (read-only)" Perform lookups using the PostgreSQL protocol. This is described in \fBpgsql_table\fR(5). -.IP "\fBproxy\fR (read-only)" +.IP "\fBproxy\fR" A lookup table that is implemented via the Postfix \fBproxymap\fR(8) service. The table name syntax is \fItype\fB:\fIname\fR. diff --git a/postfix/man/man1/postkick.1 b/postfix/man/man1/postkick.1 index c85314fe7..64bdda7a3 100644 --- a/postfix/man/man1/postkick.1 +++ b/postfix/man/man1/postkick.1 @@ -64,7 +64,7 @@ The default location of the Postfix main.cf and master.cf configuration files. .IP "\fBapplication_event_drain_time (100s)\fR" How long the \fBpostkick\fR(1) command waits for a request to enter the -server's input buffer before giving up. +Postfix daemon process input buffer before giving up. .IP "\fBqueue_directory (see 'postconf -d' output)\fR" The location of the Postfix top-level queue directory. .SH "FILES" diff --git a/postfix/man/man5/memcache_table.5 b/postfix/man/man5/memcache_table.5 index 2de5980e4..1c33b09fe 100644 --- a/postfix/man/man5/memcache_table.5 +++ b/postfix/man/man5/memcache_table.5 @@ -235,10 +235,7 @@ The Secure Mailer license must be distributed with this software. .nf .ad .fi -The first memcache client for Postfix was written by Omar -Kilani, and was based on libmemcache. -The Postfix implementation does not use libmemcache, and -bears no resemblance to earlier work. +Memcache support was introduced with Postfix version 2.9. .SH "AUTHOR(S)" .na .nf diff --git a/postfix/pflogsumm_quickfix.txt b/postfix/pflogsumm_quickfix.txt new file mode 100644 index 000000000..85a871953 --- /dev/null +++ b/postfix/pflogsumm_quickfix.txt @@ -0,0 +1,53 @@ +These diffs for pflogsumm versions 1.1.1 and 1.1.3 work around a +change in the Postfix 2.9 default master.cf file. + +That change made the logging from submission and smtps services easier +to distinguish, by changing postfix/smtpd into postfix/submission/smtpd +and postfix/smtps/smtpd, respectively. + +Below are diffs for pflogsumm-1.1.1 and pflogsumm-1.1.3 (beta). +Choose one that fits your pflogsumm version. + +====begin diff===================== +*** ./pflogsumm-1.1.1/pflogsumm.pl- Fri Apr 6 10:06:37 2007 +--- ./pflogsumm-1.1.1/pflogsumm.pl Fri Jan 20 17:05:10 2012 +*************** +*** 542,548 **** + my $logRmdr; + next unless((($msgMonStr, $msgDay, $msgHr, $msgMin, $msgSec, $logRmdr) = + /^(...) +(\d+) (..):(..):(..) \S+ (.+)$/o) == 6); +! unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || + (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) + { + #print UNPROCD "$_"; +--- 542,548 ---- + my $logRmdr; + next unless((($msgMonStr, $msgDay, $msgHr, $msgMin, $msgSec, $logRmdr) = + /^(...) +(\d+) (..):(..):(..) \S+ (.+)$/o) == 6); +! unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)(?:/(?:smtps|submission))?/([^\[:]*).*?: ([^:\s]+)#o) == 2 || + (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) + { + #print UNPROCD "$_"; +====end diff===================== + +====begin diff===================== +*** ./pflogsumm-1.1.3/pflogsumm.pl- Sat Mar 20 16:00:42 2010 +--- ./pflogsumm-1.1.3/pflogsumm.pl Fri Jan 20 17:02:37 2012 +*************** +*** 636,642 **** + --$msgMon; + } + +! unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)/([^\[:]*).*?: ([^:\s]+)#o) == 2 || + (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) + { + #print UNPROCD "$_"; +--- 636,642 ---- + --$msgMon; + } + +! unless((($cmd, $qid) = $logRmdr =~ m#^(?:postfix|$syslogName)(?:/(?:smtps|submission))?/([^\[:]*).*?: ([^:\s]+)#o) == 2 || + (($cmd, $qid) = $logRmdr =~ m#^((?:postfix)(?:-script)?)(?:\[\d+\])?: ([^:\s]+)#o) == 2) + { + #print UNPROCD "$_"; +====end diff===================== diff --git a/postfix/proto/DATABASE_README.html b/postfix/proto/DATABASE_README.html index 284f02786..8cbaa7562 100644 --- a/postfix/proto/DATABASE_README.html +++ b/postfix/proto/DATABASE_README.html @@ -292,7 +292,7 @@ the ".dir" or ".pag" suffix. variable name. The lookup table name in "environ:table" is ignored. -
fail (read-write)
+
fail
A table that reliably fails all requests. The lookup table name is used for logging only. This table exists to simplify Postfix @@ -316,7 +316,7 @@ a process terminates.
Perform lookups using the LDAP protocol. Configuration details are given in the ldap_table(5).
-
memcache (read-write)
+
memcache
Perform memcache database lookups or updates. Configuration details are given in memcache_table(5).
@@ -351,7 +351,7 @@ file.
Perform PostgreSQL database lookups. Configuration details are given in pgsql_table(5).
-
proxy (read-only)
+
proxy
Access information via the Postfix proxymap(8) service. The lookup table name syntax is "proxy:type:table".
diff --git a/postfix/proto/MEMCACHE_README.html b/postfix/proto/MEMCACHE_README.html index ad445892f..a48f9a825 100644 --- a/postfix/proto/MEMCACHE_README.html +++ b/postfix/proto/MEMCACHE_README.html @@ -67,9 +67,9 @@ and is therefore built into Postfix by default.

The first memcache client for Postfix was written by Omar Kilani, and was based on the libmemcache library.

-

Wietse wrote the current memcache client from the ground up. -This implementation does not use libmemcache, and bears no resemblance -to earlier work.

+

Wietse wrote the current memcache client from the ground up for +Postfix version 2.9. This implementation does not use libmemcache, +and bears no resemblance to earlier work.

diff --git a/postfix/proto/memcache_table b/postfix/proto/memcache_table index f64839fc1..3dc4678b7 100644 --- a/postfix/proto/memcache_table +++ b/postfix/proto/memcache_table @@ -213,10 +213,7 @@ # HISTORY # .ad # .fi -# The first memcache client for Postfix was written by Omar -# Kilani, and was based on libmemcache. -# The Postfix implementation does not use libmemcache, and -# bears no resemblance to earlier work. +# Memcache support was introduced with Postfix version 2.9. # AUTHOR(S) # Wietse Venema # IBM T.J. Watson Research diff --git a/postfix/src/cleanup/Makefile.in b/postfix/src/cleanup/Makefile.in index c447f198b..8afd16209 100644 --- a/postfix/src/cleanup/Makefile.in +++ b/postfix/src/cleanup/Makefile.in @@ -1098,6 +1098,7 @@ cleanup_region.o: ../../include/tok822.h cleanup_region.o: ../../include/vbuf.h cleanup_region.o: ../../include/vstream.h cleanup_region.o: ../../include/vstring.h +cleanup_region.o: ../../include/warn_stat.h cleanup_region.o: cleanup.h cleanup_region.o: cleanup_region.c cleanup_rewrite.o: ../../include/argv.h diff --git a/postfix/src/cleanup/cleanup_region.c b/postfix/src/cleanup/cleanup_region.c index 78479d47b..dee28a065 100644 --- a/postfix/src/cleanup/cleanup_region.c +++ b/postfix/src/cleanup/cleanup_region.c @@ -83,6 +83,7 @@ #include #include +#include /* Application-specific. */ diff --git a/postfix/src/dns/dns_rr_eq_sa.ref b/postfix/src/dns/dns_rr_eq_sa.ref index e633274a3..d85216492 100644 --- a/postfix/src/dns/dns_rr_eq_sa.ref +++ b/postfix/src/dns/dns_rr_eq_sa.ref @@ -1,24 +1,24 @@ -2604:8d00:189::2 =?= 168.100.189.2 -tested by function: no -tested by macro: no 168.100.189.2 =?= 168.100.189.2 tested by function: yes tested by macro: yes -2604:8d00:189::2 =?= 168.100.189.3 +2604:8d00:189::2 =?= 168.100.189.2 tested by function: no tested by macro: no 168.100.189.2 =?= 168.100.189.3 tested by function: no tested by macro: no -2604:8d00:189::2 =?= 2001:240:587:0:2d0:b7ff:fe88:2ca7 +2604:8d00:189::2 =?= 168.100.189.3 tested by function: no tested by macro: no 168.100.189.2 =?= 2001:240:587:0:2d0:b7ff:fe88:2ca7 tested by function: no tested by macro: no -2604:8d00:189::2 =?= 2001:240:587:0:2d0:b7ff:febe:ca9f +2604:8d00:189::2 =?= 2001:240:587:0:2d0:b7ff:fe88:2ca7 tested by function: no tested by macro: no 168.100.189.2 =?= 2001:240:587:0:2d0:b7ff:febe:ca9f tested by function: no tested by macro: no +2604:8d00:189::2 =?= 2001:240:587:0:2d0:b7ff:febe:ca9f +tested by function: no +tested by macro: no diff --git a/postfix/src/dns/dns_sa_to_rr.ref b/postfix/src/dns/dns_sa_to_rr.ref index 0b67b74e2..86c022d56 100644 --- a/postfix/src/dns/dns_sa_to_rr.ref +++ b/postfix/src/dns/dns_sa_to_rr.ref @@ -1,2 +1,2 @@ -spike.porcupine.org -> 2604:8d00:189::2 spike.porcupine.org -> 168.100.189.2 +spike.porcupine.org -> 2604:8d00:189::2 diff --git a/postfix/src/flush/Makefile.in b/postfix/src/flush/Makefile.in index ea0b6df79..b3533bd50 100644 --- a/postfix/src/flush/Makefile.in +++ b/postfix/src/flush/Makefile.in @@ -86,4 +86,5 @@ flush.o: ../../include/vbuf.h flush.o: ../../include/vstream.h flush.o: ../../include/vstring.h flush.o: ../../include/vstring_vstream.h +flush.o: ../../include/warn_stat.h flush.o: flush.c diff --git a/postfix/src/flush/flush.c b/postfix/src/flush/flush.c index 22c1a8365..2a9a7d565 100644 --- a/postfix/src/flush/flush.c +++ b/postfix/src/flush/flush.c @@ -170,6 +170,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/global/Makefile.in b/postfix/src/global/Makefile.in index a1644a32a..d8fb3dbd5 100644 --- a/postfix/src/global/Makefile.in +++ b/postfix/src/global/Makefile.in @@ -746,6 +746,7 @@ data_redirect.o: ../../include/sys_defs.h data_redirect.o: ../../include/vbuf.h data_redirect.o: ../../include/vstream.h data_redirect.o: ../../include/vstring.h +data_redirect.o: ../../include/warn_stat.h data_redirect.o: data_redirect.c data_redirect.o: data_redirect.h data_redirect.o: dict_proxy.h @@ -914,10 +915,44 @@ 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/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/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 @@ -960,6 +995,7 @@ dot_lockfile.o: ../../include/stringops.h dot_lockfile.o: ../../include/sys_defs.h dot_lockfile.o: ../../include/vbuf.h dot_lockfile.o: ../../include/vstring.h +dot_lockfile.o: ../../include/warn_stat.h dot_lockfile.o: dot_lockfile.c dot_lockfile.o: dot_lockfile.h dot_lockfile.o: mail_params.h @@ -1038,6 +1074,7 @@ file_id.o: ../../include/sys_defs.h file_id.o: ../../include/vbuf.h file_id.o: ../../include/vstream.h file_id.o: ../../include/vstring.h +file_id.o: ../../include/warn_stat.h file_id.o: file_id.c file_id.o: file_id.h file_id.o: mail_queue.h @@ -1301,6 +1338,7 @@ mail_copy.o: ../../include/vbuf.h mail_copy.o: ../../include/vstream.h mail_copy.o: ../../include/vstring.h mail_copy.o: ../../include/vstring_vstream.h +mail_copy.o: ../../include/warn_stat.h mail_copy.o: dsn.h mail_copy.o: dsn_buf.h mail_copy.o: mail_addr.h @@ -1356,6 +1394,7 @@ mail_open_ok.o: ../../include/sys_defs.h mail_open_ok.o: ../../include/vbuf.h mail_open_ok.o: ../../include/vstream.h mail_open_ok.o: ../../include/vstring.h +mail_open_ok.o: ../../include/warn_stat.h mail_open_ok.o: mail_open_ok.c mail_open_ok.o: mail_open_ok.h mail_open_ok.o: mail_queue.h @@ -1439,6 +1478,7 @@ mail_stream.o: ../../include/sys_defs.h mail_stream.o: ../../include/vbuf.h mail_stream.o: ../../include/vstream.h mail_stream.o: ../../include/vstring.h +mail_stream.o: ../../include/warn_stat.h mail_stream.o: cleanup_user.h mail_stream.o: mail_params.h mail_stream.o: mail_proto.h @@ -1462,6 +1502,7 @@ mail_trigger.o: ../../include/sys_defs.h mail_trigger.o: ../../include/trigger.h mail_trigger.o: ../../include/vbuf.h mail_trigger.o: ../../include/vstream.h +mail_trigger.o: ../../include/warn_stat.h mail_trigger.o: mail_params.h mail_trigger.o: mail_proto.h mail_trigger.o: mail_trigger.c @@ -1536,6 +1577,7 @@ mbox_open.o: ../../include/sys_defs.h mbox_open.o: ../../include/vbuf.h mbox_open.o: ../../include/vstream.h mbox_open.o: ../../include/vstring.h +mbox_open.o: ../../include/warn_stat.h mbox_open.o: deliver_flock.h mbox_open.o: dot_lockfile.h mbox_open.o: dsn.h @@ -1585,6 +1627,7 @@ mkmap_db.o: ../../include/sys_defs.h mkmap_db.o: ../../include/vbuf.h mkmap_db.o: ../../include/vstream.h mkmap_db.o: ../../include/vstring.h +mkmap_db.o: ../../include/warn_stat.h mkmap_db.o: mail_params.h mkmap_db.o: mkmap.h mkmap_db.o: mkmap_db.c @@ -1852,6 +1895,7 @@ record.o: record.h remove.o: ../../include/sys_defs.h remove.o: ../../include/vbuf.h remove.o: ../../include/vstring.h +remove.o: ../../include/warn_stat.h remove.o: mail_params.h remove.o: remove.c resolve_clnt.o: ../../include/attr.h diff --git a/postfix/src/global/data_redirect.c b/postfix/src/global/data_redirect.c index 77a28e209..096e58c14 100644 --- a/postfix/src/global/data_redirect.c +++ b/postfix/src/global/data_redirect.c @@ -72,6 +72,7 @@ #include #include #include +#include /* Global directory. */ diff --git a/postfix/src/global/dot_lockfile.c b/postfix/src/global/dot_lockfile.c index 94681bf00..89a977af9 100644 --- a/postfix/src/global/dot_lockfile.c +++ b/postfix/src/global/dot_lockfile.c @@ -64,6 +64,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/global/file_id.c b/postfix/src/global/file_id.c index c482017ae..b373056fe 100644 --- a/postfix/src/global/file_id.c +++ b/postfix/src/global/file_id.c @@ -60,6 +60,7 @@ #include #include +#include /* Global library. */ diff --git a/postfix/src/global/mail_copy.c b/postfix/src/global/mail_copy.c index b8157e71b..7b841df84 100644 --- a/postfix/src/global/mail_copy.c +++ b/postfix/src/global/mail_copy.c @@ -107,6 +107,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/global/mail_open_ok.c b/postfix/src/global/mail_open_ok.c index 31504c58d..a1bacad86 100644 --- a/postfix/src/global/mail_open_ok.c +++ b/postfix/src/global/mail_open_ok.c @@ -65,6 +65,7 @@ /* Utility library. */ #include +#include /* Global library. */ diff --git a/postfix/src/global/mail_stream.c b/postfix/src/global/mail_stream.c index 88602a30f..401262a58 100644 --- a/postfix/src/global/mail_stream.c +++ b/postfix/src/global/mail_stream.c @@ -126,6 +126,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/global/mail_trigger.c b/postfix/src/global/mail_trigger.c index 5f9ac580a..188f10bc4 100644 --- a/postfix/src/global/mail_trigger.c +++ b/postfix/src/global/mail_trigger.c @@ -58,6 +58,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 9427712c0..27382f561 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,8 +20,8 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20120118" -#define MAIL_VERSION_NUMBER "2.9-RC1" +#define MAIL_RELEASE_DATE "20120124" +#define MAIL_VERSION_NUMBER "2.9-RC2" #ifdef SNAPSHOT # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff --git a/postfix/src/global/mbox_open.c b/postfix/src/global/mbox_open.c index ea96d8a4b..7ccd08a5a 100644 --- a/postfix/src/global/mbox_open.c +++ b/postfix/src/global/mbox_open.c @@ -91,6 +91,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/global/mkmap_db.c b/postfix/src/global/mkmap_db.c index 704fa342a..3f69eca52 100644 --- a/postfix/src/global/mkmap_db.c +++ b/postfix/src/global/mkmap_db.c @@ -47,6 +47,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/global/namadr_list.in b/postfix/src/global/namadr_list.in index dfe6ed20c..4ee6121b6 100644 --- a/postfix/src/global/namadr_list.in +++ b/postfix/src/global/namadr_list.in @@ -17,15 +17,15 @@ ./namadr_list 168.100.189.2 dummy 168.100.189.3 ./namadr_list '[168.100.189.2]' dummy 168.100.189.2 ./namadr_list '[168.100.189.2]' dummy 168.100.189.3 -echo foo !bar baz >junk -./namadr_list !`pwd`/junk dummy 168.100.189.3 -./namadr_list !`pwd`/junk foo 168.100.189.3 -./namadr_list !`pwd`/junk bar 168.100.189.3 -./namadr_list !`pwd`/junk baz 168.100.189.3 -./namadr_list `pwd`/junk dummy 168.100.189.3 -./namadr_list `pwd`/junk foo 168.100.189.3 -./namadr_list `pwd`/junk bar 168.100.189.3 -./namadr_list `pwd`/junk baz 168.100.189.3 +echo foo !bar baz >junk; mv junk /tmp +./namadr_list !/tmp/junk dummy 168.100.189.3 +./namadr_list !/tmp/junk foo 168.100.189.3 +./namadr_list !/tmp/junk bar 168.100.189.3 +./namadr_list !/tmp/junk baz 168.100.189.3 +./namadr_list /tmp/junk dummy 168.100.189.3 +./namadr_list /tmp/junk foo 168.100.189.3 +./namadr_list /tmp/junk bar 168.100.189.3 +./namadr_list /tmp/junk baz 168.100.189.3 rm -f junk ./namadr_list 'be.be' x.x.x 127.0.0.1 ./namadr_list 'be/be' x.x.x 127.0.0.1 @@ -39,4 +39,4 @@ env foo=x ./namadr_list !!environ:junk foo 168.100.189.3 env foo=x ./namadr_list !!environ:junk bar 168.100.189.3 ./namadr_list fail:1 bar 168.100.189.3 ./namadr_list !fail:1 bar 168.100.189.3 -./namadr_list `pwd`/nosuchfile bar 168.100.189.3 +./namadr_list /tmp/nosuchfile bar 168.100.189.3 diff --git a/postfix/src/global/namadr_list.ref b/postfix/src/global/namadr_list.ref index 1aa895a6c..b21fe54ea 100644 --- a/postfix/src/global/namadr_list.ref +++ b/postfix/src/global/namadr_list.ref @@ -47,7 +47,7 @@ bar/168.100.189.3: NO bar/168.100.189.3: ERROR ./namadr_list: warning: fail:1: table lookup problem bar/168.100.189.3: ERROR -./namadr_list: error: open file /home/wietse/postfix-2.9-20120114/src/global/nosuchfile: No such file or directory -./namadr_list: warning: non-existent:/home/wietse/postfix-2.9-20120114/src/global/nosuchfile is unavailable. open file /home/wietse/postfix-2.9-20120114/src/global/nosuchfile: No such file or directory -./namadr_list: warning: non-existent:/home/wietse/postfix-2.9-20120114/src/global/nosuchfile: table lookup problem +./namadr_list: error: open file /tmp/nosuchfile: No such file or directory +./namadr_list: warning: non-existent:/tmp/nosuchfile is unavailable. open file /tmp/nosuchfile: No such file or directory +./namadr_list: warning: non-existent:/tmp/nosuchfile: table lookup problem bar/168.100.189.3: ERROR diff --git a/postfix/src/global/remove.c b/postfix/src/global/remove.c index 620e182c5..5f764b29c 100644 --- a/postfix/src/global/remove.c +++ b/postfix/src/global/remove.c @@ -37,6 +37,7 @@ #include #include #include +#include /* Utility library. */ diff --git a/postfix/src/local/Makefile.in b/postfix/src/local/Makefile.in index 42ce2dc50..92868a373 100644 --- a/postfix/src/local/Makefile.in +++ b/postfix/src/local/Makefile.in @@ -453,6 +453,7 @@ mailbox.o: ../../include/tok822.h mailbox.o: ../../include/vbuf.h mailbox.o: ../../include/vstream.h mailbox.o: ../../include/vstring.h +mailbox.o: ../../include/warn_stat.h mailbox.o: biff_notify.h mailbox.o: local.h mailbox.o: mailbox.c @@ -491,6 +492,7 @@ maildir.o: ../../include/tok822.h maildir.o: ../../include/vbuf.h maildir.o: ../../include/vstream.h maildir.o: ../../include/vstring.h +maildir.o: ../../include/warn_stat.h maildir.o: local.h maildir.o: maildir.c recipient.o: ../../include/argv.h diff --git a/postfix/src/local/mailbox.c b/postfix/src/local/mailbox.c index ca1077241..b46018e9e 100644 --- a/postfix/src/local/mailbox.c +++ b/postfix/src/local/mailbox.c @@ -61,6 +61,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/local/maildir.c b/postfix/src/local/maildir.c index a1ef4932a..46b86413b 100644 --- a/postfix/src/local/maildir.c +++ b/postfix/src/local/maildir.c @@ -57,6 +57,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/master/Makefile.in b/postfix/src/master/Makefile.in index 43f9db57e..f1a59f615 100644 --- a/postfix/src/master/Makefile.in +++ b/postfix/src/master/Makefile.in @@ -118,6 +118,7 @@ event_server.o: master_proto.h mail_flow.o: ../../include/iostuff.h mail_flow.o: ../../include/msg.h mail_flow.o: ../../include/sys_defs.h +mail_flow.o: ../../include/warn_stat.h mail_flow.o: mail_flow.c mail_flow.o: mail_flow.h mail_flow.o: master_proto.h diff --git a/postfix/src/master/mail_flow.c b/postfix/src/master/mail_flow.c index 15cab0d1a..295850085 100644 --- a/postfix/src/master/mail_flow.c +++ b/postfix/src/master/mail_flow.c @@ -53,6 +53,7 @@ #include #include +#include /* Global library. */ diff --git a/postfix/src/oqmgr/Makefile.in b/postfix/src/oqmgr/Makefile.in index 979c3caee..1be25c873 100644 --- a/postfix/src/oqmgr/Makefile.in +++ b/postfix/src/oqmgr/Makefile.in @@ -112,6 +112,7 @@ qmgr_active.o: ../../include/trace.h qmgr_active.o: ../../include/vbuf.h qmgr_active.o: ../../include/vstream.h qmgr_active.o: ../../include/vstring.h +qmgr_active.o: ../../include/warn_stat.h qmgr_active.o: qmgr.h qmgr_active.o: qmgr_active.c qmgr_bounce.o: ../../include/attr.h diff --git a/postfix/src/oqmgr/qmgr_active.c b/postfix/src/oqmgr/qmgr_active.c index eea9d71d0..d93a2cd10 100644 --- a/postfix/src/oqmgr/qmgr_active.c +++ b/postfix/src/oqmgr/qmgr_active.c @@ -93,6 +93,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postalias/Makefile.in b/postfix/src/postalias/Makefile.in index c6161b857..699c3d3fc 100644 --- a/postfix/src/postalias/Makefile.in +++ b/postfix/src/postalias/Makefile.in @@ -110,4 +110,5 @@ postalias.o: ../../include/vbuf.h postalias.o: ../../include/vstream.h postalias.o: ../../include/vstring.h postalias.o: ../../include/vstring_vstream.h +postalias.o: ../../include/warn_stat.h postalias.o: postalias.c diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index cc190b416..b11d8fa4b 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -233,6 +233,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postcat/Makefile.in b/postfix/src/postcat/Makefile.in index 1b08ad60b..1760824c6 100644 --- a/postfix/src/postcat/Makefile.in +++ b/postfix/src/postcat/Makefile.in @@ -116,4 +116,5 @@ postcat.o: ../../include/vbuf.h postcat.o: ../../include/vstream.h postcat.o: ../../include/vstring.h postcat.o: ../../include/vstring_vstream.h +postcat.o: ../../include/warn_stat.h postcat.o: postcat.c diff --git a/postfix/src/postcat/postcat.c b/postfix/src/postcat/postcat.c index 7c687bfe4..3d9b5158b 100644 --- a/postfix/src/postcat/postcat.c +++ b/postfix/src/postcat/postcat.c @@ -104,6 +104,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postconf/Makefile.in b/postfix/src/postconf/Makefile.in index e6a720abc..b757205db 100644 --- a/postfix/src/postconf/Makefile.in +++ b/postfix/src/postconf/Makefile.in @@ -42,7 +42,7 @@ test: $(TESTPROG) tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \ test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 \ - test22 test23 test24 test25 test26 test27 test28 test29 + test22 test23 test24 test25 test26 test27 test28 test29 test30 root_tests: @@ -398,6 +398,22 @@ test29: $(PROG) test29.ref diff test29.ref test29.tmp rm -f main.cf master.cf test29.tmp +test30: $(PROG) test30.ref + rm -f main.cf master.cf + touch main.cf master.cf + echo p1=xx >> main.cf + echo p2=xx >> main.cf + echo p3=xx >> main.cf + echo p4=xx >> main.cf + echo whatevershebrings unix - n n - 0 other >> master.cf + echo ' -o body_checks=$$p1' >> master.cf + echo ' -o bodyx_checks=$$p2' >> master.cf + echo ' -oheader_checks=$$p3' >> master.cf + echo ' -oheaderx_checks=$$p4' >> master.cf + ./$(PROG) -nc . >test30.tmp 2>&1 + diff test30.ref test30.tmp + rm -f main.cf master.cf test30.tmp + printfck: $(OBJS) $(PROG) rm -rf printfck mkdir printfck @@ -442,6 +458,7 @@ postconf.o: ../../include/sys_defs.h postconf.o: ../../include/vbuf.h postconf.o: ../../include/vstream.h postconf.o: ../../include/vstring.h +postconf.o: ../../include/warn_stat.h postconf.o: postconf.c postconf.o: postconf.h postconf_builtin.o: ../../include/argv.h diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 6672b694d..becede834 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -179,7 +179,7 @@ /* .IP "\fBldap\fR (read-only)" /* Perform lookups using the LDAP protocol. This is described /* in \fBldap_table\fR(5). -/* .IP "\fBmemcache\fR (read-write)" +/* .IP "\fBmemcache\fR" /* Perform lookups using the memcache protocol. This is described /* in \fBmemcache_table\fR(5). /* .IP "\fBmysql\fR (read-only)" @@ -191,7 +191,7 @@ /* .IP "\fBpgsql\fR (read-only)" /* Perform lookups using the PostgreSQL protocol. This is described /* in \fBpgsql_table\fR(5). -/* .IP "\fBproxy\fR (read-only)" +/* .IP "\fBproxy\fR" /* A lookup table that is implemented via the Postfix /* \fBproxymap\fR(8) service. The table name syntax is /* \fItype\fB:\fIname\fR. @@ -340,6 +340,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postconf/postconf_master.c b/postfix/src/postconf/postconf_master.c index ab20cc659..0aa6c3a92 100644 --- a/postfix/src/postconf/postconf_master.c +++ b/postfix/src/postconf/postconf_master.c @@ -68,6 +68,35 @@ #define STR(x) vstring_str(x) +/* normalize_options - bring options into canonical form */ + +static void normalize_options(ARGV *argv) +{ + int field; + char *arg; + + /* + * Normalize options to simplify later processing. + */ + for (field = PC_MASTER_MIN_FIELDS; argv->argv[field] != 0; field++) { + arg = argv->argv[field]; + if (arg[0] != '-' || strcmp(arg, "--") == 0) + break; + if (strncmp(arg, "-o", 2) == 0) { + if (arg[2] != 0) { + /* Split "-oname=value" into "-o" "name=value". */ + argv_insert_one(argv, field + 1, arg + 2); + argv_replace_one(argv, field, "-o"); + /* arg is now a dangling pointer. */ + field += 1; + } else if (argv->argv[field + 1] != 0) { + /* Already in "-o" "name=value" form. */ + field += 1; + } + } + } +} + /* read_master - read and digest the master.cf file */ void read_master(int fail_on_open_error) @@ -126,6 +155,7 @@ void read_master(int fail_on_open_error) if (argv->argc < PC_MASTER_MIN_FIELDS) msg_fatal("file %s: line %d: bad field count", path, line_count); + normalize_options(argv); master_table[entry_count].name_space = concatenate(argv->argv[0], ".", argv->argv[1], (char *) 0); master_table[entry_count].argv = argv; @@ -197,7 +227,7 @@ static void print_master_line(int mode, ARGV *argv) * Try to show the generic options (-v -D) on the first line, and * non-options on a later line. */ - if (arg[0] != '-') { + if (arg[0] != '-' || strcmp(arg, "--") == 0) { in_daemon_options = 0; if ((mode & FOLD_LINE) && line_len > column_goal[PC_MASTER_MIN_FIELDS - 1]) { diff --git a/postfix/src/postconf/postconf_user.c b/postfix/src/postconf/postconf_user.c index 989b7ef37..d3ff7e318 100644 --- a/postfix/src/postconf/postconf_user.c +++ b/postfix/src/postconf/postconf_user.c @@ -296,7 +296,7 @@ void register_user_parameters(void) for (masterp = master_table; (argv = masterp->argv) != 0; masterp++) { for (field = PC_MASTER_MIN_FIELDS; argv->argv[field] != 0; field++) { arg = argv->argv[field]; - if (arg[0] != '-') + if (arg[0] != '-' || strcmp(arg, "--") == 0) break; if (strcmp(arg, "-o") == 0 && (arg = argv->argv[field + 1]) != 0) { saved_arg = mystrdup(arg); diff --git a/postfix/src/postconf/test30.ref b/postfix/src/postconf/test30.ref new file mode 100644 index 000000000..706a429b7 --- /dev/null +++ b/postfix/src/postconf/test30.ref @@ -0,0 +1,7 @@ +config_directory = . +p1 = xx +p2 = xx +p3 = xx +p4 = xx +./postconf: warning: ./master.cf: unused parameter: bodyx_checks=$p2 +./postconf: warning: ./master.cf: unused parameter: headerx_checks=$p4 diff --git a/postfix/src/postdrop/Makefile.in b/postfix/src/postdrop/Makefile.in index 06afb8492..cfdc692c8 100644 --- a/postfix/src/postdrop/Makefile.in +++ b/postfix/src/postdrop/Makefile.in @@ -82,4 +82,5 @@ postdrop.o: ../../include/user_acl.h postdrop.o: ../../include/vbuf.h postdrop.o: ../../include/vstream.h postdrop.o: ../../include/vstring.h +postdrop.o: ../../include/warn_stat.h postdrop.o: postdrop.c diff --git a/postfix/src/postdrop/postdrop.c b/postfix/src/postdrop/postdrop.c index 84f8e69e0..232217d85 100644 --- a/postfix/src/postdrop/postdrop.c +++ b/postfix/src/postdrop/postdrop.c @@ -108,6 +108,7 @@ #include #include #include +#include /* Utility library. */ diff --git a/postfix/src/postfix/Makefile.in b/postfix/src/postfix/Makefile.in index ef7c63cac..71e1224e1 100644 --- a/postfix/src/postfix/Makefile.in +++ b/postfix/src/postfix/Makefile.in @@ -75,4 +75,5 @@ postfix.o: ../../include/sys_defs.h postfix.o: ../../include/vbuf.h postfix.o: ../../include/vstream.h postfix.o: ../../include/vstring.h +postfix.o: ../../include/warn_stat.h postfix.o: postfix.c diff --git a/postfix/src/postfix/postfix.c b/postfix/src/postfix/postfix.c index 60343668e..077b91e4e 100644 --- a/postfix/src/postfix/postfix.c +++ b/postfix/src/postfix/postfix.c @@ -355,6 +355,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postkick/Makefile.in b/postfix/src/postkick/Makefile.in index 7271ed1d0..72fde2102 100644 --- a/postfix/src/postkick/Makefile.in +++ b/postfix/src/postkick/Makefile.in @@ -71,4 +71,5 @@ postkick.o: ../../include/safe.h postkick.o: ../../include/sys_defs.h postkick.o: ../../include/vbuf.h postkick.o: ../../include/vstream.h +postkick.o: ../../include/warn_stat.h postkick.o: postkick.c diff --git a/postfix/src/postkick/postkick.c b/postfix/src/postkick/postkick.c index 93df8d0e3..700467c10 100644 --- a/postfix/src/postkick/postkick.c +++ b/postfix/src/postkick/postkick.c @@ -52,7 +52,7 @@ /* configuration files. /* .IP "\fBapplication_event_drain_time (100s)\fR" /* How long the \fBpostkick\fR(1) command waits for a request to enter the -/* server's input buffer before giving up. +/* Postfix daemon process input buffer before giving up. /* .IP "\fBqueue_directory (see 'postconf -d' output)\fR" /* The location of the Postfix top-level queue directory. /* FILES @@ -91,6 +91,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postlock/Makefile.in b/postfix/src/postlock/Makefile.in index 7024d7139..de6546bd3 100644 --- a/postfix/src/postlock/Makefile.in +++ b/postfix/src/postlock/Makefile.in @@ -78,4 +78,5 @@ postlock.o: ../../include/sys_exits.h postlock.o: ../../include/vbuf.h postlock.o: ../../include/vstream.h postlock.o: ../../include/vstring.h +postlock.o: ../../include/warn_stat.h postlock.o: postlock.c diff --git a/postfix/src/postlock/postlock.c b/postfix/src/postlock/postlock.c index e2814bce3..01f3cad5b 100644 --- a/postfix/src/postlock/postlock.c +++ b/postfix/src/postlock/postlock.c @@ -108,6 +108,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postlog/Makefile.in b/postfix/src/postlog/Makefile.in index 5882fd33f..effad6c4e 100644 --- a/postfix/src/postlog/Makefile.in +++ b/postfix/src/postlog/Makefile.in @@ -74,4 +74,5 @@ postlog.o: ../../include/vbuf.h postlog.o: ../../include/vstream.h postlog.o: ../../include/vstring.h postlog.o: ../../include/vstring_vstream.h +postlog.o: ../../include/warn_stat.h postlog.o: postlog.c diff --git a/postfix/src/postlog/postlog.c b/postfix/src/postlog/postlog.c index 67715ae9e..90f0f2b4c 100644 --- a/postfix/src/postlog/postlog.c +++ b/postfix/src/postlog/postlog.c @@ -94,6 +94,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postmap/Makefile.in b/postfix/src/postmap/Makefile.in index 2684a5d77..9ffc591b6 100644 --- a/postfix/src/postmap/Makefile.in +++ b/postfix/src/postmap/Makefile.in @@ -111,4 +111,5 @@ postmap.o: ../../include/vbuf.h postmap.o: ../../include/vstream.h postmap.o: ../../include/vstring.h postmap.o: ../../include/vstring_vstream.h +postmap.o: ../../include/warn_stat.h postmap.o: postmap.c diff --git a/postfix/src/postmap/postmap.c b/postfix/src/postmap/postmap.c index 4781d5211..8249d79d5 100644 --- a/postfix/src/postmap/postmap.c +++ b/postfix/src/postmap/postmap.c @@ -281,6 +281,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postmulti/Makefile.in b/postfix/src/postmulti/Makefile.in index b071ec942..2c8f4137f 100644 --- a/postfix/src/postmulti/Makefile.in +++ b/postfix/src/postmulti/Makefile.in @@ -80,4 +80,5 @@ postmulti.o: ../../include/vbuf.h postmulti.o: ../../include/vstream.h postmulti.o: ../../include/vstring.h postmulti.o: ../../include/vstring_vstream.h +postmulti.o: ../../include/warn_stat.h postmulti.o: postmulti.c diff --git a/postfix/src/postmulti/postmulti.c b/postfix/src/postmulti/postmulti.c index c0ff9df36..fcf66008c 100644 --- a/postfix/src/postmulti/postmulti.c +++ b/postfix/src/postmulti/postmulti.c @@ -415,6 +415,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postqueue/Makefile.in b/postfix/src/postqueue/Makefile.in index 4e80a3c81..c7ebd3c74 100644 --- a/postfix/src/postqueue/Makefile.in +++ b/postfix/src/postqueue/Makefile.in @@ -85,4 +85,5 @@ postqueue.o: ../../include/valid_mailhost_addr.h postqueue.o: ../../include/vbuf.h postqueue.o: ../../include/vstream.h postqueue.o: ../../include/vstring.h +postqueue.o: ../../include/warn_stat.h postqueue.o: postqueue.c diff --git a/postfix/src/postqueue/postqueue.c b/postfix/src/postqueue/postqueue.c index d6ed5ccc4..6ea91f90b 100644 --- a/postfix/src/postqueue/postqueue.c +++ b/postfix/src/postqueue/postqueue.c @@ -186,6 +186,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/postscreen/postscreen.c b/postfix/src/postscreen/postscreen.c index 36a665bf1..b529ed392 100644 --- a/postfix/src/postscreen/postscreen.c +++ b/postfix/src/postscreen/postscreen.c @@ -796,7 +796,8 @@ static void psc_service(VSTREAM *smtp_client_stream, } /* - * Don't whitelist clients that connect to backup MX addresses. + * Don't whitelist clients that connect to backup MX addresses. Fail + * "closed" on error. */ if (addr_match_list_match(psc_wlist_if, smtp_server_addr.buf) == 0) { state->flags |= (PSC_STATE_FLAG_WLIST_FAIL | PSC_STATE_FLAG_NOFORWARD); @@ -862,8 +863,9 @@ static void pre_jail_init(char *unused_name, char **unused_argv) psc_acl_pre_jail_init(var_mynetworks, VAR_PSC_ACL); if (*var_psc_acl) psc_acl = psc_acl_parse(var_psc_acl, VAR_PSC_ACL); + /* Ignore smtpd_forbid_cmds lookup errors. Non-critical feature. */ if (*var_psc_forbid_cmds) - psc_forbid_cmds = string_list_init(MATCH_FLAG_NONE, + psc_forbid_cmds = string_list_init(MATCH_FLAG_RETURN, var_psc_forbid_cmds); if (*var_psc_dnsbl_reply) psc_dnsbl_reply = dict_open(var_psc_dnsbl_reply, O_RDONLY, @@ -1008,7 +1010,8 @@ static void post_jail_init(char *unused_name, char **unused_argv) var_psc_barlf_action)) < 0) msg_fatal("bad %s value: %s", VAR_PSC_BARLF_ACTION, var_psc_barlf_action); - psc_wlist_if = addr_match_list_init(MATCH_FLAG_NONE, var_psc_wlist_if); + /* Fail "closed" on error. */ + psc_wlist_if = addr_match_list_init(MATCH_FLAG_RETURN, var_psc_wlist_if); /* * Start the cache maintenance pseudo thread last. Early cleanup makes diff --git a/postfix/src/postscreen/postscreen_smtpd.c b/postfix/src/postscreen/postscreen_smtpd.c index 406438b55..7e319f713 100644 --- a/postfix/src/postscreen/postscreen_smtpd.c +++ b/postfix/src/postscreen/postscreen_smtpd.c @@ -928,6 +928,7 @@ static void psc_smtpd_read_event(int event, char *context) if ((state->flags & PSC_STATE_MASK_NSMTP_TODO_SKIP) == PSC_STATE_FLAG_NSMTP_TODO && cmdp->name == 0 && (is_header(command) + /* Ignore forbid_cmds lookup errors. Non-critical feature. */ || (*var_psc_forbid_cmds && string_list_match(psc_forbid_cmds, command)))) { printable(command, '?'); diff --git a/postfix/src/postsuper/Makefile.in b/postfix/src/postsuper/Makefile.in index 7367d601f..fe86fda94 100644 --- a/postfix/src/postsuper/Makefile.in +++ b/postfix/src/postsuper/Makefile.in @@ -80,4 +80,5 @@ postsuper.o: ../../include/vbuf.h postsuper.o: ../../include/vstream.h postsuper.o: ../../include/vstring.h postsuper.o: ../../include/vstring_vstream.h +postsuper.o: ../../include/warn_stat.h postsuper.o: postsuper.c diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index 7e3b2b98c..9dabb5dc4 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -280,6 +280,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/qmgr/Makefile.in b/postfix/src/qmgr/Makefile.in index c1a7f2051..e9e2a3ba6 100644 --- a/postfix/src/qmgr/Makefile.in +++ b/postfix/src/qmgr/Makefile.in @@ -114,6 +114,7 @@ qmgr_active.o: ../../include/trace.h qmgr_active.o: ../../include/vbuf.h qmgr_active.o: ../../include/vstream.h qmgr_active.o: ../../include/vstring.h +qmgr_active.o: ../../include/warn_stat.h qmgr_active.o: qmgr.h qmgr_active.o: qmgr_active.c qmgr_bounce.o: ../../include/attr.h diff --git a/postfix/src/qmgr/qmgr_active.c b/postfix/src/qmgr/qmgr_active.c index eea9d71d0..d93a2cd10 100644 --- a/postfix/src/qmgr/qmgr_active.c +++ b/postfix/src/qmgr/qmgr_active.c @@ -93,6 +93,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/sendmail/Makefile.in b/postfix/src/sendmail/Makefile.in index 805a3f4c8..02111628f 100644 --- a/postfix/src/sendmail/Makefile.in +++ b/postfix/src/sendmail/Makefile.in @@ -102,4 +102,5 @@ sendmail.o: ../../include/verp_sender.h sendmail.o: ../../include/vstream.h sendmail.o: ../../include/vstring.h sendmail.o: ../../include/vstring_vstream.h +sendmail.o: ../../include/warn_stat.h sendmail.o: sendmail.c diff --git a/postfix/src/sendmail/sendmail.c b/postfix/src/sendmail/sendmail.c index 9560f4840..5e205a57c 100644 --- a/postfix/src/sendmail/sendmail.c +++ b/postfix/src/sendmail/sendmail.c @@ -437,6 +437,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/tlsmgr/Makefile.in b/postfix/src/tlsmgr/Makefile.in index 3d2f27447..5ad0645b5 100644 --- a/postfix/src/tlsmgr/Makefile.in +++ b/postfix/src/tlsmgr/Makefile.in @@ -87,4 +87,5 @@ tlsmgr.o: ../../include/vbuf.h tlsmgr.o: ../../include/vstream.h tlsmgr.o: ../../include/vstring.h tlsmgr.o: ../../include/vstring_vstream.h +tlsmgr.o: ../../include/warn_stat.h tlsmgr.o: tlsmgr.c diff --git a/postfix/src/tlsmgr/tlsmgr.c b/postfix/src/tlsmgr/tlsmgr.c index efddb5c37..cab6caff2 100644 --- a/postfix/src/tlsmgr/tlsmgr.c +++ b/postfix/src/tlsmgr/tlsmgr.c @@ -200,6 +200,7 @@ #include #include #include +#include /* Global library. */ diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index c73642c98..dc7a4bb43 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -34,7 +34,7 @@ SRCS = alldig.c allprint.c argv.c argv_split.c attr_clnt.c attr_print0.c \ unix_pass_listen.c unix_pass_trigger.c edit_file.c inet_windowsize.c \ unix_pass_fd_fix.c dict_cache.c valid_utf_8.c dict_thash.c \ ip_match.c nbbio.c stream_pass_connect.c base32_code.c dict_test.c \ - dict_fail.c msg_rate_delay.c dict_surrogate.c + dict_fail.c msg_rate_delay.c dict_surrogate.c warn_stat.c OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \ attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \ @@ -70,7 +70,7 @@ OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \ unix_pass_listen.o unix_pass_trigger.o edit_file.o inet_windowsize.o \ unix_pass_fd_fix.o dict_cache.o valid_utf_8.o dict_thash.o \ ip_match.o nbbio.o stream_pass_connect.o base32_code.o dict_test.o \ - dict_fail.o msg_rate_delay.o dict_surrogate.o + dict_fail.o msg_rate_delay.o dict_surrogate.o warn_stat.o HDRS = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \ chroot_uid.h cidr_match.h clean_env.h connect.h ctable.h dict.h \ dict_cdb.h dict_cidr.h dict_db.h dict_dbm.h dict_env.h dict_ht.h \ @@ -91,7 +91,7 @@ HDRS = argv.h attr.h attr_clnt.h auto_clnt.h base64_code.h binhash.h \ username.h valid_hostname.h vbuf.h vbuf_print.h vstream.h vstring.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 + dict_fail.h warn_stat.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) @@ -853,6 +853,7 @@ dict.o: sys_defs.h dict.o: vbuf.h dict.o: vstream.h dict.o: vstring.h +dict.o: warn_stat.h dict_alloc.o: argv.h dict_alloc.o: dict.h dict_alloc.o: dict_alloc.c @@ -886,6 +887,7 @@ dict_cdb.o: sys_defs.h dict_cdb.o: vbuf.h dict_cdb.o: vstream.h dict_cdb.o: vstring.h +dict_cdb.o: warn_stat.h dict_cidr.o: argv.h dict_cidr.o: cidr_match.h dict_cidr.o: dict.h @@ -900,6 +902,7 @@ dict_cidr.o: sys_defs.h dict_cidr.o: vbuf.h dict_cidr.o: vstream.h dict_cidr.o: vstring.h +dict_cidr.o: warn_stat.h dict_db.o: argv.h dict_db.o: dict.h dict_db.o: dict_db.c @@ -913,6 +916,7 @@ dict_db.o: sys_defs.h dict_db.o: vbuf.h dict_db.o: vstream.h dict_db.o: vstring.h +dict_db.o: warn_stat.h dict_dbm.o: dict_dbm.c dict_dbm.o: sys_defs.h dict_debug.o: argv.h @@ -1025,6 +1029,7 @@ dict_pcre.o: sys_defs.h dict_pcre.o: vbuf.h dict_pcre.o: vstream.h dict_pcre.o: vstring.h +dict_pcre.o: warn_stat.h dict_regexp.o: argv.h dict_regexp.o: dict.h dict_regexp.o: dict_regexp.c @@ -1039,6 +1044,7 @@ dict_regexp.o: sys_defs.h dict_regexp.o: vbuf.h dict_regexp.o: vstream.h dict_regexp.o: vstring.h +dict_regexp.o: warn_stat.h dict_sdbm.o: argv.h dict_sdbm.o: dict.h dict_sdbm.o: dict_sdbm.c @@ -1053,6 +1059,7 @@ dict_sdbm.o: sys_defs.h dict_sdbm.o: vbuf.h dict_sdbm.o: vstream.h dict_sdbm.o: vstring.h +dict_sdbm.o: warn_stat.h dict_static.o: argv.h dict_static.o: dict.h dict_static.o: dict_static.c @@ -1112,6 +1119,7 @@ dict_thash.o: sys_defs.h dict_thash.o: vbuf.h dict_thash.o: vstream.h dict_thash.o: vstring.h +dict_thash.o: warn_stat.h dict_unix.o: argv.h dict_unix.o: dict.h dict_unix.o: dict_unix.c @@ -1156,6 +1164,7 @@ edit_file.o: sys_defs.h edit_file.o: vbuf.h edit_file.o: vstream.h edit_file.o: vstring.h +edit_file.o: warn_stat.h environ.o: environ.c environ.o: sys_defs.h events.o: events.c @@ -1175,6 +1184,7 @@ fifo_listen.o: iostuff.h fifo_listen.o: listen.h fifo_listen.o: msg.h fifo_listen.o: sys_defs.h +fifo_listen.o: warn_stat.h fifo_open.o: fifo_open.c fifo_rdonly_bug.o: fifo_rdonly_bug.c fifo_rdonly_bug.o: sys_defs.h @@ -1347,6 +1357,7 @@ load_file.o: msg.h load_file.o: sys_defs.h load_file.o: vbuf.h load_file.o: vstream.h +load_file.o: warn_stat.h lowercase.o: lowercase.c lowercase.o: stringops.h lowercase.o: sys_defs.h @@ -1357,6 +1368,7 @@ lstat_as.o: lstat_as.h lstat_as.o: msg.h lstat_as.o: set_eugid.h lstat_as.o: sys_defs.h +lstat_as.o: warn_stat.h mac_expand.o: mac_expand.c mac_expand.o: mac_expand.h mac_expand.o: mac_parse.h @@ -1379,6 +1391,7 @@ make_dirs.o: stringops.h make_dirs.o: sys_defs.h make_dirs.o: vbuf.h make_dirs.o: vstring.h +make_dirs.o: warn_stat.h mask_addr.o: mask_addr.c mask_addr.o: mask_addr.h mask_addr.o: msg.h @@ -1580,6 +1593,7 @@ safe_open.o: sys_defs.h safe_open.o: vbuf.h safe_open.o: vstream.h safe_open.o: vstring.h +safe_open.o: warn_stat.h sane_accept.o: msg.h sane_accept.o: sane_accept.c sane_accept.o: sane_accept.h @@ -1597,10 +1611,12 @@ sane_link.o: msg.h sane_link.o: sane_fsops.h sane_link.o: sane_link.c sane_link.o: sys_defs.h +sane_link.o: warn_stat.h sane_rename.o: msg.h sane_rename.o: sane_fsops.h sane_rename.o: sane_rename.c sane_rename.o: sys_defs.h +sane_rename.o: warn_stat.h sane_socketpair.o: msg.h sane_socketpair.o: sane_socketpair.c sane_socketpair.o: sane_socketpair.h @@ -1668,6 +1684,7 @@ stat_as.o: set_eugid.h stat_as.o: stat_as.c stat_as.o: stat_as.h stat_as.o: sys_defs.h +stat_as.o: warn_stat.h strcasecmp.o: strcasecmp.c strcasecmp.o: sys_defs.h stream_connect.o: connect.h @@ -1866,6 +1883,10 @@ vstring_vstream.o: vstream.h vstring_vstream.o: vstring.h vstring_vstream.o: vstring_vstream.c vstring_vstream.o: vstring_vstream.h +warn_stat.o: msg.h +warn_stat.o: sys_defs.h +warn_stat.o: warn_stat.c +warn_stat.o: warn_stat.h watchdog.o: events.h watchdog.o: iostuff.h watchdog.o: killme_after.h diff --git a/postfix/src/util/argv.c b/postfix/src/util/argv.c index 4613bc2df..de2d4b329 100644 --- a/postfix/src/util/argv.c +++ b/postfix/src/util/argv.c @@ -28,6 +28,16 @@ /* ARGV *argvp; /* ssize_t len; /* +/* void argv_insert_one(argvp, pos, arg) +/* ARGV *argvp; +/* ssize_t pos; +/* const char *arg; +/* +/* void argv_replace_one(argvp, pos, arg) +/* ARGV *argvp; +/* ssize_t pos; +/* const char *arg; +/* /* void ARGV_FAKE_BEGIN(argv, arg) /* const char *arg; /* @@ -63,6 +73,12 @@ /* number of entries, but does not reallocate memory. The /* result is null-terminated. /* +/* argv_insert_one() inserts one string at the specified array +/* position. +/* +/* argv_replace_one() replaces one string at the specified +/* position. +/* /* ARGV_FAKE_BEGIN/END are an optimization for the case where /* a single string needs to be passed into an ARGV-based /* interface. ARGV_FAKE_BEGIN() opens a statement block and @@ -219,3 +235,38 @@ void argv_truncate(ARGV *argvp, ssize_t len) argvp->argv[argvp->argc] = 0; } } + +/* argv_insert_one - insert one string into array */ + +void argv_insert_one(ARGV *argvp, ssize_t where, const char *arg) +{ + ssize_t pos; + + /* + * Sanity check. + */ + if (where < 0 || where > argvp->argc) + msg_panic("argv_insert_one bad position: %ld", (long) where); + + if (ARGV_SPACE_LEFT(argvp) <= 0) + argv_extend(argvp); + for (pos = argvp->argc; pos >= where; pos--) + argvp->argv[pos + 1] = argvp->argv[pos]; + argvp->argv[where] = mystrdup(arg); + argvp->argc += 1; +} + +/* argv_replace_one - insert one string into array */ + +void argv_replace_one(ARGV *argvp, ssize_t where, const char *arg) +{ + + /* + * Sanity check. + */ + if (where < 0 || where >= argvp->argc) + msg_panic("argv_replace_one bad position: %ld", (long) where); + + myfree(argvp->argv[where]); + argvp->argv[where] = mystrdup(arg); +} diff --git a/postfix/src/util/argv.h b/postfix/src/util/argv.h index 17f006a39..7c56f581a 100644 --- a/postfix/src/util/argv.h +++ b/postfix/src/util/argv.h @@ -25,6 +25,8 @@ extern void argv_add(ARGV *,...); extern void argv_addn(ARGV *,...); extern void argv_terminate(ARGV *); extern void argv_truncate(ARGV *, ssize_t); +extern void argv_insert_one(ARGV *, ssize_t, const char *); +extern void argv_replace_one(ARGV *, ssize_t, const char *); extern ARGV *argv_free(ARGV *); extern ARGV *argv_split(const char *, const char *); diff --git a/postfix/src/util/dict.c b/postfix/src/util/dict.c index 875c5c513..3ef835b89 100644 --- a/postfix/src/util/dict.c +++ b/postfix/src/util/dict.c @@ -215,6 +215,7 @@ #include "name_mask.h" #include "dict.h" #include "dict_ht.h" +#include "warn_stat.h" static HTABLE *dict_table; diff --git a/postfix/src/util/dict_cdb.c b/postfix/src/util/dict_cdb.c index 9de10fdf0..f79c1353d 100644 --- a/postfix/src/util/dict_cdb.c +++ b/postfix/src/util/dict_cdb.c @@ -60,6 +60,7 @@ #include "stringops.h" #include "dict.h" #include "dict_cdb.h" +#include "warn_stat.h" #ifdef HAS_CDB diff --git a/postfix/src/util/dict_cidr.c b/postfix/src/util/dict_cidr.c index 2ea7ab1fd..7aecb2f25 100644 --- a/postfix/src/util/dict_cidr.c +++ b/postfix/src/util/dict_cidr.c @@ -53,6 +53,7 @@ #include #include #include +#include /* Application-specific. */ diff --git a/postfix/src/util/dict_db.c b/postfix/src/util/dict_db.c index 5a4287c86..93ee48098 100644 --- a/postfix/src/util/dict_db.c +++ b/postfix/src/util/dict_db.c @@ -109,6 +109,7 @@ #include "myflock.h" #include "dict.h" #include "dict_db.h" +#include "warn_stat.h" /* Application-specific. */ diff --git a/postfix/src/util/dict_dbm.c b/postfix/src/util/dict_dbm.c index c0627d87b..37e14639f 100644 --- a/postfix/src/util/dict_dbm.c +++ b/postfix/src/util/dict_dbm.c @@ -60,6 +60,7 @@ #include "stringops.h" #include "dict.h" #include "dict_dbm.h" +#include "warn_stat.h" /* Application-specific. */ diff --git a/postfix/src/util/dict_pcre.c b/postfix/src/util/dict_pcre.c index d53d4b6c8..060019ec5 100644 --- a/postfix/src/util/dict_pcre.c +++ b/postfix/src/util/dict_pcre.c @@ -59,6 +59,7 @@ #include "dict_pcre.h" #include "mac_parse.h" #include "pcre.h" +#include "warn_stat.h" /* * Support for IF/ENDIF based on an idea by Bert Driehuis. diff --git a/postfix/src/util/dict_regexp.c b/postfix/src/util/dict_regexp.c index 2cab3b4e0..14275089b 100644 --- a/postfix/src/util/dict_regexp.c +++ b/postfix/src/util/dict_regexp.c @@ -61,6 +61,7 @@ #include "dict.h" #include "dict_regexp.h" #include "mac_parse.h" +#include "warn_stat.h" /* * Support for IF/ENDIF based on an idea by Bert Driehuis. diff --git a/postfix/src/util/dict_sdbm.c b/postfix/src/util/dict_sdbm.c index 3a30d9c65..23371dc7c 100644 --- a/postfix/src/util/dict_sdbm.c +++ b/postfix/src/util/dict_sdbm.c @@ -52,6 +52,7 @@ #include #include #include +#include #ifdef HAS_SDBM diff --git a/postfix/src/util/dict_thash.c b/postfix/src/util/dict_thash.c index 0f09d4b93..6eac13ff6 100644 --- a/postfix/src/util/dict_thash.c +++ b/postfix/src/util/dict_thash.c @@ -49,6 +49,7 @@ #include #include #include +#include /* Application-specific. */ diff --git a/postfix/src/util/edit_file.c b/postfix/src/util/edit_file.c index 9b5388ab0..868128806 100644 --- a/postfix/src/util/edit_file.c +++ b/postfix/src/util/edit_file.c @@ -154,6 +154,7 @@ #include #include #include +#include /* * Do we reuse and truncate an output file that persists after a crash, or diff --git a/postfix/src/util/fifo_listen.c b/postfix/src/util/fifo_listen.c index 62915c14c..9ad3440de 100644 --- a/postfix/src/util/fifo_listen.c +++ b/postfix/src/util/fifo_listen.c @@ -43,6 +43,7 @@ #include "msg.h" #include "iostuff.h" #include "listen.h" +#include "warn_stat.h" #define BUF_LEN 100 diff --git a/postfix/src/util/load_file.c b/postfix/src/util/load_file.c index 59af3453c..4e575d139 100644 --- a/postfix/src/util/load_file.c +++ b/postfix/src/util/load_file.c @@ -46,6 +46,7 @@ #include #include #include +#include /* load_file - load file with some prejudice */ diff --git a/postfix/src/util/lstat_as.c b/postfix/src/util/lstat_as.c index ffb796e8c..18e0f9fbf 100644 --- a/postfix/src/util/lstat_as.c +++ b/postfix/src/util/lstat_as.c @@ -44,6 +44,7 @@ #include "msg.h" #include "set_eugid.h" #include "lstat_as.h" +#include "warn_stat.h" /* lstat_as - lstat file as user */ diff --git a/postfix/src/util/make_dirs.c b/postfix/src/util/make_dirs.c index fef1c6fcc..2e37f8fe6 100644 --- a/postfix/src/util/make_dirs.c +++ b/postfix/src/util/make_dirs.c @@ -45,6 +45,7 @@ #include "mymalloc.h" #include "stringops.h" #include "make_dirs.h" +#include "warn_stat.h" /* make_dirs - create directory hierarchy */ diff --git a/postfix/src/util/myaddrinfo.ref b/postfix/src/util/myaddrinfo.ref index f0da580cb..360228a10 100644 --- a/postfix/src/util/myaddrinfo.ref +++ b/postfix/src/util/myaddrinfo.ref @@ -1,8 +1,8 @@ ./myaddrinfo: === hostname belly.porcupine.org === -./myaddrinfo: belly.porcupine.org -> family=28 sock=1 proto=6 2604:8d00:189::6 -./myaddrinfo: 2604:8d00:189::6 -> belly.porcupine.org ./myaddrinfo: belly.porcupine.org -> family=2 sock=1 proto=6 168.100.189.6 ./myaddrinfo: 168.100.189.6 -> belly.porcupine.org +./myaddrinfo: belly.porcupine.org -> family=28 sock=1 proto=6 2604:8d00:189::6 +./myaddrinfo: 2604:8d00:189::6 -> belly.porcupine.org ./myaddrinfo: === host address 168.100.189.2 === ./myaddrinfo: 168.100.189.2 -> family=2 sock=1 proto=6 168.100.189.2 ./myaddrinfo: 168.100.189.2 -> spike.porcupine.org diff --git a/postfix/src/util/safe_open.c b/postfix/src/util/safe_open.c index 9cf5d0263..c7a80cfa8 100644 --- a/postfix/src/util/safe_open.c +++ b/postfix/src/util/safe_open.c @@ -85,6 +85,7 @@ #include #include #include +#include /* safe_open_exist - open existing file */ diff --git a/postfix/src/util/sane_link.c b/postfix/src/util/sane_link.c index a094377ee..de83564cd 100644 --- a/postfix/src/util/sane_link.c +++ b/postfix/src/util/sane_link.c @@ -34,6 +34,7 @@ #include "msg.h" #include "sane_fsops.h" +#include "warn_stat.h" /* sane_link - sanitize link() error returns */ diff --git a/postfix/src/util/sane_rename.c b/postfix/src/util/sane_rename.c index 7a458c3f2..4c551605a 100644 --- a/postfix/src/util/sane_rename.c +++ b/postfix/src/util/sane_rename.c @@ -34,6 +34,7 @@ #include "msg.h" #include "sane_fsops.h" +#include "warn_stat.h" /* sane_rename - sanitize rename() error returns */ diff --git a/postfix/src/util/stat_as.c b/postfix/src/util/stat_as.c index 0f578a541..3e05ff749 100644 --- a/postfix/src/util/stat_as.c +++ b/postfix/src/util/stat_as.c @@ -44,6 +44,7 @@ #include "msg.h" #include "set_eugid.h" #include "stat_as.h" +#include "warn_stat.h" /* stat_as - stat file as user */ diff --git a/postfix/src/util/warn_stat.c b/postfix/src/util/warn_stat.c new file mode 100644 index 000000000..fd885d970 --- /dev/null +++ b/postfix/src/util/warn_stat.c @@ -0,0 +1,101 @@ +/*++ +/* NAME +/* warn_stat 3 +/* SUMMARY +/* baby-sit stat() error returns +/* SYNOPSIS +/* #include +/* +/* int warn_stat(path, st) +/* const char *path; +/* struct stat *st; +/* +/* int warn_lstat(path, st) +/* const char *path; +/* struct stat *st; +/* +/* int warn_fstat(fd, st) +/* int fd; +/* struct stat *st; +/* DESCRIPTION +/* warn_stat(), warn_fstat() and warn_lstat() wrap the stat(), +/* fstat() and lstat() system calls with code that logs a +/* diagnosis for common error cases. +/* 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 +/*--*/ + +/* System library. */ + +#include +#include +#include + +/* Utility library. */ + +#include +#define WARN_STAT_INTERNAL +#include + +/* diagnose_stat - log stat warning */ + +static void diagnose_stat(void) +{ + struct stat st; + + /* + * When *stat() fails with EOVERFLOW, and the interface uses 32-bit data + * types, suggest that the program be recompiled with larger data types. + */ +#ifdef EOVERFLOW + if (errno == EOVERFLOW && sizeof(st.st_size) == 4) { + msg_warn("this program was built for 32-bit file handles, " + "but some number does not fit in 32 bits"); + msg_warn("possible solution: recompile in 64-bit mode, or " + "recompile in 32-bit mode with 'large file' support"); + } +#endif +} + +/* warn_stat - stat with warning */ + +int warn_stat(const char *path, struct stat * st) +{ + int ret; + + ret = stat(path, st); + if (ret < 0) + diagnose_stat(); + return (ret); +} + +/* warn_lstat - lstat with warning */ + +int warn_lstat(const char *path, struct stat * st) +{ + int ret; + + ret = lstat(path, st); + if (ret < 0) + diagnose_stat(); + return (ret); +} + +/* warn_fstat - fstat with warning */ + +int warn_fstat(int fd, struct stat * st) +{ + int ret; + + ret = fstat(fd, st); + if (ret < 0) + diagnose_stat(); + return (ret); +} diff --git a/postfix/src/util/warn_stat.h b/postfix/src/util/warn_stat.h new file mode 100644 index 000000000..92ddce04d --- /dev/null +++ b/postfix/src/util/warn_stat.h @@ -0,0 +1,38 @@ +#ifndef _WARN_STAT_H_ +#define _WARN_STAT_H_ + +/*++ +/* NAME +/* warn_stat 3h +/* SUMMARY +/* baby-sit stat() error returns +/* SYNOPSIS +/* #include +/* DESCRIPTION +/* .nf + + /* + * External interface. + */ +#ifndef WARN_STAT_INTERNAL +#define stat(p, s) warn_stat((p), (s)) +#define lstat(p, s) warn_lstat((p), (s)) +#define fstat(f, s) warn_fstat((f), (s)) +#endif + +extern int warn_stat(const char *path, struct stat *); +extern int warn_lstat(const char *path, struct stat *); +extern int warn_fstat(int, struct stat *); + +/* 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/virtual/Makefile.in b/postfix/src/virtual/Makefile.in index 9aed39f41..954c544a4 100644 --- a/postfix/src/virtual/Makefile.in +++ b/postfix/src/virtual/Makefile.in @@ -133,6 +133,7 @@ maildir.o: ../../include/sys_defs.h maildir.o: ../../include/vbuf.h maildir.o: ../../include/vstream.h maildir.o: ../../include/vstring.h +maildir.o: ../../include/warn_stat.h maildir.o: maildir.c maildir.o: virtual.h recipient.o: ../../include/argv.h diff --git a/postfix/src/virtual/maildir.c b/postfix/src/virtual/maildir.c index a44d09953..a6770610e 100644 --- a/postfix/src/virtual/maildir.c +++ b/postfix/src/virtual/maildir.c @@ -52,6 +52,7 @@ #include #include #include +#include /* Global library. */