]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3.15 v2.3.15
authorWietse Venema <wietse@porcupine.org>
Thu, 14 Aug 2008 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 21:08:39 +0000 (16:08 -0500)
postfix/HISTORY
postfix/src/bounce/bounce_template.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd_check.c
postfix/src/util/match_ops.c
postfix/src/util/safe_open.c
postfix/src/util/vstring.c

index eea5f97ec82336f3b60039c1b9e578eb1892714c..48ff0d9ae541541d6d866c664759e534869d601a 100644 (file)
@@ -13124,3 +13124,52 @@ Apologies for any names omitted.
        Workaround: minor change to the Dovecot AUTH request to
        prevent dovecot-auth memory wastage. Timo Sirainen.  File:
        xsasl/xsasl_dovecot_server.c.
+
+20080228
+
+       Bugfix: bounce(8) segfault on one-line template text.
+       Problem found by Sacha Chlytor. File: bounce/bounce_template.c.
+
+20080411
+
+       Bugfix (introduced Postfix 2.0): after "warn_if_reject
+       reject_unlisted_recipient/sender", the SMTP server mistakenly
+       remembered that recipient/sender validation was already
+       done. File: smtpd/smtpd_check.c.
+
+20080428
+
+       Cleanup: the proxy_read_maps (Postfix 2.0) default setting
+       was not updated when adding sender/recipient_bcc_maps
+       (Postfix 2.1) and smtp/lmtp_generic_maps (Postfix 2.3).
+       File: global/mail_params.h.
+
+20080509
+
+       Bugfix: null-terminate CN comment string after sanitization.
+       File: smtpd/smtpd.c.
+
+20080603
+
+       Workaround: avoid "bad address pattern" errors with non-address
+       patterns in namadr_list_match() calls. File: util/match_ops.c.
+
+20080804
+
+       Bugfix: dangling pointer in vstring_sprintf_prepend().
+       File: util/vstring.c.
+
+20080814
+
+       Security: some systems have changed their link() semantics,
+       and will hardlink a symlink, contrary to POSIX and XPG4.
+       Sebastian Krahmer, SuSE. File: util/safe_open.c.
+
+       The solution introduces the following incompatible change:
+       when the target of mail delivery is a symlink, the parent
+       directory of that symlink must now be writable by root only
+       (in addition to the already existing requirement that the
+       symlink itself is owned by root).  This change will break
+       legitimate configurations that deliver mail to a symbolic
+       link in a directory with less restrictive permissions.
+
index 23f16b0a3d1474e897bd020d6836ce1233408435..36384a6f19c9750ca2611a033f4c1a6340fae004 100644 (file)
@@ -343,7 +343,7 @@ static void bounce_template_parse_buffer(BOUNCE_TEMPLATE *tp)
      * Is this 7bit or 8bit text? If the character set is US-ASCII, then
      * don't allow 8bit text. Don't assume 8bit when charset was changed.
      */
-#define NON_ASCII(p) (*(p) && !allascii((p)))
+#define NON_ASCII(p) ((p) && *(p) && !allascii((p)))
 
     if (NON_ASCII(cp) || NON_ASCII(tval)) {
        if (strcasecmp(tp->mime_charset, "us-ascii") == 0) {
index a940e1ec70fc101880e6f2a32b363988a50c2439..d078912e800f8351071fbc096d54d1dc3e5c0058 100644 (file)
@@ -1966,7 +1966,11 @@ extern int var_local_rcpt_code;
                                " $" VAR_RCPT_CANON_MAPS \
                                " $" VAR_RELOCATED_MAPS \
                                " $" VAR_TRANSPORT_MAPS \
-                               " $" VAR_MYNETWORKS
+                               " $" VAR_MYNETWORKS \
+                               " $" VAR_SEND_BCC_MAPS \
+                               " $" VAR_RCPT_BCC_MAPS \
+                               " $" VAR_SMTP_GENERIC_MAPS \
+                               " $" VAR_LMTP_GENERIC_MAPS
 extern char *var_proxy_read_maps;
 
  /*
index fe691c943a7394fdc37ed71bcdf07ef974492275..23adc69f65460e7ca1843b3eb5274a0aa4bad1a1 100644 (file)
@@ -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      "20080131"
-#define MAIL_VERSION_NUMBER    "2.3.14"
+#define MAIL_RELEASE_DATE      "20080814"
+#define MAIL_VERSION_NUMBER    "2.3.15"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index 7713fcac5b27f25a82fbf47361825e5bc5b6093c..b877567e468136a9ac10d9cd966fc1a418a11bc8 100644 (file)
@@ -2421,6 +2421,7 @@ static void comment_sanitize(VSTRING *comment_string)
     }
     while (pc-- > 0)
        VSTRING_ADDCH(comment_string, ')');
+    VSTRING_TERMINATE(comment_string);
 }
 
 /* data_cmd - process DATA command */
index 92191437e7cc58ff11e57d773f40a73a3f90a8a5..be7f6a346c135b856180cd2ebebe8582a8319421 100644 (file)
@@ -4277,7 +4277,9 @@ static int check_recipient_rcpt_maps(SMTPD_STATE *state, const char *recipient)
        return (0);
     if (state->recipient_rcptmap_checked == 1)
        return (0);
-    state->recipient_rcptmap_checked = 1;
+    if (state->warn_if_reject == 0)
+       /* We really validate the recipient address. */
+       state->recipient_rcptmap_checked = 1;
     return (check_rcpt_maps(state, recipient, SMTPD_NAME_RECIPIENT));
 }
 
index 41c069394d4d4eb8f431ab11454656aa92823b41..5832266b1f7dca3ecc08b37aced62f4a4933f400 100644 (file)
@@ -234,12 +234,20 @@ int     match_hostaddr(int unused_flags, const char *addr, const char *pattern)
      * Postfix; if not, then Postfix has no business dealing with IPv4
      * addresses anyway.
      * 
-     * - Don't bother if the pattern is a bare IPv4 address. That form would
-     * have been matched with the strcasecmp() call above.
+     * - Don't bother unless the pattern is either an IPv6 address or net/mask.
      * 
-     * - Don't bother if the pattern isn't an address or address/mask.
+     * We can safely skip IPv4 address patterns because their form is
+     * unambiguous and they did not match in the strcasecmp() calls above.
+     * 
+     * XXX We MUST skip (parent) domain names, which may appear in NAMADR_LIST
+     * input, to avoid triggering false cidr_match_parse() errors.
+     * 
+     * The last two conditions below are for backwards compatibility with
+     * earlier Postfix versions: don't abort with fatal errors on junk that
+     * was silently ignored (principle of least astonishment).
      */
     if (!strchr(addr, ':') != !strchr(pattern, ':')
+       || pattern[strcspn(pattern, ":/")] == 0
        || pattern[strspn(pattern, V4_ADDR_STRING_CHARS)] == 0
        || pattern[strspn(pattern, V6_ADDR_STRING_CHARS "[]/")] != 0)
        return (0);
index c825493caad28a0a98f49009a9ba051270b7a9a4..9cf5d0263033e17f28a30f36965d9186b49d0461 100644 (file)
@@ -83,6 +83,7 @@
 #include <msg.h>
 #include <vstream.h>
 #include <vstring.h>
+#include <stringops.h>
 #include <safe_open.h>
 
 /* safe_open_exist - open existing file */
@@ -138,13 +139,29 @@ static VSTREAM *safe_open_exist(const char *path, int flags,
      * for symlinks owned by root. NEVER, NEVER, make exceptions for symlinks
      * owned by a non-root user. This would open a security hole when
      * delivering mail to a world-writable mailbox directory.
+     * 
+     * Sebastian Krahmer of SuSE brought to my attention that some systems have
+     * changed their semantics of link(symlink, newpath), such that the
+     * result is a hardlink to the symlink. For this reason, we now also
+     * require that the symlink's parent directory is writable only by root.
      */
     else if (lstat(path, &lstat_st) < 0) {
        vstring_sprintf(why, "file status changed unexpectedly: %m");
        errno = EPERM;
     } else if (S_ISLNK(lstat_st.st_mode)) {
-       if (lstat_st.st_uid == 0)
-           return (fp);
+       if (lstat_st.st_uid == 0) {
+           VSTRING *parent_buf = vstring_alloc(100);
+           const char *parent_path = sane_dirname(parent_buf, path);
+           struct stat parent_st;
+           int     parent_ok;
+
+           parent_ok = (stat(parent_path, &parent_st) == 0     /* not lstat */
+                        && parent_st.st_uid == 0
+                        && (parent_st.st_mode & (S_IWGRP | S_IWOTH)) == 0);
+           vstring_free(parent_buf);
+           if (parent_ok)
+               return (fp);
+       }
        vstring_sprintf(why, "file is a symbolic link");
        errno = EPERM;
     } else if (fstat_st->st_dev != lstat_st.st_dev
index df65a69bca62e7e06b7b2c558c595f59218f2a6d..2a32343970cd890f134206c7760ed9041bffc119 100644 (file)
@@ -624,6 +624,7 @@ VSTRING *vstring_sprintf_prepend(VSTRING *vp, const char *format,...)
     result_len = VSTRING_LEN(vp);
 
     /* Construct: old|new|old|free */
+    VSTRING_SPACE(vp, old_len);
     vstring_memcat(vp, vstring_str(vp), old_len);
 
     /* Construct: new|old|free */