From: Wietse Z Venema Date: Sun, 30 Nov 2025 05:00:00 +0000 (-0500) Subject: postfix-3.11-20251130 X-Git-Tag: v3.11.0-RC1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06784971064c3378591e8ee48223c3371404f348;p=thirdparty%2Fpostfix.git postfix-3.11-20251130 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 1e543007e..028555426 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -29900,10 +29900,11 @@ Apologies for any names omitted. tlsproxy_client_policy, virtual_maps. Files: mantools/postlink, proto/DEPRECATION_README.html, postconf/postconf_unused.c. - Cleanup: SMTP client null pointer crash when an STS policy - plugin sends no policy_string or no mx_pattern attributes. - This can happen only during tests with a fake STS plugin. - File: smtp/smtp_tlsrpt.c. + Bugfix (defect introduced: Postfix 3.10, date: 20240902): + SMTP client null pointer crash when an STS policy plugin + sends no policy_string or no mx_pattern attributes. This + can happen only during tests with a fake STS plugin. File: + smtp/smtp_tlsrpt.c. 20251028 @@ -30085,5 +30086,24 @@ Apologies for any names omitted. 20251125 - Cleanup: too many braces in postmulti JSON output. Files: + Cleanup: too many braces in postmulti JSON output. Files: postmulti/Makefile.in, postmulti/postmulti.c. + +20251130 + + Bugfix (defect introduced: Postfix 3.11, date: 20251103): + postconf panic (in mac_expand_add_named_fn) because an + attempt was made to register a function more than once. + Files: util/mac_midna.c, global/mail_params.c. + + Cleanup: in postmulti(1) tests link the fake_strcmp wrapper + statically, and speed up tests by back-dating test main.cf + files. Files: postmulti/Makefile.in. + + Usability: enable postmulti(1) logging to STDERR even when + STDERR is not connected to a terminal, just like most other + Postfix command utilities. This makes the command easier + to integrate into (test) scripts. File: postmulti/postmulti.c. + + Testing: test that postmulti(1) will reject a non-default + config_directory setting. File: postmulti/Makefile.in. diff --git a/postfix/proto/stop.double-history b/postfix/proto/stop.double-history index c882e8ed6..cfb9a50c9 100644 --- a/postfix/proto/stop.double-history +++ b/postfix/proto/stop.double-history @@ -255,3 +255,5 @@ proto proto REQUIRETLS_README html global mail_params hc postalias postalias c postconf postconf hc postconf postconf_main c and JSON output Files postmulti postmulti c + postmulti Makefile in postmulti postmulti c + to integrate into test scripts File postmulti postmulti c diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index 607ab3a90..cee69696e 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -930,15 +930,11 @@ void mail_params_init() 0, }; const char *cp; - static int first = 1; /* * Register named functions. */ - if (first) { - mac_midna_register(); - first = 0; - } + mac_midna_register(); /* * Extract compatibility level first, so that we can determine what diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 7116469dd..97fc2bcf2 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20251125" +#define MAIL_RELEASE_DATE "20251130" #define MAIL_VERSION_NUMBER "3.11" #ifdef SNAPSHOT diff --git a/postfix/src/postmulti/Makefile.in b/postfix/src/postmulti/Makefile.in index e9309b984..790d97dc6 100644 --- a/postfix/src/postmulti/Makefile.in +++ b/postfix/src/postmulti/Makefile.in @@ -7,62 +7,78 @@ DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE) CFLAGS = $(DEBUG) $(OPT) $(DEFS) FILES = Makefile $(SRCS) $(HDRS) INC_DIR = ../../include -TESTPROG= +TESTPROG= postmulti_test PROG = postmulti LIBS = ../../lib/lib$(LIB_PREFIX)global$(LIB_SUFFIX) \ ../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX) -LIB_SO = fake_strcmp.so +TESTOBJ = fake_strcmp.o .c.o:; $(CC) $(CFLAGS) -c $*.c $(PROG): $(OBJS) $(LIBS) $(CC) $(CFLAGS) $(SHLIB_RPATH) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) -$(OBJS): ../../conf/makedefs.out +$(TESTPROG): $(OBJS) fake_strcmp.o $(LIBS) + $(CC) $(CFLAGS) $(SHLIB_RPATH) -o $@ $(OBJS) fake_strcmp.o $(LIBS) $(SYSLIBS) + +$(OBJS) $(TESTOBJ): ../../conf/makedefs.out Makefile: Makefile.in cat ../../conf/makedefs.out $? >$@ test: $(TESTPROG) -# Force strcmp(var_config_dir, DEF_CONFIG_DIR) to always succeeed. Outside -# tests, postmulti MUST abort when their values differ. -fake_strcmp.so: fake_strcmp.c - $(CC) $(CFLAGS) -fPIC -shared -o $@ fake_strcmp.c $(LIBS) - -tests: single_test json_tests +tests: single_test json_tests config_dir_test # Single instance, original output format. -single_test: $(PROG) fake_strcmp.so - @echo; echo RUN single_test +single_test: $(TESTPROG) + @echo RUN single_test rm -f main.cf single_test.tmp echo config_directory = . >>main.cf echo command_directory = ../../bin >> main.cf echo daemon_directory = ../../libexec >> main.cf echo meta_directory = . >> main.cf echo shlib_directory = ../../lib >> main.cf + touch -t 197101010000 main.cf printf "%-15s %-15s %-9s %s\n" - - y . >single_test.tmp - $(SHLIB_ENV) ${VALGRIND} LD_PRELOAD=./fake_strcmp.so MAIL_CONFIG=. \ - ./$(PROG) -l | diff single_test.tmp - + $(SHLIB_ENV) ${VALGRIND} MAIL_CONFIG=. \ + ./$(TESTPROG) -l | diff single_test.tmp - rm -f main.cf single_test.tmp - @echo PASS single_test + @echo PASS single_test; echo json_tests: json_single_test # Single instance, JSON output format. -json_single_test: $(PROG) fake_strcmp.so - @echo; echo RUN json_single_test +json_single_test: $(TESTPROG) + @echo RUN json_single_test rm -f main.cf json_single_test.tmp echo config_directory = . >>main.cf echo command_directory = ../../bin >> main.cf echo daemon_directory = ../../libexec >> main.cf echo meta_directory = . >> main.cf echo shlib_directory = ../../lib >> main.cf + touch -t 197101010000 main.cf echo "{\"name\": \"-\",\"group\": \"-\",\"enabled\": \"y\",\"config_directory\": \".\"}" >> json_single_test.tmp - $(SHLIB_ENV) ${VALGRIND} LD_PRELOAD=./fake_strcmp.so MAIL_CONFIG=. \ - ./$(PROG) -lj | diff json_single_test.tmp - + $(SHLIB_ENV) ${VALGRIND} MAIL_CONFIG=. \ + ./$(TESTPROG) -lj | diff json_single_test.tmp - rm -f main.cf json_single_test.tmp - @echo PASS json_single_test + @echo PASS json_single_test; echo + +# Reject non-default config_directory. +config_dir_test: $(PROG) + @echo RUN config_dir_test + rm -f main.cf config_dir_test.tmp + echo config_directory = . >>main.cf + echo command_directory = ../../bin >> main.cf + echo daemon_directory = ../../libexec >> main.cf + echo meta_directory = . >> main.cf + echo shlib_directory = ../../lib >> main.cf + touch -t 197101010000 main.cf + echo "postmulti: fatal: Non-default configuration directory: MAIL_CONFIG=." > config_dir_test.tmp + ($(SHLIB_ENV) ${VALGRIND} MAIL_CONFIG=. ./$(PROG) -l 2>&1 || exit 0) \ + | diff config_dir_test.tmp - + rm -f config_dir_test.tmp + @echo PASS config_dir_test; echo root_tests: @@ -72,7 +88,7 @@ update: ../../bin/$(PROG) cp $(PROG) ../../bin clean: - rm -f *.o *core $(PROG) $(TESTPROG) $(LIB_SO) junk + rm -f *.o *core $(PROG) $(TESTPROG) $(TESTOBJ) *.tmp main.cf junk tidy: clean diff --git a/postfix/src/postmulti/postmulti.c b/postfix/src/postmulti/postmulti.c index 5bd0b27a7..1c737de65 100644 --- a/postfix/src/postmulti/postmulti.c +++ b/postfix/src/postmulti/postmulti.c @@ -1758,8 +1758,7 @@ int main(int argc, char **argv) */ if ((slash = strrchr(argv[0], '/')) != 0 && slash[1]) argv[0] = slash + 1; - if (isatty(STDERR_FILENO)) - msg_vstream_init(argv[0], VSTREAM_ERR); + msg_vstream_init(argv[0], VSTREAM_ERR); maillog_client_init(argv[0], MAILLOG_CLIENT_FLAG_LOGWRITER_FALLBACK); /* diff --git a/postfix/src/util/mac_midna.c b/postfix/src/util/mac_midna.c index ed54118a1..c52d62e61 100644 --- a/postfix/src/util/mac_midna.c +++ b/postfix/src/util/mac_midna.c @@ -83,6 +83,11 @@ static int mac_midna_to_u_label_eval(VSTRING *out, const char *name) /* mac_midna_register - register caller-defined function */ void mac_midna_register(void) { - mac_expand_add_named_fn(NAME_TO_A_LABEL, mac_midna_domain_to_ascii_eval); - mac_expand_add_named_fn(NAME_TO_U_LABEL, mac_midna_to_u_label_eval); + static int first = 1; + + if (first) { + mac_expand_add_named_fn(NAME_TO_A_LABEL, mac_midna_domain_to_ascii_eval); + mac_expand_add_named_fn(NAME_TO_U_LABEL, mac_midna_to_u_label_eval); + first = 0; + } }