From 0a9c74f73599b0ca2981b57815b436d1f6de6191 Mon Sep 17 00:00:00 2001 From: gshapiro Date: Thu, 17 Aug 2006 05:10:43 +0000 Subject: Import sendmail 8.13.8 --- contrib/sendmail/src/main.c | 10 +++++++++- contrib/sendmail/src/queue.c | 18 +++++++++++++++--- contrib/sendmail/src/srvrsmtp.c | 7 ++++--- contrib/sendmail/src/version.c | 4 ++-- 4 files changed, 30 insertions(+), 9 deletions(-) (limited to 'contrib/sendmail/src') diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c index d81d386..0d6928d 100644 --- a/contrib/sendmail/src/main.c +++ b/contrib/sendmail/src/main.c @@ -25,7 +25,7 @@ SM_UNUSED(static char copyright[]) = The Regents of the University of California. All rights reserved.\n"; #endif /* ! lint */ -SM_RCSID("@(#)$Id: main.c,v 8.944 2006/04/21 23:56:42 ca Exp $") +SM_RCSID("@(#)$Id: main.c,v 8.944.2.2 2006/08/03 22:05:03 ca Exp $") #if NETINET || NETINET6 @@ -2289,6 +2289,8 @@ main(argc, argv, envp) { char dtype[200]; + /* avoid cleanup in finis(), DaemonPid will be set below */ + DaemonPid = 0; if (!run_in_foreground && !tTd(99, 100)) { /* put us in background */ @@ -2321,7 +2323,10 @@ main(argc, argv, envp) dtype[0] = '\0'; if (OpMode == MD_DAEMON) + { (void) sm_strlcat(dtype, "+SMTP", sizeof dtype); + DaemonPid = CurrentPid; + } if (QueueIntvl > 0) { (void) sm_strlcat2(dtype, @@ -2903,6 +2908,9 @@ finis(drop, cleanup, exitstat) dropenvelope(CurEnv, true, false); sm_rpool_free(CurEnv->e_rpool); CurEnv->e_rpool = NULL; + + /* this may have pointed to the rpool */ + CurEnv->e_to = NULL; } else poststats(StatFile); diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c index 151cd48..6fd2315 100644 --- a/contrib/sendmail/src/queue.c +++ b/contrib/sendmail/src/queue.c @@ -14,7 +14,7 @@ #include #include -SM_RCSID("@(#)$Id: queue.c,v 8.954 2006/04/22 01:07:00 ca Exp $") +SM_RCSID("@(#)$Id: queue.c,v 8.954.2.5 2006/07/31 21:44:18 ca Exp $") #include @@ -2646,6 +2646,7 @@ gatherq(qgrp, qdir, doall, full, more) /* avoid work if possible */ if ((QueueSortOrder == QSO_BYFILENAME || QueueSortOrder == QSO_BYMODTIME || + QueueSortOrder == QSO_NONE || QueueSortOrder == QSO_RANDOM) && QueueLimitQuarantine == NULL && QueueLimitSender == NULL && @@ -6312,7 +6313,19 @@ filesys_find(name, path, add) for (i = 0; i < NumFileSys; ++i) { if (FILE_SYS_DEV(i) == st.st_dev) + { + /* + ** Make sure the file system (FS) name is set: + ** even though the source code indicates that + ** FILE_SYS_DEV() is only set below, it could be + ** set via shared memory, hence we need to perform + ** this check/assignment here. + */ + + if (NULL == FILE_SYS_NAME(i)) + FILE_SYS_NAME(i) = name; return i; + } } if (i >= MAXFILESYS) { @@ -6406,8 +6419,7 @@ filesys_update() static time_t nextupdate = 0; #if SM_CONF_SHM - /* only the daemon updates this structure */ - if (ShmId == SM_SHM_NO_ID || DaemonPid != CurrentPid) + if (ShmId != SM_SHM_NO_ID && DaemonPid != CurrentPid) return; #endif /* SM_CONF_SHM */ now = curtime(); diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c index c75214f..d95b5a5 100644 --- a/contrib/sendmail/src/srvrsmtp.c +++ b/contrib/sendmail/src/srvrsmtp.c @@ -17,7 +17,7 @@ # include #endif /* MILTER */ -SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.924.2.2 2006/05/31 20:56:37 ca Exp $") +SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.924.2.5 2006/07/07 16:29:39 ca Exp $") #include #include @@ -851,8 +851,9 @@ smtp(nullserver, d_flags, e) char state; char *response; - response = milter_connect(peerhostname, RealHostAddr, - e, &state); + q = macvalue(macid("{client_name}"), e); + SM_ASSERT(q != NULL); + response = milter_connect(q, RealHostAddr, e, &state); switch (state) { case SMFIR_REPLYCODE: /* REPLYCODE shouldn't happen */ diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c index 812d1eb..f577728 100644 --- a/contrib/sendmail/src/version.c +++ b/contrib/sendmail/src/version.c @@ -13,6 +13,6 @@ #include -SM_RCSID("@(#)$Id: version.c,v 8.163.2.4 2006/06/05 22:32:40 ca Exp $") +SM_RCSID("@(#)$Id: version.c,v 8.163.2.8 2006/07/26 17:24:02 ca Exp $") -char Version[] = "8.13.7"; +char Version[] = "8.13.8"; -- cgit v1.1