]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.11-20250801
authorWietse Z Venema <wietse@porcupine.org>
Fri, 1 Aug 2025 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Sat, 2 Aug 2025 00:53:26 +0000 (10:53 +1000)
postfix/HISTORY
postfix/proto/stop.double-history
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/tlsproxy/tlsproxy.c
postfix/src/tlsproxy/tlsproxy_state.c

index db6dfb59c6e8d06e86ff5eea306245df9d77b36f..1982d6e69ad15c0c61f9e6cdff677d23d4e66759 100644 (file)
@@ -29511,3 +29511,22 @@ Apologies for any names omitted.
        conf/postfix-tls-script, discard/discard.c, error/error.c,
        oqmgr/qmgr.c, postmulti/postmulti.c, qmgr/qmgr.c,
        virtual/virtual.c.
+
+20250801
+
+       Bugfix (defect introduced: Postfix 3.7): incorrect backwards
+       compatible support for the legacy configuration parameters
+       tlsproxy_client_level and tlsproxy_client_policy. This
+       disabled the tlsproxy TLS client role when a legacy parameter
+       was set. Reported by John Doe, diagnosed by Viktor Dukhovni.
+       File: global/mail_params.h.
+
+       Bugfix (defect introduced: Postfix 3.4): with the TLS client
+       role disabled by configuration, the tlsproxy daemon
+       dereferenced a null pointer while handling a tlsproxy client
+       request. Reported by John Doe. File: tlsproxy/tlsproxy.c.
+
+       Bugfix (defect introduced: 20250713): the import_environment
+       change did not have space between POSTLOG_HOSTNAME and
+       XDG_RUNTIME_DIR, breaking maillog_file support and graphical
+       debugging. File: global/mail_params.h.
index 4b800e3ab60a38a682192650ccb11b950389d088..0bf01b7ed73bd846147344b011118b08f4c054d5 100644 (file)
@@ -193,3 +193,4 @@ proto  proto COMPATIBILITY_README html
  oqmgr qmgr c postmulti postmulti c qmgr qmgr c 
  src global config_known_tcp_ports c postmulti postmulti c 
  virtual virtual c 
+ request Reported by John Doe File tlsproxy tlsproxy c 
index cf7d791ead22e7dd81288d95f68acc9adb94d796..275116ff259d324223634644523d84c902990e8c 100644 (file)
@@ -2663,7 +2663,7 @@ extern int var_fflush_refresh;
 #define VAR_IMPORT_ENVIRON             "import_environment"
 #define DEF_IMPORT_ENVIRON             "MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG " \
                                        "TZ XAUTHORITY DISPLAY LANG=C " \
-                                       "POSTLOG_SERVICE POSTLOG_HOSTNAME" \
+                                       "POSTLOG_SERVICE POSTLOG_HOSTNAME " \
                                        "XDG_RUNTIME_DIR"
 extern char *var_import_environ;
 
@@ -4192,7 +4192,9 @@ extern bool var_tlsp_clnt_enforce_tls;
 /* Migrate an incorrect name. */
 #define OBS_TLSP_CLNT_LEVEL            "tlsproxy_client_level"
 #define VAR_TLSP_CLNT_LEVEL            "tlsproxy_client_security_level"
-#define DEF_TLSP_CLNT_LEVEL            "${" OBS_TLSP_CLNT_LEVEL ":$" VAR_SMTP_TLS_LEVEL "}"
+#define DEF_TLSP_CLNT_LEVEL            "${" OBS_TLSP_CLNT_LEVEL "?{$" \
+                                       OBS_TLSP_CLNT_LEVEL "}:{$" \
+                                       VAR_SMTP_TLS_LEVEL "}}"
 extern char *var_tlsp_clnt_level;
 
 #define VAR_TLSP_CLNT_PER_SITE         "tlsproxy_client_per_site"
@@ -4202,7 +4204,9 @@ extern char *var_tlsp_clnt_per_site;
 /* Migrate an incorrect name. */
 #define OBS_TLSP_CLNT_POLICY           "tlsproxy_client_policy"
 #define VAR_TLSP_CLNT_POLICY           "tlsproxy_client_policy_maps"
-#define DEF_TLSP_CLNT_POLICY           "${" OBS_TLSP_CLNT_POLICY ":$" VAR_SMTP_TLS_POLICY "}"
+#define DEF_TLSP_CLNT_POLICY           "${" OBS_TLSP_CLNT_POLICY "?{$" \
+                                       OBS_TLSP_CLNT_POLICY "}:{$" \
+                                       VAR_SMTP_TLS_POLICY "}}"
 extern char *var_tlsp_clnt_policy;
 
  /*
index 56b86a41497ae7da343ecf90acc618cff5eaf721..6be51952302ff869afafaddb08e847f17e6104a4 100644 (file)
@@ -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      "20250730"
+#define MAIL_RELEASE_DATE      "20250801"
 #define MAIL_VERSION_NUMBER    "3.11"
 
 #ifdef SNAPSHOT
index 241f8e72d744de10b03c4cac88707411cd15f531..5eb6027cea09b3a0f42324b2d64647f0192fbd32 100644 (file)
@@ -1267,6 +1267,12 @@ static TLS_APPL_STATE *tlsp_client_init(TLS_CLIENT_PARAMS *tls_params,
     init_buf = vstring_alloc(100);
     init_key = tls_proxy_client_init_serialize(attr_print_plain, init_buf,
                                               init_props);
+#define TLSP_CLIENT_INIT_RETURN(retval) do { \
+       vstring_free(init_buf); \
+       vstring_free(param_buf); \
+       return (retval); \
+    } while (0)
+
     if (tlsp_pre_jail_done == 0) {
        if (tlsp_pre_jail_client_param_key == 0
            || tlsp_pre_jail_client_init_key == 0) {
@@ -1284,9 +1290,12 @@ static TLS_APPL_STATE *tlsp_client_init(TLS_CLIENT_PARAMS *tls_params,
      * TLS_APPL_STATE instance; this makes a mismatch of TLS_CLIENT_PARAMS
      * settings problematic.
      */
-    if (tlsp_pre_jail_done
-       && !been_here_fixed(tlsp_params_mismatch_filter, param_key)
-       && strcmp(tlsp_pre_jail_client_param_key, param_key) != 0) {
+    else if (tlsp_pre_jail_client_param_key == 0
+            || tlsp_pre_jail_client_init_key == 0) {
+       msg_warn("TLS client role is disabled by configuration");
+       TLSP_CLIENT_INIT_RETURN(0);
+    } else if (!been_here_fixed(tlsp_params_mismatch_filter, param_key)
+              && strcmp(tlsp_pre_jail_client_param_key, param_key) != 0) {
        msg_warn("request from tlsproxy client with unexpected settings");
        tlsp_log_config_diff(tlsp_pre_jail_client_param_key, param_key);
        log_hints = 1;
@@ -1361,9 +1370,7 @@ static TLS_APPL_STATE *tlsp_client_init(TLS_CLIENT_PARAMS *tls_params,
                         SSL_MODE_ENABLE_PARTIAL_WRITE
                         | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
     }
-    vstring_free(init_buf);
-    vstring_free(param_buf);
-    return (appl_state);
+    TLSP_CLIENT_INIT_RETURN(appl_state);
 }
 
 /* tlsp_close_event - pre-handshake plaintext-client close event */
@@ -1497,6 +1504,7 @@ static void tlsp_get_request_event(int event, void *context)
                                TLSP_INIT_TIMEOUT, (void *) state);
        return;
     } else {
+       state->flags |= TLSP_FLAG_DO_HANDSHAKE;
        tlsp_request_read_event(plaintext_fd, tlsp_get_fd_event,
                                TLSP_INIT_TIMEOUT, (void *) state);
        return;
index df6cbda1de0dd4b4c367cc55df665f87813c8db9..4a08d17fedd2016be9d5d59f3760c44709611e9a 100644 (file)
@@ -105,7 +105,7 @@ TLSP_STATE *tlsp_state_create(const char *service,
 {
     TLSP_STATE *state = (TLSP_STATE *) mymalloc(sizeof(*state));
 
-    state->flags = TLSP_FLAG_DO_HANDSHAKE;
+    state->flags = 0;
     state->service = mystrdup(service);
     state->plaintext_stream = plaintext_stream;
     state->plaintext_buf = 0;