diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2012-12-29 20:30:46 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2012-12-29 20:30:46 +0000 |
commit | 840d2bbbfce5c06cdb4e10ce26107aa98d13e700 (patch) | |
tree | 1e7560ff85bedb732a3f654dd9ad287affaac140 /contrib/sendmail/libmilter | |
parent | 896fc63862ccf01e4da5831d63296c6c274972a0 (diff) | |
download | FreeBSD-src-840d2bbbfce5c06cdb4e10ce26107aa98d13e700.zip FreeBSD-src-840d2bbbfce5c06cdb4e10ce26107aa98d13e700.tar.gz |
Merge sendmail 8.14.6 to HEAD
MFC after: 4 days
Diffstat (limited to 'contrib/sendmail/libmilter')
-rw-r--r-- | contrib/sendmail/libmilter/Makefile.m4 | 2 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/docs/api.html | 3 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/docs/smfi_setsymlist.html | 10 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/docs/smfi_settimeout.html | 17 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/worker.c | 37 |
5 files changed, 49 insertions, 20 deletions
diff --git a/contrib/sendmail/libmilter/Makefile.m4 b/contrib/sendmail/libmilter/Makefile.m4 index bc9bc66..8f5da7d 100644 --- a/contrib/sendmail/libmilter/Makefile.m4 +++ b/contrib/sendmail/libmilter/Makefile.m4 @@ -1,4 +1,4 @@ -dnl $Id: Makefile.m4,v 8.85 2009/11/24 21:59:33 ca Exp $ +dnl $Id: Makefile.m4,v 8.88 2012/09/25 17:40:32 ca Exp $ include(confBUILDTOOLSDIR`/M4/switch.m4') dnl only required for compilation of EXTRAS diff --git a/contrib/sendmail/libmilter/docs/api.html b/contrib/sendmail/libmilter/docs/api.html index 578e0ca..3c56746 100644 --- a/contrib/sendmail/libmilter/docs/api.html +++ b/contrib/sendmail/libmilter/docs/api.html @@ -2,7 +2,7 @@ <HEAD><TITLE>Milter API</TITLE></HEAD> <BODY> <!-- -$Id: api.html,v 1.37 2009/05/19 00:40:52 ca Exp $ +$Id: api.html,v 1.38 2012/03/29 03:18:37 ca Exp $ --> <H1>Milter API</H1> @@ -214,7 +214,6 @@ other callbacks are message-oriented. <TD>SMFIS_REJECT</TD> <TD>For a connection-oriented routine, reject this connection; call <A HREF="xxfi_close.html">xxfi_close</A>.<BR> For a message-oriented routine (except - <A HREF="xxfi_eom.html">xxfi_eom</A> or <A HREF="xxfi_abort.html">xxfi_abort</A>), reject this message.<BR> For a recipient-oriented routine, reject the current recipient (but continue processing the current message). </TD> diff --git a/contrib/sendmail/libmilter/docs/smfi_setsymlist.html b/contrib/sendmail/libmilter/docs/smfi_setsymlist.html index 7e8edff..80793f0 100644 --- a/contrib/sendmail/libmilter/docs/smfi_setsymlist.html +++ b/contrib/sendmail/libmilter/docs/smfi_setsymlist.html @@ -2,7 +2,7 @@ <HEAD><TITLE>smfi_setsymlist</TITLE></HEAD> <BODY> <!-- -$Id: smfi_setsymlist.html,v 1.5 2006/12/21 18:30:35 ca Exp $ +$Id: smfi_setsymlist.html,v 1.6 2012/05/11 17:34:23 ca Exp $ --> <H1>smfi_setsymlist</H1> @@ -86,8 +86,10 @@ Otherwise MI_SUCCESS is returned. <!----------- Notes ----------> <TR align="left" valign=top> <TH>NOTES</TH> -<TD>There is an internal limit on the number of macros that can be -set (currently 5), +<TD>There is an internal limit on the number of macros +that can be set +<!-- XREF: MAXFILTERMACROS --> +(currently 50), however, this limit is not enforced by libmilter, only by the MTA, but a possible violation of this restriction is not communicated back to the milter.</TD> @@ -97,7 +99,7 @@ the milter.</TD> <HR size="1"> <FONT size="-1"> -Copyright (c) 2006 Sendmail, Inc. and its suppliers. +Copyright (c) 2006, 2012 Sendmail, Inc. and its suppliers. All rights reserved. <BR> By using this file, you agree to the terms and conditions set diff --git a/contrib/sendmail/libmilter/docs/smfi_settimeout.html b/contrib/sendmail/libmilter/docs/smfi_settimeout.html index 97d41cb..5631499 100644 --- a/contrib/sendmail/libmilter/docs/smfi_settimeout.html +++ b/contrib/sendmail/libmilter/docs/smfi_settimeout.html @@ -2,7 +2,7 @@ <HEAD><TITLE>smfi_settimeout</TITLE></HEAD> <BODY> <!-- -$Id: smfi_settimeout.html,v 1.14 2006/12/21 18:30:35 ca Exp $ +$Id: smfi_settimeout.html,v 1.15 2011/10/03 16:21:33 ca Exp $ --> <H1>smfi_settimeout</H1> @@ -52,11 +52,24 @@ If smfi_settimeout is not called, a default timeout of 7210 seconds is used. <TD>smfi_settimeout always returns MI_SUCCESS.</TD> </TR> +<!----------- Notes ----------> +<TR> +<TH valign="top" align=left>NOTES</TH> +<TD> +Decreasing the timeout is strongly discouraged +and may break the communication with the MTA. +Do <EM>not</EM> decrease this value without making sure that +the MTA also uses lower timeouts for communication +(with the milter and with the SMTP client). +</TR> +</TABLE> + + </TABLE> <HR size="1"> <FONT size="-1"> -Copyright (c) 2000, 2002-2003, 2006 Sendmail, Inc. and its suppliers. +Copyright (c) 2000, 2002-2003, 2006, 2011 Sendmail, Inc. and its suppliers. All rights reserved. <BR> By using this file, you agree to the terms and conditions set diff --git a/contrib/sendmail/libmilter/worker.c b/contrib/sendmail/libmilter/worker.c index aa1bd57..50e8107 100644 --- a/contrib/sendmail/libmilter/worker.c +++ b/contrib/sendmail/libmilter/worker.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004, 2007, 2009-2011 Sendmail, Inc. and its suppliers. + * Copyright (c) 2003-2004, 2007, 2009-2012 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -11,7 +11,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: worker.c,v 8.19 2011/02/14 23:33:48 ca Exp $") +SM_RCSID("@(#)$Id: worker.c,v 8.24 2012/03/13 15:37:46 ca Exp $") #include "libmilter.h" @@ -141,7 +141,8 @@ static int mi_list_del_ctx __P((SMFICTX_PTR)); #if POOL_DEBUG # define POOL_LEV_DPRINTF(lev, x) \ - do { \ + do \ + { \ if ((lev) < ctx->ctx_dbg) \ sm_dprintf x; \ } while (0) @@ -377,7 +378,7 @@ mi_pool_controller(arg) for (;;) { SMFICTX_PTR ctx; - int nfd, rfd, i; + int nfd, r, i; time_t now; POOL_LEV_DPRINTF(4, ("Let's %s again...", WAITFN)); @@ -498,19 +499,19 @@ mi_pool_controller(arg) TASKMGR_UNLOCK(); /* Everything is ready, let's wait for an event */ - rfd = poll(pfd, nfd, POLL_TIMEOUT); + r = poll(pfd, nfd, POLL_TIMEOUT); POOL_LEV_DPRINTF(4, ("%s returned: at epoch %d value %d", WAITFN, now, nfd)); /* timeout */ - if (rfd == 0) + if (r == 0) continue; rebuild_set = true; /* error */ - if (rfd < 0) + if (r < 0) { if (errno == EINTR) continue; @@ -522,6 +523,7 @@ mi_pool_controller(arg) if (pcnt >= MAX_FAILS_S) goto err; + continue; } pcnt = 0; @@ -535,7 +537,7 @@ mi_pool_controller(arg) WAITFN, i, nfd, WAIT_FD(i))); - /* has a worker signaled an end of task ? */ + /* has a worker signaled an end of task? */ if (WAIT_FD(i) == RD_PIPE) { char evts[256]; @@ -563,7 +565,12 @@ mi_pool_controller(arg) continue; } - /* no ! sendmail wants to send a command */ + /* + ** Not the pipe for workers waking us, + ** so must be something on an MTA connection. + */ + + TASKMGR_LOCK(); SM_TAILQ_FOREACH(ctx, &WRK_CTX_HEAD, ctx_link) { if (ctx->ctx_wstate != WKST_WAITING) @@ -575,7 +582,6 @@ mi_pool_controller(arg) if (ctx->ctx_sd == pfd[i].fd) { - TASKMGR_LOCK(); POOL_LEV_DPRINTF(4, ("TASK: found %d for fd[%d]=%d", @@ -591,10 +597,10 @@ mi_pool_controller(arg) ctx->ctx_wstate = WKST_RUNNING; LAUNCH_WORKER(ctx); } - TASKMGR_UNLOCK(); break; } } + TASKMGR_UNLOCK(); POOL_LEV_DPRINTF(4, ("TASK %s FOUND - Checking PIPE for fd[%d]", @@ -607,6 +613,14 @@ mi_pool_controller(arg) free(pfd); Tskmgr.tm_signature = 0; +#if 0 + /* + ** Do not clean up ctx -- it can cause double-free()s. + ** The program is shutting down anyway, so it's not worth the trouble. + ** There is a more complex solution that prevents race conditions + ** while accessing ctx, but that's maybe for a later version. + */ + for (;;) { SMFICTX_PTR ctx; @@ -616,6 +630,7 @@ mi_pool_controller(arg) break; mi_close_session(ctx); } +#endif (void) smutex_destroy(&Tskmgr.tm_w_mutex); (void) scond_destroy(&Tskmgr.tm_w_cond); |