aboutsummaryrefslogtreecommitdiff
path: root/contrib/sendmail/libmilter
diff options
context:
space:
mode:
authorGregory Neil Shapiro <gshapiro@FreeBSD.org>2000-10-01 01:49:02 +0000
committerGregory Neil Shapiro <gshapiro@FreeBSD.org>2000-10-01 01:49:02 +0000
commit42e5d1658931f6141a962c4b87919e7a1613ec8e (patch)
tree1965ed8ab83d1520308eb01c0471d69de74d7653 /contrib/sendmail/libmilter
parent06f25ae9f1d6020a600a10f713046203d1a82570 (diff)
downloadsrc-42e5d1658931f6141a962c4b87919e7a1613ec8e.tar.gz
src-42e5d1658931f6141a962c4b87919e7a1613ec8e.zip
Import of sendmail version 8.11.1 into vendor branch SENDMAIL with
release tag v8_11_1. Obtained from: ftp://ftp.sendmail.org/pub/sendmail/
Notes
Notes: svn path=/vendor/sendmail/dist/; revision=66494
Diffstat (limited to 'contrib/sendmail/libmilter')
-rw-r--r--contrib/sendmail/libmilter/README25
-rw-r--r--contrib/sendmail/libmilter/comm.c18
-rw-r--r--contrib/sendmail/libmilter/engine.c10
-rw-r--r--contrib/sendmail/libmilter/libmilter.h16
-rw-r--r--contrib/sendmail/libmilter/listener.c74
-rw-r--r--contrib/sendmail/libmilter/main.c34
-rw-r--r--contrib/sendmail/libmilter/signal.c17
-rw-r--r--contrib/sendmail/libmilter/sm_gethost.c8
8 files changed, 138 insertions, 64 deletions
diff --git a/contrib/sendmail/libmilter/README b/contrib/sendmail/libmilter/README
index 7166b40b3ab3..486a26839afe 100644
--- a/contrib/sendmail/libmilter/README
+++ b/contrib/sendmail/libmilter/README
@@ -71,6 +71,9 @@ IPv4 socket on port 3333 of localhost. The current flags (F=) are:
R Reject connection if filter unavailable
T Temporary fail connection if filter unavailable
+If neither F=R nor F=T is specified, the message is passed through sendmail
+as if the filter were not present.
+
Finally, you can override the default timeouts used by sendmail when
talking to the filters using the T= equate. There are three fields inside
of the T= equate:
@@ -88,13 +91,17 @@ T=S:10s;R:10s;E:5m
where 's' is seconds and 'm' is minutes.
-Actual sequencing is handled by the InputMailFilters option which is set
-automatically according to the order of the INPUT_MAIL_FILTER commands
-in your .mc file. Alternatively, you can reset its value by setting
-confINPUT_MAIL_FILTERS in your .mc file. This options causes the three
-filters to be called in the same order they were specified. It allows
-for possible future filtering on output (although this is not intended
-for this release).
+Which filters are invoked and their sequencing is handled by the
+InputMailFilters option.
+
+ O InputMailFilters=filter1, filter2, filter3
+
+This is is set automatically according to the order of the
+INPUT_MAIL_FILTER commands in your .mc file. Alternatively, you can
+reset its value by setting confINPUT_MAIL_FILTERS in your .mc file.
+This options causes the three filters to be called in the same order
+they were specified. It allows for possible future filtering on output
+(although this is not intended for this release).
Also note that a filter can be defined without adding it to the input
filter list by using MAIL_FILTER() instead of INPUT_MAIL_FILTER() in your
@@ -134,7 +141,7 @@ connected via one of these options, the session can be continued through
the use of standard SMTP commands.
% sendmail -bs
-220 test.sendmail.com ESMTP Sendmail 8.10.0.Beta8/8.10.0.Beta8; Mon, 6 Dec 1999 19:34:23 -0800 (PST)
+220 test.sendmail.com ESMTP Sendmail 8.11.0/8.11.0; Tue, 10 Nov 1970 13:05:23 -0500 (EST)
HELO localhost
250 test.sendmail.com Hello testy@localhost, pleased to meet you
MAIL From:<testy>
@@ -405,4 +412,4 @@ main(argc, argv)
/* eof */
-$Revision: 8.9.2.1.2.8 $, Last updated $Date: 2000/07/18 15:43:26 $
+$Revision: 8.9.2.1.2.12 $, Last updated $Date: 2000/09/19 19:40:13 $
diff --git a/contrib/sendmail/libmilter/comm.c b/contrib/sendmail/libmilter/comm.c
index 765b024c20b9..31f432cc4d9f 100644
--- a/contrib/sendmail/libmilter/comm.c
+++ b/contrib/sendmail/libmilter/comm.c
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: comm.c,v 8.30.4.3 2000/06/12 14:53:01 ca Exp $";
+static char id[] = "@(#)$Id: comm.c,v 8.30.4.5 2000/08/14 09:04:47 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -71,7 +71,7 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name)
*cmd = SMFIC_SELECT;
return NULL;
}
- if ((len = read(sd, data + i, sizeof data - i)) < 0)
+ if ((len = MI_SOCK_READ(sd, data + i, sizeof data - i)) < 0)
{
smi_log(SMI_LOG_ERR,
"%s, mi_rd_cmd: read returned %d: %s",
@@ -131,7 +131,7 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name)
free(buf);
return NULL;
}
- if ((len = read(sd, buf + i, expl - i)) < 0)
+ if ((len = MI_SOCK_READ(sd, buf + i, expl - i)) < 0)
{
smi_log(SMI_LOG_ERR,
"%s: mi_rd_cmd: read returned %d: %s",
@@ -217,7 +217,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
i = 0;
sl = MILTER_LEN_BYTES + 1;
- do {
+ do
+ {
FD_ZERO(&wrtset);
FD_SET((u_int) sd, &wrtset);
if ((ret = select(sd + 1, NULL, &wrtset, NULL, timeout)) == 0)
@@ -227,7 +228,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
return MI_FAILURE;
/* use writev() instead to send the whole stuff at once? */
- while ((l = write(sd, (void *) (data + i), sl - i)) < (ssize_t) sl)
+ while ((l = MI_SOCK_WRITE(sd, (void *) (data + i),
+ sl - i)) < (ssize_t) sl)
{
if (l < 0)
return MI_FAILURE;
@@ -241,7 +243,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
return MI_SUCCESS;
i = 0;
sl = len;
- do {
+ do
+ {
FD_ZERO(&wrtset);
FD_SET((u_int) sd, &wrtset);
if ((ret = select(sd + 1, NULL, &wrtset, NULL, timeout)) == 0)
@@ -249,7 +252,8 @@ mi_wr_cmd(sd, timeout, cmd, buf, len)
} while (ret < 0 && errno == EINTR);
if (ret < 0)
return MI_FAILURE;
- while ((l = write(sd, (void *) (buf + i), sl - i)) < (ssize_t) sl)
+ while ((l = MI_SOCK_WRITE(sd, (void *) (buf + i),
+ sl - i)) < (ssize_t) sl)
{
if (l < 0)
return MI_FAILURE;
diff --git a/contrib/sendmail/libmilter/engine.c b/contrib/sendmail/libmilter/engine.c
index ca2da4c7792b..c2a3dc3d65a1 100644
--- a/contrib/sendmail/libmilter/engine.c
+++ b/contrib/sendmail/libmilter/engine.c
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: engine.c,v 8.67.4.12 2000/07/14 06:16:57 msk Exp $";
+static char id[] = "@(#)$Id: engine.c,v 8.67.4.14 2000/08/14 08:27:30 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -208,7 +208,8 @@ mi_engine(ctx)
fi_abort = ctx->ctx_smfi->xxfi_abort;
mi_clr_macros(ctx, 0);
fix_stm(ctx);
- do {
+ do
+ {
/* call abort only if in a mail transaction */
call_abort = ST_IN_MAIL(curstate);
timeout.tv_sec = ctx->ctx_timeout;
@@ -226,7 +227,7 @@ mi_engine(ctx)
cmd < SMFIC_VALIDCMD)
{
if (ctx->ctx_dbg > 5)
- dprintf("[%d] error (%x)\n",
+ dprintf("[%d] mi_engine: mi_rd_cmd error (%x)\n",
(int) ctx->ctx_id, (int) cmd);
/*
@@ -958,7 +959,8 @@ trans_ok(old, new)
int s, n;
s = old;
- do {
+ do
+ {
/* is this state transition allowed? */
if ((MASK(new) & next_states[s]) != 0)
return TRUE;
diff --git a/contrib/sendmail/libmilter/libmilter.h b/contrib/sendmail/libmilter/libmilter.h
index a675ac68a51d..f43fd0e2298f 100644
--- a/contrib/sendmail/libmilter/libmilter.h
+++ b/contrib/sendmail/libmilter/libmilter.h
@@ -17,7 +17,7 @@
# define EXTERN
# define INIT(x) = x
# ifndef lint
-static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gshapiro Exp $";
+static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.9 2000/09/01 00:49:04 ca Exp $";
# endif /* ! lint */
#else /* _DEFINE */
# define EXTERN extern
@@ -37,6 +37,9 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
#include "sendmail/useful.h"
# define ValidSocket(sd) ((sd) >= 0)
+# define INVALID_SOCKET -1
+# define MI_SOCK_READ(s, b, l) (read(s, b, l))
+# define MI_SOCK_WRITE(s, b, l) (write(s, b, l))
# define thread_create(ptid,wr,arg) pthread_create(ptid, NULL, wr, arg)
# define sthread_get_id() pthread_self()
@@ -51,6 +54,12 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
#define MI_TIMEOUT 1800 /* default timeout for read/write */
#define MI_CHK_TIME 5 /* checking whether to terminate */
+#if SOMAXCONN > 20
+# define MI_SOMAXCONN SOMAXCONN
+#else /* SOMAXCONN */
+# define MI_SOMAXCONN 20
+#endif /* SOMAXCONN */
+
/* maximum number of repeated failures in mi_listener() */
#define MAX_FAILS_M 16 /* malloc() */
#define MAX_FAILS_T 16 /* thread creation */
@@ -74,8 +83,6 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
#define SMI_LOG_INFO LOG_INFO
#define SMI_LOG_DEBUG LOG_DEBUG
-#define MI_INVALID_SOCKET (-1)
-
/* stop? */
#define MILTER_CONT 0
#define MILTER_STOP 1
@@ -84,13 +91,14 @@ static char MilterlId[] = "@(#)$Id: libmilter.h,v 8.3.6.4 2000/06/09 07:12:13 gs
/* functions */
extern int mi_handle_session __P((SMFICTX_PTR));
extern int mi_engine __P((SMFICTX_PTR));
-extern int mi_listener __P((char *, int, smfiDesc_ptr, time_t));
+extern int mi_listener __P((char *, int, smfiDesc_ptr, time_t, int));
extern void mi_clr_macros __P((SMFICTX_PTR, int));
extern int mi_stop __P((void));
extern int mi_control_startup __P((char *));
extern void mi_stop_milters __P((int));
extern void mi_clean_signals __P((void));
extern struct hostent *mi_gethostbyname __P((char *, int));
+extern void mi_closener __P((void));
/* communication functions */
extern char *mi_rd_cmd __P((socket_t, struct timeval *, char *, size_t *, char *));
diff --git a/contrib/sendmail/libmilter/listener.c b/contrib/sendmail/libmilter/listener.c
index a88258c43304..c3ad445e208a 100644
--- a/contrib/sendmail/libmilter/listener.c
+++ b/contrib/sendmail/libmilter/listener.c
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.7 2000/05/25 21:44:26 gshapiro Exp $";
+static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.11 2000/09/01 00:49:04 ca Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -35,14 +35,14 @@ static char id[] = "@(#)$Id: listener.c,v 8.38.2.1.2.7 2000/05/25 21:44:26 gshap
** socket upon success, error code otherwise.
*/
-static int
+static socket_t
mi_milteropen(conn, backlog, socksize, name)
char *conn;
int backlog;
SOCKADDR_LEN_T *socksize;
char *name;
{
- int sock = 0;
+ socket_t sock;
int sockopt = 1;
char *p;
char *colon;
@@ -54,7 +54,7 @@ mi_milteropen(conn, backlog, socksize, name)
{
smi_log(SMI_LOG_ERR, "%s: empty or missing socket information",
name);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
(void) memset(&addr, '\0', sizeof addr);
@@ -86,7 +86,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: no valid socket protocols available",
name);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
# endif /* NETINET6 */
# endif /* NETINET */
#endif /* NETUNIX */
@@ -117,7 +117,7 @@ mi_milteropen(conn, backlog, socksize, name)
{
smi_log(SMI_LOG_ERR, "%s: unknown socket type %s",
name, p);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
*colon++ = ':';
}
@@ -141,7 +141,7 @@ mi_milteropen(conn, backlog, socksize, name)
# else /* NETINET6 */
smi_log(SMI_LOG_ERR, "%s: unknown socket type %s",
name, p);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
# endif /* NETINET6 */
# endif /* NETINET */
#endif /* NETUNIX */
@@ -162,7 +162,7 @@ mi_milteropen(conn, backlog, socksize, name)
errno = EINVAL;
smi_log(SMI_LOG_ERR, "%s: UNIX socket name %s too long",
name, colon);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
# if 0
errno = safefile(colon, RunAsUid, RunAsGid, RunAsUserName, sff,
@@ -174,7 +174,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: UNIX socket name %s unsafe",
name, colon);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
# endif /* 0 */
@@ -225,7 +225,7 @@ mi_milteropen(conn, backlog, socksize, name)
# ifdef NO_GETSERVBYNAME
smi_log(SMI_LOG_ERR, "%s: invalid port number %s",
name, colon);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
# else /* NO_GETSERVBYNAME */
register struct servent *sp;
@@ -235,7 +235,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: unknown port name %s",
name, colon);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
port = sp->s_port;
# endif /* NO_GETSERVBYNAME */
@@ -286,7 +286,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: Invalid numeric domain spec \"%s\"",
name, at);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
}
else
@@ -294,7 +294,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: Invalid numeric domain spec \"%s\"",
name, at);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
}
else
@@ -305,7 +305,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: Unknown host name %s",
name, at);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
addr.sa.sa_family = hp->h_addrtype;
switch (hp->h_addrtype)
@@ -332,7 +332,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: Unknown protocol for %s (%d)",
name, at, hp->h_addrtype);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
}
}
@@ -361,7 +361,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: Unable to create new socket: %s",
name, strerror(errno));
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt,
@@ -370,7 +370,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: Unable to setsockopt: %s", name, strerror(errno));
(void) close(sock);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
if (bind(sock, &addr.sa, *socksize) < 0)
@@ -379,7 +379,7 @@ mi_milteropen(conn, backlog, socksize, name)
"%s: Unable to bind to port %s: %s",
name, conn, strerror(errno));
(void) close(sock);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
if (listen(sock, backlog) < 0)
@@ -387,7 +387,7 @@ mi_milteropen(conn, backlog, socksize, name)
smi_log(SMI_LOG_ERR,
"%s: listen call failed: %s", name, strerror(errno));
(void) close(sock);
- return MI_INVALID_SOCKET;
+ return INVALID_SOCKET;
}
return sock;
@@ -409,8 +409,30 @@ mi_thread_handle_wrapper(arg)
return (void *) mi_handle_session(arg);
}
+static socket_t listenfd = INVALID_SOCKET;
+
/*
-** MI_MILTER_LISTENER -- Generic listener harness
+** MI_CLOSENER -- close listen socket
+**
+** Parameters:
+** none.
+**
+** Returns:
+** none.
+*/
+
+void
+mi_closener()
+{
+ if (ValidSocket(listenfd))
+ {
+ (void) close(listenfd);
+ listenfd = INVALID_SOCKET;
+ }
+}
+
+ /*
+** MI_LISTENER -- Generic listener harness
**
** Open up listen port
** Wait for connections
@@ -428,14 +450,14 @@ mi_thread_handle_wrapper(arg)
*/
int
-mi_listener(conn, dbg, smfi, timeout)
+mi_listener(conn, dbg, smfi, timeout, backlog)
char *conn;
int dbg;
smfiDesc_ptr smfi;
time_t timeout;
+ int backlog;
{
- int connfd = -1;
- int listenfd = -1;
+ socket_t connfd = INVALID_SOCKET;
int sockopt = 1;
int r;
int ret = MI_SUCCESS;
@@ -453,8 +475,8 @@ mi_listener(conn, dbg, smfi, timeout)
smi_log(SMI_LOG_DEBUG,
"%s: Opening listen socket on conn %s",
smfi->xxfi_name, conn);
- if ((listenfd = mi_milteropen(conn, SOMAXCONN, &socksize,
- smfi->xxfi_name)) < 0)
+ listenfd = mi_milteropen(conn, backlog, &socksize, smfi->xxfi_name);
+ if (!ValidSocket(listenfd))
{
smi_log(SMI_LOG_FATAL,
"%s: Unable to create listening socket on conn %s",
@@ -498,7 +520,7 @@ mi_listener(conn, dbg, smfi, timeout)
connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
&clilen);
- if (connfd < 0)
+ if (!ValidSocket(connfd))
{
smi_log(SMI_LOG_ERR,
"%s: accept() returned invalid socket",
diff --git a/contrib/sendmail/libmilter/main.c b/contrib/sendmail/libmilter/main.c
index 3233ba1dd66d..7ea1ba71ca3e 100644
--- a/contrib/sendmail/libmilter/main.c
+++ b/contrib/sendmail/libmilter/main.c
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: main.c,v 8.34.4.5 2000/07/14 06:16:57 msk Exp $";
+static char id[] = "@(#)$Id: main.c,v 8.34.4.9 2000/09/09 02:23:03 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -43,7 +43,7 @@ smfi_register(smfilter)
if (smfi == NULL)
return MI_FAILURE;
}
- (void)memcpy(smfi, &smfilter, sizeof *smfi);
+ (void) memcpy(smfi, &smfilter, sizeof *smfi);
if (smfilter.xxfi_name == NULL)
smfilter.xxfi_name = "Unknown";
@@ -67,9 +67,27 @@ smfi_register(smfilter)
return MI_SUCCESS;
}
+ /*
+** SMFI_STOP -- stop milter
+**
+** Parameters:
+** none.
+**
+** Returns:
+** success.
+*/
+
+int
+smfi_stop()
+{
+ mi_stop_milters(MILTER_STOP);
+ return MI_SUCCESS;
+}
+
static int dbg = 0;
static char *conn = NULL;
static int timeout = MI_TIMEOUT;
+static int backlog= MI_SOMAXCONN;
int
smfi_setdbg(odbg)
@@ -104,6 +122,16 @@ smfi_setconn(oconn)
}
int
+smfi_setbacklog(obacklog)
+ int obacklog;
+{
+ if (obacklog <= 0)
+ return MI_FAILURE;
+ backlog = obacklog;
+ return MI_SUCCESS;
+}
+
+int
smfi_main()
{
signal(SIGPIPE, SIG_IGN);
@@ -124,7 +152,7 @@ smfi_main()
}
/* Startup the listener */
- if (mi_listener(conn, dbg, smfi, timeout) != MI_SUCCESS)
+ if (mi_listener(conn, dbg, smfi, timeout, backlog) != MI_SUCCESS)
return MI_FAILURE;
return MI_SUCCESS;
diff --git a/contrib/sendmail/libmilter/signal.c b/contrib/sendmail/libmilter/signal.c
index c57c3133420b..9448d77e77a8 100644
--- a/contrib/sendmail/libmilter/signal.c
+++ b/contrib/sendmail/libmilter/signal.c
@@ -9,21 +9,21 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: signal.c,v 8.10.4.4 2000/07/14 06:16:57 msk Exp $";
+static char id[] = "@(#)$Id: signal.c,v 8.10.4.7 2000/09/01 00:49:04 ca Exp $";
#endif /* ! lint */
#if _FFR_MILTER
#include "libmilter.h"
typedef pthread_mutex_t smutex_t;
-#define smutex_init(mp) (pthread_mutex_init(mp, NULL) == 0)
-#define smutex_destroy(mp) (pthread_mutex_destroy(mp) == 0)
-#define smutex_lock(mp) (pthread_mutex_lock(mp) == 0)
-#define smutex_unlock(mp) (pthread_mutex_unlock(mp) == 0)
-#define smutex_trylock(mp) (pthread_mutex_trylock(mp) == 0)
+# define smutex_init(mp) (pthread_mutex_init(mp, NULL) == 0)
+# define smutex_destroy(mp) (pthread_mutex_destroy(mp) == 0)
+# define smutex_lock(mp) (pthread_mutex_lock(mp) == 0)
+# define smutex_unlock(mp) (pthread_mutex_unlock(mp) == 0)
+# define smutex_trylock(mp) (pthread_mutex_trylock(mp) == 0)
/*
-** thread to handle signals
+** thread to handle signals
*/
static smutex_t M_Mutex;
@@ -62,6 +62,9 @@ mi_stop_milters(v)
(void) smutex_lock(&M_Mutex);
if (MilterStop < v)
MilterStop = v;
+
+ /* close listen socket */
+ mi_closener();
(void) smutex_unlock(&M_Mutex);
}
/*
diff --git a/contrib/sendmail/libmilter/sm_gethost.c b/contrib/sendmail/libmilter/sm_gethost.c
index fc45d288cb79..fdbaebd24531 100644
--- a/contrib/sendmail/libmilter/sm_gethost.c
+++ b/contrib/sendmail/libmilter/sm_gethost.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2000 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#ifndef lint
-static char id[] = "@(#)$Id: sm_gethost.c,v 8.7 2000/01/20 21:51:52 geir Exp $";
+static char id[] = "@(#)$Id: sm_gethost.c,v 8.7.8.2 2000/09/17 17:04:24 gshapiro Exp $";
#endif /* ! lint */
#if _FFR_MILTER
@@ -39,7 +39,7 @@ static char id[] = "@(#)$Id: sm_gethost.c,v 8.7 2000/01/20 21:51:52 geir Exp $";
# endif /* ! AI_ALL */
static struct hostent *
-mi_getipnodebyname(name, family, flags, err)
+getipnodebyname(name, family, flags, err)
char *name;
int family;
int flags;
@@ -87,7 +87,7 @@ mi_gethostbyname(name, family)
# endif /* NETINET6 */
# if NETINET6
- h = mi_getipnodebyname(name, family, AI_V4MAPPED|AI_ALL, &err);
+ h = getipnodebyname(name, family, AI_V4MAPPED|AI_ALL, &err);
h_errno = err;
# else /* NETINET6 */
h = gethostbyname(name);