From: Wietse Z Venema Date: Mon, 1 Dec 2025 05:00:00 +0000 (-0500) Subject: postfix-3.11-20251201 X-Git-Tag: v3.11.0-RC1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=191f5dfa029ea321479942bda1ad4c4d39e9bacf;p=thirdparty%2Fpostfix.git postfix-3.11-20251201 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 028555426..72d75def5 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -30107,3 +30107,16 @@ Apologies for any names omitted. Testing: test that postmulti(1) will reject a non-default config_directory setting. File: postmulti/Makefile.in. + +20241201 + + Bitrot: C23 unconditionally defines the bool type, breaking + Postfix builds. Solution: migrate from the Postfix bool + type (an int, typically size 4) to C23 bool (size 1). This + is an incompatible change in Postfix library APIs. Fortunately + this change does not affect the database plugin interface. + Files: makedefs, bounce/bounce.c, cleanup/cleanup_init.c, + global/mail_conf.h, global/mail_params.c, global/mail_params.h, + local/local.c, oqmgr/qmgr.c, postconf/extract.awk, qmgr/qmgr.c, + smtp/smtp.c, smtpd/smtpd.c, trivial-rewrite/trivial-rewrite.c, + util/sys_defs.h. diff --git a/postfix/html/makedefs.1.html b/postfix/html/makedefs.1.html index e312a6ba5..05e4f183e 100644 --- a/postfix/html/makedefs.1.html +++ b/postfix/html/makedefs.1.html @@ -128,6 +128,9 @@ MAKEDEFS(1) MAKEDEFS(1) Use sprintf() instead of snprintf(). By default, Postfix uses snprintf() except on ancient systems. + -DNO_STDBOOL + Don't use <stdbool.h>. This is usually auto-detected. + DEBUG=debug_level Specifies a non-default debugging level. The default is -g. Specify DEBUG= to turn off debugging. diff --git a/postfix/makedefs b/postfix/makedefs index 9bd730281..b0e73fc5a 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -107,6 +107,8 @@ # .IP \fB-DNO_SNPRINTF\fR # Use sprintf() instead of snprintf(). By default, Postfix # uses snprintf() except on ancient systems. +# .IP \fB-DNO_STDBOOL\fR +# Don't use . This is usually auto-detected. # .RE # .IP \fBDEBUG=\fIdebug_level\fR # Specifies a non-default debugging level. The default is \fB-g\fR. @@ -960,6 +962,21 @@ case "$CCARGS" in ;; esac +# C23 introduces a new built-in type 'bool' which breaks past Postfix +# practice. Other compilers provide emulation. Don't try to guess where +# the compiler hides . +case "$CCARGS" in + *-DNO_STDBOOL*) ;; + *) cat >makedefs.test.c <<'EOF' +#include +bool x; +EOF + ${CC-gcc} -c makedefs.test.c >/dev/null 2>&1 || + CCARGS="$CCARGS -DNO_STDBOOL" + rm -f makedefs.test.[co] + ;; +esac + # Defaults that can be overruled (make makefiles CC=cc OPT=-O6 DEBUG=) # Disable optimizations by default when compiling for Purify. Disable # optimizations by default with gcc 2.8, until the compiler is known to diff --git a/postfix/man/man1/makedefs.1 b/postfix/man/man1/makedefs.1 index 52b5daea9..b7d904040 100644 --- a/postfix/man/man1/makedefs.1 +++ b/postfix/man/man1/makedefs.1 @@ -110,6 +110,8 @@ appear to work. .IP \fB\-DNO_SNPRINTF\fR Use sprintf() instead of snprintf(). By default, Postfix uses snprintf() except on ancient systems. +.IP \fB\-DNO_STDBOOL\fR +Don't use . This is usually auto\-detected. .RE .IP \fBDEBUG=\fIdebug_level\fR Specifies a non\-default debugging level. The default is \fB\-g\fR. diff --git a/postfix/proto/stop.double-history b/postfix/proto/stop.double-history index cfb9a50c9..6b0405d7d 100644 --- a/postfix/proto/stop.double-history +++ b/postfix/proto/stop.double-history @@ -257,3 +257,7 @@ proto proto REQUIRETLS_README html global mail_params hc and JSON output Files postmulti postmulti c postmulti Makefile in postmulti postmulti c to integrate into test scripts File postmulti postmulti c + local local c oqmgr qmgr c postconf extract awk qmgr qmgr c + makedefs bounce bounce c cleanup cleanup_init c + smtp smtp c smtpd smtpd c trivial rewrite trivial rewrite c + Files makedefs bounce bounce c cleanup cleanup_init c diff --git a/postfix/src/bounce/bounce.c b/postfix/src/bounce/bounce.c index 969db5338..bc201f78e 100644 --- a/postfix/src/bounce/bounce.c +++ b/postfix/src/bounce/bounce.c @@ -228,7 +228,7 @@ char *var_delay_rcpt; char *var_bounce_tmpl; bool var_threaded_bounce; char *var_hfrom_format; /* header_from_format */ -int var_reqtls_redact_dsn; +bool var_reqtls_redact_dsn; /* * We're single threaded, so we can avoid some memory allocation overhead. diff --git a/postfix/src/cleanup/cleanup_init.c b/postfix/src/cleanup/cleanup_init.c index f613944b1..4c2ee9c7d 100644 --- a/postfix/src/cleanup/cleanup_init.c +++ b/postfix/src/cleanup/cleanup_init.c @@ -156,7 +156,7 @@ char *var_rcpt_bcc_maps; /* recipient auto-bcc maps */ char *var_remote_rwr_domain; /* header-only surrogate */ char *var_msg_reject_chars; /* reject these characters */ char *var_msg_strip_chars; /* strip these characters */ -int var_verp_bounce_off; /* don't verp the bounces */ +bool var_verp_bounce_off; /* don't verp the bounces */ int var_milt_conn_time; /* milter connect/handshake timeout */ int var_milt_cmd_time; /* milter command timeout */ int var_milt_msg_time; /* milter content timeout */ @@ -175,13 +175,13 @@ char *var_milt_unk_macros; /* unknown command macros */ char *var_cleanup_milters; /* non-SMTP mail */ char *var_milt_head_checks; /* post-Milter header checks */ char *var_milt_macro_deflts; /* default macro settings */ -int var_auto_8bit_enc_hdr; /* auto-detect 8bit encoding header */ -int var_always_add_hdrs; /* always add missing headers */ +bool var_auto_8bit_enc_hdr; /* auto-detect 8bit encoding header */ +bool var_always_add_hdrs; /* always add missing headers */ int var_virt_addrlen_limit; /* stop exponential growth */ char *var_hfrom_format; /* header_from_format */ char *var_full_name_encoding_charset; /* in =?charset?encoding?gibberish=? */ -int var_force_mime_iconv; /* force mime downgrade on input */ -int var_cleanup_mask_stray_cr_lf; /* replace stray CR or LF with space */ +bool var_force_mime_iconv; /* force mime downgrade on input */ +bool var_cleanup_mask_stray_cr_lf; /* replace stray CR or LF with space */ char *var_non_empty_eoh_action; /* handle non-empty header terminator */ bool var_reqtls_esmtp_hdr; diff --git a/postfix/src/global/mail_conf.h b/postfix/src/global/mail_conf.h index 9c3d2fe52..6a9976890 100644 --- a/postfix/src/global/mail_conf.h +++ b/postfix/src/global/mail_conf.h @@ -131,8 +131,8 @@ typedef struct { typedef struct { const char *name; /* config variable name */ - int defval; /* default value */ - int *target; /* pointer to global variable */ + bool defval; /* default value */ + bool *target; /* pointer to global variable */ } CONFIG_BOOL_TABLE; typedef struct { @@ -154,7 +154,7 @@ typedef struct { typedef struct { const char *name; /* config variable name */ const char *defval; /* default value */ - int *target; /* pointer to global variable */ + bool *target; /* pointer to global variable */ } CONFIG_NBOOL_TABLE; extern void get_mail_conf_str_table(const CONFIG_STR_TABLE *); diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index cee69696e..cafd74092 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -259,7 +259,7 @@ char *var_relayhost; char *var_transit_origin; char *var_transit_dest; char *var_mail_name; -int var_helpful_warnings; +bool var_helpful_warnings; char *var_syslog_name; char *var_mail_owner; uid_t var_owner_uid; @@ -308,10 +308,10 @@ int var_fork_delay; int var_flock_tries; int var_flock_delay; int var_flock_stale; -int var_disable_dns; -int var_soft_bounce; +bool var_disable_dns; +bool var_soft_bounce; time_t var_starttime; -int var_ownreq_special; +bool var_ownreq_special; int var_daemon_timeout; char *var_syslog_facility; char *var_relay_domains; @@ -350,18 +350,18 @@ int var_mime_maxdepth; int var_mime_bound_len; int var_header_limit; int var_token_limit; -int var_disable_mime_input; -int var_disable_mime_oconv; -int var_strict_8bitmime; -int var_strict_7bit_hdrs; -int var_strict_8bit_body; -int var_strict_encoding; -int var_verify_neg_cache; -int var_oldlog_compat; +bool var_disable_mime_input; +bool var_disable_mime_oconv; +bool var_strict_8bitmime; +bool var_strict_7bit_hdrs; +bool var_strict_8bit_body; +bool var_strict_encoding; +bool var_verify_neg_cache; +bool var_oldlog_compat; int var_delay_max_res; int var_sockmap_max_reply; char *var_int_filt_classes; -int var_cyrus_sasl_authzid; +bool var_cyrus_sasl_authzid; char *var_multi_conf_dirs; char *var_multi_wrapper; @@ -372,12 +372,12 @@ bool var_long_queue_ids; bool var_daemon_open_fatal; bool var_dns_ncache_ttl_fix; char *var_dsn_filter; -int var_smtputf8_enable; -int var_strict_smtputf8; +bool var_smtputf8_enable; +bool var_strict_smtputf8; char *var_smtputf8_autoclass; -int var_reqtls_enable; -int var_tls_required_enable; -int var_idna2003_compat; +bool var_reqtls_enable; +bool var_tls_required_enable; +bool var_idna2003_compat; char *var_compatibility_level; char *var_drop_hdrs; char *var_info_log_addr_form; diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 471c4a558..3acf281bd 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -12,10 +12,8 @@ /* .nf /* - * This is to make it easier to auto-generate tables. + * Needed for version-dependent default settings. */ -typedef int bool; - #ifdef USE_TLS #include /* OPENSSL_VERSION_NUMBER */ #include /* SN_* and NID_* macros */ @@ -822,7 +820,7 @@ extern int var_delay_warn_time; #define VAR_DSN_DELAY_CLEARED "confirm_delay_cleared" #define DEF_DSN_DELAY_CLEARED 0 -extern int var_dsn_delay_cleared; +extern bool var_dsn_delay_cleared; /* * Queue manager: various in-core message and recipient limits. @@ -1147,7 +1145,7 @@ extern int var_smtp_quit_tmout; #define DEF_SMTP_QUOTE_821_ENV 1 #define VAR_LMTP_QUOTE_821_ENV "lmtp_quote_rfc821_envelope" #define DEF_LMTP_QUOTE_821_ENV 1 -extern int var_smtp_quote_821_env; +extern bool var_smtp_quote_821_env; #define VAR_SMTP_SKIP_5XX "smtp_skip_5xx_greeting" #define DEF_SMTP_SKIP_5XX 1 @@ -1919,7 +1917,7 @@ extern bool var_lmtp_dummy_mail_auth; #define VAR_CYRUS_SASL_AUTHZID "send_cyrus_sasl_authzid" #define DEF_CYRUS_SASL_AUTHZID 0 -extern int var_cyrus_sasl_authzid; +extern bool var_cyrus_sasl_authzid; /* * Special handling of AUTH 535 failures. @@ -2125,7 +2123,7 @@ extern int var_flock_stale; #define VAR_MAILTOOL_COMPAT "sun_mailtool_compatibility" #define DEF_MAILTOOL_COMPAT 0 -extern int var_mailtool_compat; +extern bool var_mailtool_compat; /* * How long a daemon command may take to receive or deliver a message etc. @@ -2468,7 +2466,7 @@ extern char *var_maps_rbl_domains; #define VAR_SMTPD_DELAY_REJECT "smtpd_delay_reject" #define DEF_SMTPD_DELAY_REJECT 1 -extern int var_smtpd_delay_reject; +extern bool var_smtpd_delay_reject; #define REJECT_UNAUTH_PIPE "reject_unauth_pipelining" @@ -2620,7 +2618,7 @@ extern int var_pid; */ #define VAR_DONT_REMOVE "dont_remove" #define DEF_DONT_REMOVE 0 -extern bool var_dont_remove; +extern int var_dont_remove; /* * Paranoia: defer messages instead of bouncing them. @@ -3146,7 +3144,7 @@ extern bool var_strict_encoding; #define VAR_AUTO_8BIT_ENC_HDR "detect_8bit_encoding_header" #define DEF_AUTO_8BIT_ENC_HDR 1 -extern int var_auto_8bit_enc_hdr; +extern bool var_auto_8bit_enc_hdr; /* * Bizarre. @@ -4368,7 +4366,7 @@ extern char *var_smtpd_dns_re_filter; #define VAR_CLEANUP_MASK_STRAY_CR_LF "cleanup_replace_stray_cr_lf" #define DEF_CLEANUP_MASK_STRAY_CR_LF 1 -extern int var_cleanup_mask_stray_cr_lf; +extern bool var_cleanup_mask_stray_cr_lf; /* * Share TLS sessions through tlsproxy(8). @@ -4409,11 +4407,11 @@ extern char *var_meta_dir; #define DEF_SMTPUTF8_ENABLE "${{$compatibility_level} +#else +typedef int bool; +#endif + /* LICENSE /* .ad /* .fi