]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4.11 v2.4.11
authorWietse Venema <wietse@porcupine.org>
Mon, 11 May 2009 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 20:20:43 +0000 (15:20 -0500)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/postdrop/postdrop.c
postfix/src/postsuper/postsuper.c

index 55b3c66dcbc2be9ddefa44926e86e7268801f0b1..c9040781397d44d4978f4ee16b5a48c7cd6f0983 100644 (file)
@@ -13663,3 +13663,14 @@ Apologies for any names omitted.
        Cleanup: adjust the VSTREAM buffer strategy when reusing
        an SMTP connection with a large TCP MSS value. File:
        smtp/smtp_reuse.c.
+
+20090419
+
+       Bugfix: don't re-enable SIGHUP if it is ignored in the
+       parent. This may cause random "Postfix integrity check
+       failed" errors at boot time (POSIX SIGHUP death), causing
+       Postfix not to start. We duplicate code from postdrop and
+       thus avoid past mistakes.  File: postsuper/postsuper.c.
+
+       Robustness: don't re-enable SIGTERM if it is ignored in the
+       parent. Files: postsuper/postsuper.c, postdrop/postdrop.c.
index 281bda442ae076108f67c556b35d13d06f3775be..4a79c60bd2ac8a55f861285602c3aa1704f709cf 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      "20090103"
-#define MAIL_VERSION_NUMBER    "2.4.10"
+#define MAIL_RELEASE_DATE      "20090511"
+#define MAIL_VERSION_NUMBER    "2.4.11"
 
 #ifdef SNAPSHOT
 # define MAIL_VERSION_DATE     "-" MAIL_RELEASE_DATE
index 92170708fe59f4442d32db923f99ec00872d6b76..4a0e073cfd9cb210a85edabc9368f083844dce60 100644 (file)
@@ -340,7 +340,8 @@ int     main(int argc, char **argv)
 
     signal(SIGINT, postdrop_sig);
     signal(SIGQUIT, postdrop_sig);
-    signal(SIGTERM, postdrop_sig);
+    if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
+       signal(SIGTERM, postdrop_sig);
     if (signal(SIGHUP, SIG_IGN) == SIG_DFL)
        signal(SIGHUP, postdrop_sig);
     msg_cleanup(postdrop_cleanup);
index 65172d08a639a1222e8da4c2a779716996e49db2..c4425e6deffa41de3e90caa265781497ba447c79 100644 (file)
@@ -968,11 +968,17 @@ static void interrupted(int sig)
     /*
      * This commands requires root privileges. We therefore do not worry
      * about hostile signals, and report problems via msg_warn().
+     * 
+     * We use the in-kernel SIGINT handler address as an atomic variable to
+     * prevent nested interrupted() calls. For this reason, main() must
+     * configure interrupted() as SIGINT handler before other signal handlers
+     * are allowed to invoke interrupted(). See also similar code in
+     * postdrop.
      */
-    if (signal(SIGHUP, SIG_IGN) != SIG_IGN) {
-       (void) signal(SIGINT, SIG_IGN);
+    if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
        (void) signal(SIGQUIT, SIG_IGN);
        (void) signal(SIGTERM, SIG_IGN);
+       (void) signal(SIGHUP, SIG_IGN);
        if (inode_mismatch > 0 || inode_fixed > 0 || position_mismatch > 0)
            msg_warn("OPERATION INCOMPLETE -- RERUN COMMAND TO FIX THE QUEUE FIRST");
        if (sig)
@@ -1169,11 +1175,20 @@ int     main(int argc, char **argv)
      * 
      * Set up signal handlers after permanently dropping super-user privileges,
      * so that signal handlers will always run with the correct privileges.
+     * 
+     * XXX Don't enable SIGHUP or SIGTERM if it was ignored by the parent.
+     * 
+     * interrupted() uses the in-kernel SIGINT handler address as an atomic
+     * variable to prevent nested interrupted() calls. For this reason, the
+     * SIGINT handler must be configured before other signal handlers are
+     * allowed to invoke interrupted(). See also similar code in postdrop.
      */
-    signal(SIGHUP, interrupted);
     signal(SIGINT, interrupted);
     signal(SIGQUIT, interrupted);
-    signal(SIGTERM, interrupted);
+    if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
+       signal(SIGTERM, interrupted);
+    if (signal(SIGHUP, SIG_IGN) == SIG_DFL)
+       signal(SIGHUP, interrupted);
     msg_cleanup(fatal_warning);
 
     /*