From: Wietse Venema Date: Mon, 23 Apr 2007 05:00:00 +0000 (-0500) Subject: postfix-2.3.9 X-Git-Tag: v2.3.9^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9adf909df6a9e0479b9830da9fef888886636534;p=thirdparty%2Fpostfix.git postfix-2.3.9 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index b223ac052..dbebff361 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -12961,3 +12961,28 @@ Apologies for any names omitted. Duchovni, Morgan Stanley. Files: src/smtp/smtp_proto.c, src/smtpd/smtpd.c, src/tls/tls.h, src/tls/tls_client.c, src/tls/tls_misc.c and src/tls/tls_server.c. + +20070306 + + Workaround: on some FreeBSD versions, accept(2) can fail + with a bogus EINVAL error. We now allow accept(2) to fail + for a limited number of times before terminating the process. + Files: master/single_server.c, master/multi_server.c. + Back-ported from Postfix 2.4. + + Bugfix (introduced with Postfix 2.3 Milter support): postdrop + reported "illegal seek" instead of "file too large". File: + postdrop/postdrop.c. Back-ported from Postfix 2.4. + +20070331 + + Bugfix (introduced Postfix 2.3): segfault with HOLD action + in access/header_checks/body_checks on 64-bit platforms. + File: cleanup/cleanup_api.c. Back-ported from Postfix 2.4. + +20070421 + + Workaround: on (Linux) platforms that cripple signal handlers + with deadlock, "postfix stop" forcefully stops all processes + in the master's process group. Files: conf/postfix-script, + master/master_sig.c. Back-ported from Postfix 2.4. diff --git a/postfix/conf/postfix-script b/postfix/conf/postfix-script index c7251105f..e5a516918 100644 --- a/postfix/conf/postfix-script +++ b/postfix/conf/postfix-script @@ -129,6 +129,15 @@ stop) } $INFO stopping the Postfix mail system kill `sed 1q pid/master.pid` + for i in 5 4 3 2 1 + do + $daemon_directory/master -t && exit 0 + $INFO waiting for the Postfix mail system to terminate + sleep 1 + done + $WARN stopping the Postfix mail system with force + pid=`awk '{ print $1; exit 0 } END { exit 1 }' pid/master.pid` && + kill -9 -$pid ;; abort) diff --git a/postfix/src/cleanup/cleanup_api.c b/postfix/src/cleanup/cleanup_api.c index 4769289b8..88bf17e4e 100644 --- a/postfix/src/cleanup/cleanup_api.c +++ b/postfix/src/cleanup/cleanup_api.c @@ -289,8 +289,8 @@ int cleanup_flush(CLEANUP_STATE *state) #endif mail_stream_ctl(state->handle, MAIL_STREAM_CTL_QUEUE, state->queue_name, - MAIL_STREAM_CTL_CLASS, 0, - MAIL_STREAM_CTL_SERVICE, 0, + MAIL_STREAM_CTL_CLASS, (char *) 0, + MAIL_STREAM_CTL_SERVICE, (char *) 0, #ifdef DELAY_ACTION MAIL_STREAM_CTL_DELAY, state->defer_delay, #endif diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index e23209e83..50054d400 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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 "20070301" -#define MAIL_VERSION_NUMBER "2.3.8" +#define MAIL_RELEASE_DATE "20070423" +#define MAIL_VERSION_NUMBER "2.3.9" #ifdef SNAPSHOT # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff --git a/postfix/src/master/master_sig.c b/postfix/src/master/master_sig.c index fc76efe0d..a8890b1ce 100644 --- a/postfix/src/master/master_sig.c +++ b/postfix/src/master/master_sig.c @@ -172,13 +172,6 @@ static void master_sigdeath(int sig) struct sigaction action; pid_t pid = getpid(); - /* - * XXX We're running from a signal handler, and really should not call - * any msg() routines at all, but it would be even worse to silently - * terminate without informing the sysadmin. - */ - msg_info("terminating on signal %d", sig); - /* * Terminate all processes in our process group, except ourselves. */ @@ -190,6 +183,13 @@ static void master_sigdeath(int sig) if (kill(-pid, SIGTERM) < 0) msg_fatal("%s: kill process group: %m", myname); + /* + * XXX We're running from a signal handler, and really should not call + * any msg() routines at all, but it would be even worse to silently + * terminate without informing the sysadmin. + */ + msg_info("terminating on signal %d", sig); + /* * Deliver the signal to ourselves and clean up. XXX We're running as a * signal handler and really should not be doing complicated things... diff --git a/postfix/src/master/multi_server.c b/postfix/src/master/multi_server.c index 1330b23e6..25d3f339f 100644 --- a/postfix/src/master/multi_server.c +++ b/postfix/src/master/multi_server.c @@ -372,7 +372,7 @@ static void multi_server_accept_local(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(multi_server_timeout, (char *) 0, time_left); return; @@ -409,7 +409,7 @@ static void multi_server_accept_pass(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(multi_server_timeout, (char *) 0, time_left); return; @@ -446,7 +446,7 @@ static void multi_server_accept_inet(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(multi_server_timeout, (char *) 0, time_left); return; diff --git a/postfix/src/master/single_server.c b/postfix/src/master/single_server.c index 82fec73d1..f0675f7eb 100644 --- a/postfix/src/master/single_server.c +++ b/postfix/src/master/single_server.c @@ -290,7 +290,7 @@ static void single_server_accept_local(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(single_server_timeout, (char *) 0, time_left); return; @@ -326,7 +326,7 @@ static void single_server_accept_pass(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(single_server_timeout, (char *) 0, time_left); return; @@ -362,7 +362,7 @@ static void single_server_accept_inet(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(single_server_timeout, (char *) 0, time_left); return; diff --git a/postfix/src/master/trigger_server.c b/postfix/src/master/trigger_server.c index bdf042d61..082f8bcc5 100644 --- a/postfix/src/master/trigger_server.c +++ b/postfix/src/master/trigger_server.c @@ -313,7 +313,7 @@ static void trigger_server_accept_local(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(trigger_server_timeout, (char *) 0, time_left); return; @@ -359,7 +359,7 @@ static void trigger_server_accept_pass(int unused_event, char *context) msg_fatal("select unlock: %m"); if (fd < 0) { if (errno != EAGAIN) - msg_fatal("accept connection: %m"); + msg_error("accept connection: %m"); if (time_left >= 0) event_request_timer(trigger_server_timeout, (char *) 0, time_left); return; diff --git a/postfix/src/postdrop/postdrop.c b/postfix/src/postdrop/postdrop.c index aa064c828..ad01f14df 100644 --- a/postfix/src/postdrop/postdrop.c +++ b/postfix/src/postdrop/postdrop.c @@ -229,6 +229,7 @@ int main(int argc, char **argv) const char *errstr; char *junk; struct timeval start; + int saved_errno; /* * Be consistent with file permissions. @@ -425,9 +426,12 @@ int main(int argc, char **argv) continue; } if (REC_PUT_BUF(dst->stream, rec_type, buf) < 0) { - while ((rec_type = rec_get(VSTREAM_IN, buf, var_line_limit)) > 0 - && rec_type != REC_TYPE_END) + /* rec_get() errors must not clobber errno. */ + saved_errno = errno; + while (rec_get_raw(VSTREAM_IN, buf, var_line_limit, + REC_FLAG_NONE) > 0) /* void */ ; + errno = saved_errno; break; } if (rec_type == REC_TYPE_END) @@ -439,8 +443,8 @@ int main(int argc, char **argv) * Finish the file. */ if ((status = mail_stream_finish(dst, (VSTRING *) 0)) != 0) { - postdrop_cleanup(); msg_warn("uid=%ld: %m", (long) uid); + postdrop_cleanup(); } /*