diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2006-03-22 16:40:03 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2006-03-22 16:40:03 +0000 |
commit | ef9770707c0f88e94a0c4a409f8fb74cea250716 (patch) | |
tree | f3bd1c133ce6e698fd2ff3c0280c7103bfac7af3 /contrib/sendmail/libmilter | |
parent | 3f99651e549f30e601bcde5ce7907ee58c365442 (diff) | |
download | FreeBSD-src-ef9770707c0f88e94a0c4a409f8fb74cea250716.zip FreeBSD-src-ef9770707c0f88e94a0c4a409f8fb74cea250716.tar.gz |
Import sendmail 8.13.6
Security: FreeBSD-SA-06:13.sendmail
Diffstat (limited to 'contrib/sendmail/libmilter')
-rw-r--r-- | contrib/sendmail/libmilter/README | 5 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/docs/smfi_stop.html | 17 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/docs/xxfi_helo.html | 10 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/libmilter.h | 6 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/listener.c | 18 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/signal.c | 18 | ||||
-rw-r--r-- | contrib/sendmail/libmilter/smfi.c | 8 |
7 files changed, 47 insertions, 35 deletions
diff --git a/contrib/sendmail/libmilter/README b/contrib/sendmail/libmilter/README index ec1f84b..1aadc4f 100644 --- a/contrib/sendmail/libmilter/README +++ b/contrib/sendmail/libmilter/README @@ -12,6 +12,9 @@ issuing the './Build' command in SRCDIR/libmilter . Starting with 8.13 sendmail is compiled by default with support for the milter API. +Note: if you want to write a milter in Java, then see +http://sendmail-jilter.sourceforge.net/ + +----------------+ | SECURITY HINTS | +----------------+ @@ -466,4 +469,4 @@ main(argc, argv) /* eof */ -$Revision: 8.40 $, Last updated $Date: 2003/12/11 18:14:34 $ +$Revision: 8.41 $, Last updated $Date: 2005/04/27 22:47:42 $ diff --git a/contrib/sendmail/libmilter/docs/smfi_stop.html b/contrib/sendmail/libmilter/docs/smfi_stop.html index bf93423..05e17be 100644 --- a/contrib/sendmail/libmilter/docs/smfi_stop.html +++ b/contrib/sendmail/libmilter/docs/smfi_stop.html @@ -2,7 +2,7 @@ <head><title>smfi_stop</title></head> <body> <!-- -$Id: smfi_stop.html,v 1.2 2003/11/24 23:38:26 ca Exp $ +$Id: smfi_stop.html,v 1.3 2005/10/27 06:08:57 ca Exp $ --> <h1>smfi_stop</h1> @@ -13,8 +13,8 @@ $Id: smfi_stop.html,v 1.2 2003/11/24 23:38:26 ca Exp $ #include <libmilter/mfapi.h> int smfi_stop(void); </pre> -Start an orderly shutdown of the milter. No connections will be accepted -after this call. +Shutdown the milter. +No connections will be accepted after this call. </td></tr> <!----------- Description ----------> @@ -27,10 +27,11 @@ or any error-handling routines at any time.</td> </tr> <tr align="left" valign=top> <th width="80">Effects</th> -<td>The smfi_stop routine -causes each thread to finish its current connection, then exit. -When all threads have exited, the call -to <a href="smfi_main.html">smfi_main</a> returns to your calling program, +<td>The smfi_stop routine prevents that new connections +will be accepted, +however, it does not wait for existing connections (threads) to terminate. +It will cause +<a href="smfi_main.html">smfi_main</a> to return to the calling program, which may then exit or warm-restart. </td> </tr> @@ -63,7 +64,7 @@ which may then exit or warm-restart. <hr size="1"> <font size="-1"> -Copyright (c) 2003 Sendmail, Inc. and its suppliers. +Copyright (c) 2003, 2005 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/xxfi_helo.html b/contrib/sendmail/libmilter/docs/xxfi_helo.html index dc7bbf3..e31585a 100644 --- a/contrib/sendmail/libmilter/docs/xxfi_helo.html +++ b/contrib/sendmail/libmilter/docs/xxfi_helo.html @@ -2,7 +2,7 @@ <head><title>xxfi_helo</title></head> <body> <!-- -$Id: xxfi_helo.html,v 1.8 2003/03/05 19:57:55 ca Exp $ +$Id: xxfi_helo.html,v 1.9 2005/08/30 23:41:45 ca Exp $ --> <h1>xxfi_helo</h1> @@ -24,8 +24,10 @@ Handle the HELO/EHLO command. <table border="1" cellspacing=1 cellpadding=4> <tr align="left" valign=top> <th width="80">Called When</th> <td>xxfi_helo is called whenever the client -sends a HELO/EHLO command. It may therefore be called between zero and -three times</td> +sends a HELO/EHLO command. +It may therefore be called several times or even not at all; +some restrictions can be imposed by the MTA configuration. +</td> </tr> <tr align="left" valign=top> <th>Default Behavior</th> @@ -52,7 +54,7 @@ three times</td> <hr size="1"> <font size="-1"> -Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers. +Copyright (c) 2000, 2003, 2005 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/libmilter.h b/contrib/sendmail/libmilter/libmilter.h index 65b0a47..9cebdc2 100644 --- a/contrib/sendmail/libmilter/libmilter.h +++ b/contrib/sendmail/libmilter/libmilter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2003, 2006 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -19,7 +19,7 @@ #ifdef _DEFINE # define EXTERN # define INIT(x) = x -SM_IDSTR(MilterlId, "@(#)$Id: libmilter.h,v 8.50 2003/12/11 18:14:34 ca Exp $") +SM_IDSTR(MilterlId, "@(#)$Id: libmilter.h,v 8.51 2006/01/04 02:24:37 ca Exp $") #else /* _DEFINE */ # define EXTERN extern # define INIT(x) @@ -102,7 +102,7 @@ typedef pthread_mutex_t smutex_t; # define FD_WR_INIT(sd, wrs) \ FD_ZERO(&(wrs)); \ - FD_SET((unsigned int) (sd), &(wrs)); \ + FD_SET((unsigned int) (sd), &(wrs)) # define FD_IS_RD_EXC(sd, rds, excs) FD_ISSET(sd, &(excs)) # define FD_IS_WR_RDY(sd, wrs) FD_ISSET((sd), &(wrs)) diff --git a/contrib/sendmail/libmilter/listener.c b/contrib/sendmail/libmilter/listener.c index adecc5a..4429edf 100644 --- a/contrib/sendmail/libmilter/listener.c +++ b/contrib/sendmail/libmilter/listener.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2006 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: listener.c,v 8.111 2004/09/20 21:11:15 msk Exp $") +SM_RCSID("@(#)$Id: listener.c,v 8.115 2006/01/24 00:48:39 ca Exp $") /* ** listener.c -- threaded network listener @@ -458,11 +458,15 @@ mi_milteropen(conn, backlog, rmsocket, name) return INVALID_SOCKET; } - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt, + if ( +#if NETUNIX + addr.sa.sa_family != AF_UNIX && +#endif /* NETUNIX */ + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt, sizeof(sockopt)) == -1) { smi_log(SMI_LOG_ERR, - "%s: Unable to setsockopt: %s", name, + "%s: set reuseaddr failed (%s)", name, sm_errstring(errno)); (void) closesocket(sock); return INVALID_SOCKET; @@ -565,9 +569,6 @@ mi_thread_handle_wrapper(arg) /* ** MI_CLOSENER -- close listen socket ** -** NOTE: It is assumed that this function is called from a -** function that has a mutex lock (currently mi_stop_milters()). -** ** Parameters: ** none. ** @@ -872,7 +873,8 @@ mi_listener(conn, dbg, smfi, timeout, backlog) if (setsockopt(connfd, SOL_SOCKET, SO_KEEPALIVE, (void *) &sockopt, sizeof sockopt) < 0) { - smi_log(SMI_LOG_WARN, "%s: setsockopt() failed (%s)", + smi_log(SMI_LOG_WARN, + "%s: set keepalive failed (%s)", smfi->xxfi_name, sm_errstring(errno)); /* XXX: continue? */ } diff --git a/contrib/sendmail/libmilter/signal.c b/contrib/sendmail/libmilter/signal.c index d55ab57..ad68469 100644 --- a/contrib/sendmail/libmilter/signal.c +++ b/contrib/sendmail/libmilter/signal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2004, 2006 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: signal.c,v 8.42 2004/08/20 21:10:30 ca Exp $") +SM_RCSID("@(#)$Id: signal.c,v 8.44 2006/03/03 03:42:04 ca Exp $") #include "libmilter.h" @@ -90,7 +90,7 @@ static void * mi_signal_thread(name) void *name; { - int sig, errs; + int sig, errs, sigerr; sigset_t set; (void) sigemptyset(&set); @@ -103,19 +103,23 @@ mi_signal_thread(name) for (;;) { - sig = 0; + sigerr = sig = 0; #if defined(SOLARIS) || defined(__svr5__) if ((sig = sigwait(&set)) < 0) #else /* defined(SOLARIS) || defined(__svr5__) */ - if (sigwait(&set, &sig) != 0) + if ((sigerr = sigwait(&set, &sig)) != 0) #endif /* defined(SOLARIS) || defined(__svr5__) */ { + /* some OS return -1 and set errno: copy it */ + if (sigerr <= 0) + sigerr = errno; + /* this can happen on OSF/1 (at least) */ - if (errno == EINTR) + if (sigerr == EINTR) continue; smi_log(SMI_LOG_ERR, "%s: sigwait returned error: %d", - (char *)name, errno); + (char *)name, sigerr); if (++errs > MAX_FAILS_T) { mi_stop_milters(MILTER_ABRT); diff --git a/contrib/sendmail/libmilter/smfi.c b/contrib/sendmail/libmilter/smfi.c index d5f54c9..63bf174 100644 --- a/contrib/sendmail/libmilter/smfi.c +++ b/contrib/sendmail/libmilter/smfi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1999-2005 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -9,7 +9,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: smfi.c,v 8.73 2004/09/20 21:26:57 ca Exp $") +SM_RCSID("@(#)$Id: smfi.c,v 8.74 2005/03/30 00:44:07 ca Exp $") #include <sm/varargs.h> #include "libmilter.h" @@ -242,7 +242,7 @@ smfi_replacebody(ctx, bodyp, bodylen) /* split body chunk if necessary */ off = 0; - while (bodylen > 0) + do { len = (bodylen >= MILTER_CHUNK_SIZE) ? MILTER_CHUNK_SIZE : bodylen; @@ -251,7 +251,7 @@ smfi_replacebody(ctx, bodyp, bodylen) return r; off += len; bodylen -= len; - } + } while (bodylen > 0); return MI_SUCCESS; } |