summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sendmail/src
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-12-03 06:07:35 +0000
committerpeter <peter@FreeBSD.org>1996-12-03 06:07:35 +0000
commit7a3624533288fa35a41c29ac536eca2fa5a5917f (patch)
tree23d37f1316059e9814ea0d9d14cfad8ec6234363 /usr.sbin/sendmail/src
parent688d702d4b6e585823e5481218e19cdf2f1557ed (diff)
parentfe7a1e47bd429b92884cb10fd00713b54d052423 (diff)
downloadFreeBSD-src-7a3624533288fa35a41c29ac536eca2fa5a5917f.zip
FreeBSD-src-7a3624533288fa35a41c29ac536eca2fa5a5917f.tar.gz
This commit was generated by cvs2svn to compensate for changes in r20103,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'usr.sbin/sendmail/src')
-rw-r--r--usr.sbin/sendmail/src/READ_ME25
-rw-r--r--usr.sbin/sendmail/src/clock.c30
-rw-r--r--usr.sbin/sendmail/src/convtime.c5
-rw-r--r--usr.sbin/sendmail/src/envelope.c10
-rw-r--r--usr.sbin/sendmail/src/err.c6
-rw-r--r--usr.sbin/sendmail/src/makesendmail9
-rw-r--r--usr.sbin/sendmail/src/map.c11
-rw-r--r--usr.sbin/sendmail/src/mci.c82
-rw-r--r--usr.sbin/sendmail/src/queue.c86
-rw-r--r--usr.sbin/sendmail/src/stab.c4
-rw-r--r--usr.sbin/sendmail/src/version.c4
11 files changed, 172 insertions, 100 deletions
diff --git a/usr.sbin/sendmail/src/READ_ME b/usr.sbin/sendmail/src/READ_ME
index afeac1b..72e9a18 100644
--- a/usr.sbin/sendmail/src/READ_ME
+++ b/usr.sbin/sendmail/src/READ_ME
@@ -30,7 +30,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)READ_ME 8.130 (Berkeley) 11/10/96
+# @(#)READ_ME 8.132 (Berkeley) 12/1/96
#
This directory contains the source files for sendmail.
@@ -175,6 +175,10 @@ LDAPMAP Lightweight Directory Lookup Protocol support. You will
>>> OVERRIDE calls to ndbm routines -- in particular, if you leave ndbm.h
>>> in, you can find yourself using the new db package even if you don't
>>> define NEWDB.
+>>>
+>>> Further note: DO NOT remove your existing /usr/include/ndbm.h --
+>>> you need that one. But do not install an updated ndbm.h in
+>>> /usr/include, /usr/local/include, or anywhere else.
If NEWDB and NDBM are defined (but not NIS), then sendmail will read
NDBM format alias files, but the next time a newaliases is run the
@@ -790,6 +794,23 @@ Ultrix
IDENT on in the configuration file by setting the "ident" timeout
to 30 seconds.
+Solaris 2.5.1 (SunOS 5.5.1)
+ Apparently patch 103663-01 installs a new /usr/include/resolv.h
+ file that defines the __P macro without checking to see if it is
+ already defined. This causes compile warnings such as:
+
+ In file included from daemon.c:51:
+ /usr/include/resolv.h:208: warning: `__P' redefined
+ cdefs.h:58: warning: this is the location of the previous definition
+
+ If you are running with this patch, create a file in the
+ obj.SunOS.5.5.1.* directory that reads:
+
+ #undef __P
+ #include "/usr/include/resolv.h"
+
+ ... And then file a bug report with Sun.
+
OSF/1
If you are compiling on OSF/1 (DEC Alpha), you must use
-L/usr/shlib (otherwise it core dumps on startup). You may also
@@ -1377,4 +1398,4 @@ version.c The version number and information about this
Eric Allman
-(Version 8.130, last update 11/10/96 11:15:30)
+(Version 8.132, last update 12/1/96 09:34:37)
diff --git a/usr.sbin/sendmail/src/clock.c b/usr.sbin/sendmail/src/clock.c
index 39862f1..281ee60 100644
--- a/usr.sbin/sendmail/src/clock.c
+++ b/usr.sbin/sendmail/src/clock.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)clock.c 8.13 (Berkeley) 2/21/96";
+static char sccsid[] = "@(#)clock.c 8.16 (Berkeley) 11/27/96";
#endif /* not lint */
# include "sendmail.h"
@@ -98,8 +98,8 @@ setevent(intvl, func, arg)
*evp = ev;
if (tTd(5, 5))
- printf("setevent: intvl=%ld, for=%ld, func=%x, arg=%d, ev=%x\n",
- intvl, now + intvl, func, arg, ev);
+ printf("setevent: intvl=%ld, for=%ld, func=%lx, arg=%d, ev=%lx\n",
+ intvl, now + intvl, (u_long) func, arg, (u_long) ev);
tick(0);
return (ev);
@@ -124,7 +124,7 @@ clrevent(ev)
register EVENT **evp;
if (tTd(5, 5))
- printf("clrevent: ev=%x\n", ev);
+ printf("clrevent: ev=%lx\n", (u_long) ev);
if (ev == NULL)
return;
@@ -191,8 +191,9 @@ tick(arg)
ev = EventQueue;
EventQueue = EventQueue->ev_link;
if (tTd(5, 6))
- printf("tick: ev=%x, func=%x, arg=%d, pid=%d\n", ev,
- ev->ev_func, ev->ev_arg, ev->ev_pid);
+ printf("tick: ev=%lx, func=%lx, arg=%d, pid=%d\n",
+ (u_long) ev, (u_long) ev->ev_func,
+ ev->ev_arg, ev->ev_pid);
/* we must be careful in here because ev_func may not return */
f = ev->ev_func;
@@ -211,17 +212,7 @@ tick(arg)
/* restore signals so that we can take ticks while in ev_func */
(void) setsignal(SIGALRM, tick);
-#ifdef SIG_UNBLOCK
- /* unblock SIGALRM signal */
- sigemptyset(&ss);
- sigaddset(&ss, SIGALRM);
- sigprocmask(SIG_UNBLOCK, &ss, NULL);
-#else
-#if HASSIGSETMASK
- /* reset 4.2bsd signal mask to allow future alarms */
- (void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM));
-#endif /* HASSIGSETMASK */
-#endif /* SIG_UNBLOCK */
+ (void) releasesignal(SIGALRM);
/* call ev_func */
errno = olderrno;
@@ -262,12 +253,17 @@ SLEEP_T
sleep(intvl)
unsigned int intvl;
{
+ int was_held;
+
if (intvl == 0)
return (SLEEP_T) 0;
SleepDone = FALSE;
(void) setevent((time_t) intvl, endsleep, 0);
+ was_held = releasesignal(SIGALRM);
while (!SleepDone)
pause();
+ if (was_held > 0)
+ blocksignal(SIGALRM);
return (SLEEP_T) 0;
}
diff --git a/usr.sbin/sendmail/src/convtime.c b/usr.sbin/sendmail/src/convtime.c
index 807ae6c..65994f8 100644
--- a/usr.sbin/sendmail/src/convtime.c
+++ b/usr.sbin/sendmail/src/convtime.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)convtime.c 8.7 (Berkeley) 9/15/96";
+static char sccsid[] = "@(#)convtime.c 8.8 (Berkeley) 11/24/96";
#endif /* not lint */
# include "sendmail.h"
@@ -149,7 +149,10 @@ pintvl(intvl, brief)
hr = intvl % 24;
intvl /= 24;
if (brief)
+ {
dy = intvl;
+ wk = 0;
+ }
else
{
dy = intvl % 7;
diff --git a/usr.sbin/sendmail/src/envelope.c b/usr.sbin/sendmail/src/envelope.c
index 80e5ce6..6781522 100644
--- a/usr.sbin/sendmail/src/envelope.c
+++ b/usr.sbin/sendmail/src/envelope.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.96 (Berkeley) 11/11/96";
+static char sccsid[] = "@(#)envelope.c 8.99 (Berkeley) 12/1/96";
#endif /* not lint */
#include "sendmail.h"
@@ -110,7 +110,7 @@ dropenvelope(e, fulldrop)
{
extern void printenvflags();
- printf("dropenvelope %x: id=", e);
+ printf("dropenvelope %lx: id=", (u_long) e);
xputs(e->e_id);
printf(", flags=");
printenvflags(e);
@@ -168,8 +168,8 @@ dropenvelope(e, fulldrop)
queueit = TRUE;
#if XDEBUG
else if (bitset(QQUEUEUP, q->q_flags))
- syslog(LOG_DEBUG, "%s: q_flags = %x",
- e->e_id, q->q_flags);
+ syslog(LOG_DEBUG, "dropenvelope: %s: q_flags = %x, paddr = %s",
+ e->e_id, q->q_flags, q->q_paddr);
#endif
/* see if a notification is needed */
@@ -349,7 +349,7 @@ simpledrop:
}
else if (queueit || !bitset(EF_INQUEUE, e->e_flags))
{
-#ifdef QUEUE
+#if QUEUE
queueup(e, FALSE);
#else /* QUEUE */
syserr("554 dropenvelope: queueup");
diff --git a/usr.sbin/sendmail/src/err.c b/usr.sbin/sendmail/src/err.c
index 199fdd8..2e0f0b91 100644
--- a/usr.sbin/sendmail/src/err.c
+++ b/usr.sbin/sendmail/src/err.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)err.c 8.50 (Berkeley) 9/20/96";
+static char sccsid[] = "@(#)err.c 8.52 (Berkeley) 12/1/96";
#endif /* not lint */
# include "sendmail.h"
@@ -432,7 +432,7 @@ putoutmsg(msg, holdmsg, heldmsg)
else
fprintf(OutChannel, "%s\n", &msg[4]);
if (TrafficLogFile != NULL)
- fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(),
+ fprintf(TrafficLogFile, "%05d >>> %s\n", (int) getpid(),
(OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]);
if (msg[3] == ' ')
(void) fflush(OutChannel);
@@ -631,7 +631,7 @@ errstring(errnum)
extern char *sys_errlist[];
extern int sys_nerr;
# endif
-# ifdef SMTP
+# if SMTP
extern char *SmtpPhase;
# endif /* SMTP */
diff --git a/usr.sbin/sendmail/src/makesendmail b/usr.sbin/sendmail/src/makesendmail
index 1b266c3..838d891 100644
--- a/usr.sbin/sendmail/src/makesendmail
+++ b/usr.sbin/sendmail/src/makesendmail
@@ -32,7 +32,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)makesendmail 8.41 (Berkeley) 9/23/96
+# @(#)makesendmail 8.42 (Berkeley) 11/10/96
#
#
@@ -109,6 +109,13 @@ in
esac
# tweak operating system type and release
+node=`uname -n | sed -e 's/\//-/g' -e 's/ //g'`
+if [ "$os" = "$node" -a "$arch" = "i386" -a "$rel" = 3.2 -a "`uname -v`" = 2 ]
+then
+ # old versions of SCO UNIX set uname -s the same as uname -n
+ os=SCO_SV
+fi
+
case $os
in
DYNIX-ptx) os=PTX;;
diff --git a/usr.sbin/sendmail/src/map.c b/usr.sbin/sendmail/src/map.c
index 34e6fce..1b0f086 100644
--- a/usr.sbin/sendmail/src/map.c
+++ b/usr.sbin/sendmail/src/map.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.144 (Berkeley) 11/16/96";
+static char sccsid[] = "@(#)map.c 8.146 (Berkeley) 11/24/96";
#endif /* not lint */
#include "sendmail.h"
@@ -1323,7 +1323,8 @@ db_map_store(map, lhs, rhs)
data.size = data.size + old.size + 1;
data.data = buf;
if (tTd(38, 9))
- printf("db_map_store append=%s\n", data.data);
+ printf("db_map_store append=%s\n",
+ (char *) data.data);
}
}
stat = db->put(db, &key, &data, 0);
@@ -1344,7 +1345,7 @@ db_map_close(map)
register DB *db = map->map_db2;
if (tTd(38, 9))
- printf("db_map_close(%s, %s, %x)\n",
+ printf("db_map_close(%s, %s, %lx)\n",
map->map_mname, map->map_file, map->map_mflags);
if (bitset(MF_WRITABLE, map->map_mflags))
@@ -3406,7 +3407,7 @@ impl_map_close(map)
MAP *map;
{
if (tTd(38, 9))
- printf("impl_map_close(%s, %s, %x)\n",
+ printf("impl_map_close(%s, %s, %lx)\n",
map->map_mname, map->map_file, map->map_mflags);
#ifdef NEWDB
if (bitset(MF_IMPL_HASH, map->map_mflags))
@@ -3598,6 +3599,7 @@ prog_map_lookup(map, name, av, statp)
printf(" %s", argv[i]);
printf("\n");
}
+ (void) blocksignal(SIGCHLD);
pid = prog_open(argv, &fd, CurEnv);
if (pid < 0)
{
@@ -3646,6 +3648,7 @@ prog_map_lookup(map, name, av, statp)
/* wait for the process to terminate */
close(fd);
stat = waitfor(pid);
+ (void) releasesignal(SIGCHLD);
if (stat == -1)
{
diff --git a/usr.sbin/sendmail/src/mci.c b/usr.sbin/sendmail/src/mci.c
index 18e951a..a81e61de 100644
--- a/usr.sbin/sendmail/src/mci.c
+++ b/usr.sbin/sendmail/src/mci.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)mci.c 8.46 (Berkeley) 11/3/96";
+static char sccsid[] = "@(#)mci.c 8.54 (Berkeley) 12/1/96";
#endif /* not lint */
#include "sendmail.h"
@@ -114,8 +114,8 @@ mci_cache(mci)
mci_uncache(mcislot, TRUE);
if (tTd(42, 5))
- printf("mci_cache: caching %x (%s) in slot %d\n",
- mci, mci->mci_host, mcislot - MciCache);
+ printf("mci_cache: caching %lx (%s) in slot %d\n",
+ (u_long) mci, mci->mci_host, mcislot - MciCache);
#ifdef LOG
if (tTd(91, 100))
syslog(LOG_DEBUG, "%s: mci_cache: caching %x (%.100s) in slot %d",
@@ -214,8 +214,8 @@ mci_uncache(mcislot, doquit)
mci_unlock_host(mci);
if (tTd(42, 5))
- printf("mci_uncache: uncaching %x (%s) from slot %d (%d)\n",
- mci, mci->mci_host, mcislot - MciCache, doquit);
+ printf("mci_uncache: uncaching %lx (%s) from slot %d (%d)\n",
+ (u_long) mci, mci->mci_host, mcislot - MciCache, doquit);
#ifdef LOG
if (tTd(91, 100))
syslog(LOG_DEBUG, "%s: mci_uncache: uncaching %x (%.100s) from slot %d (%d)",
@@ -223,7 +223,7 @@ mci_uncache(mcislot, doquit)
mci, mci->mci_host, mcislot - MciCache, doquit);
#endif
-#ifdef SMTP
+#if SMTP
if (doquit)
{
message("Closing connection to %s", mci->mci_host);
@@ -289,7 +289,7 @@ mci_get(host, m)
register MCI *mci;
register STAB *s;
-#ifdef DAEMON
+#if DAEMON
extern SOCKADDR CurHostAddr;
/* clear CurHostAddr so we don't get a bogus address with this name */
@@ -314,7 +314,7 @@ mci_get(host, m)
mci->mci_exitstat, mci->mci_errno);
}
-#ifdef SMTP
+#if SMTP
if (mci->mci_state == MCIS_OPEN)
{
extern int smtpprobe __P((MCI *));
@@ -329,7 +329,7 @@ mci_get(host, m)
mci->mci_exitstat = EX_OK;
mci->mci_state = MCIS_CLOSED;
}
-# ifdef DAEMON
+# if DAEMON
else
{
/* get peer host address for logging reasons only */
@@ -377,7 +377,10 @@ mci_setstat(mci, xstat, dstat, rstat)
char *dstat;
char *rstat;
{
- mci->mci_exitstat = xstat;
+ /* protocol errors should never be interpreted as sticky */
+ if (xstat != EX_NOTSTICKY && xstat != EX_PROTOCOL)
+ mci->mci_exitstat = xstat;
+
mci->mci_status = dstat;
if (mci->mci_rstatus != NULL)
free(mci->mci_rstatus);
@@ -672,7 +675,6 @@ mci_load_persistent(mci)
{
int saveErrno = errno;
FILE *fp;
- int status;
char fname[MAXPATHLEN+1];
if (mci == NULL)
@@ -682,7 +684,7 @@ mci_load_persistent(mci)
return;
}
- if (HostStatDir == NULL || mci->mci_host == NULL)
+ if (IgnoreHostStatus || HostStatDir == NULL || mci->mci_host == NULL)
return;
if (tTd(56, 1))
@@ -750,7 +752,7 @@ mci_read_persistent(fp, mci)
syserr("mci_read_persistent: NULL mci");
if (tTd(56, 93))
{
- printf("mci_read_persistent: fp=%x, mci=", fp);
+ printf("mci_read_persistent: fp=%lx, mci=", (u_long) fp);
mci_dump(mci, FALSE);
}
@@ -760,6 +762,7 @@ mci_read_persistent(fp, mci)
mci->mci_rstatus = NULL;
rewind(fp);
+ ver = -1;
while (fgets(buf, sizeof buf, fp) != NULL)
{
p = strchr(buf, '\n');
@@ -806,6 +809,8 @@ mci_read_persistent(fp, mci)
return -1;
}
}
+ if (ver < 0)
+ return -1;
return 0;
}
/*
@@ -868,7 +873,6 @@ mci_store_persistent(mci)
fflush(mci->mci_statfile);
-cleanup:
errno = saveErrno;
return;
}
@@ -903,7 +907,7 @@ mci_traverse_persistent(action, pathname)
{
struct stat statbuf;
DIR *d;
- int ret = 0;
+ int ret;
if (pathname == NULL)
pathname = HostStatDir;
@@ -961,13 +965,17 @@ mci_traverse_persistent(action, pathname)
/*
** The following appears to be
- ** necessary during purgest, since
+ ** necessary during purges, since
** we modify the directory structure
*/
if (action == mci_purge_persistent)
rewinddir(d);
}
+
+ /* purge (or whatever) the directory proper */
+ *--newptr = '\0';
+ ret = (*action)(newpath, NULL);
closedir(d);
}
else if (S_ISREG(statbuf.st_mode))
@@ -1031,12 +1039,14 @@ mci_print_persistent(pathname, hostname)
{
static int initflag = FALSE;
FILE *fp;
- int status;
int width = Verbose ? 78 : 25;
bool locked;
- char *p;
MCI mcib;
+ /* skip directories */
+ if (hostname == NULL)
+ return 0;
+
if (!initflag)
{
initflag = TRUE;
@@ -1101,6 +1111,7 @@ mci_print_persistent(pathname, hostname)
** Parameters:
** pathname -- path to the status file.
** hostname -- name of host corresponding to that file.
+** NULL if this is a directory (domain).
**
** Returns:
** 0
@@ -1116,43 +1127,30 @@ mci_purge_persistent(pathname, hostname)
if (tTd(56, 1))
printf("mci_purge_persistent: purging %s\n", pathname);
- /* remove the file */
- if (unlink(pathname) < 0)
+ if (hostname != NULL)
{
- if (tTd(56, 2))
- printf("mci_purge_persistent: failed to unlink %s: %s\n",
- pathname, errstring(errno));
- return -1;
+ /* remove the file */
+ if (unlink(pathname) < 0)
+ {
+ if (tTd(56, 2))
+ printf("mci_purge_persistent: failed to unlink %s: %s\n",
+ pathname, errstring(errno));
+ }
}
-
- /*
- ** remove empty parent directories.
- */
-
- for (;;)
+ else
{
- while (*end != '/')
- end--;
- *(end--) = '\0';
-
+ /* remove the directory */
if (*end != '.')
- break;
+ return 0;
if (tTd(56, 1))
printf("mci_purge_persistent: dpurge %s\n", pathname);
if (rmdir(pathname) < 0)
{
- if (errno == ENOENT || errno == EEXIST)
- break; /* directory is not empty */
-#ifdef ENOTEMTPY
- if (errno == ENOTEMPTY)
- break; /* BSDism */
-#endif
if (tTd(56, 2))
printf("mci_purge_persistent: rmdir %s: %s\n",
pathname, errstring(errno));
- break;
}
}
diff --git a/usr.sbin/sendmail/src/queue.c b/usr.sbin/sendmail/src/queue.c
index 299a016..5d00b9f 100644
--- a/usr.sbin/sendmail/src/queue.c
+++ b/usr.sbin/sendmail/src/queue.c
@@ -35,17 +35,17 @@
# include "sendmail.h"
#ifndef lint
-#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 8.131 (Berkeley) 11/8/96 (with queueing)";
+#if QUEUE
+static char sccsid[] = "@(#)queue.c 8.145 (Berkeley) 12/2/96 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.131 (Berkeley) 11/8/96 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.145 (Berkeley) 12/2/96 (without queueing)";
#endif
#endif /* not lint */
# include <errno.h>
# include <dirent.h>
-# ifdef QUEUE
+# if QUEUE
/*
** Work queue.
@@ -195,7 +195,7 @@ queueup(e, announce)
if (!bitset(EF_HAS_DF, e->e_flags))
{
- register FILE *dfp;
+ register FILE *dfp = NULL;
char dfname[20];
struct stat stbuf;
@@ -300,8 +300,9 @@ queueup(e, announce)
{
#if XDEBUG
if (bitset(QQUEUEUP, q->q_flags))
- syslog(LOG_DEBUG, "%s: q_flags = %x",
- e->e_id, q->q_flags);
+ syslog(LOG_DEBUG,
+ "dropenvelope: %s: q_flags = %x, paddr = %s",
+ e->e_id, q->q_flags, q->q_paddr);
#endif
continue;
}
@@ -474,7 +475,6 @@ printctladdr(a, tfp)
{
char *uname;
char *paddr;
- register struct passwd *pw;
register ADDRESS *q;
uid_t uid;
gid_t gid;
@@ -531,9 +531,10 @@ printctladdr(a, tfp)
** forkflag -- TRUE if the queue scanning should be done in
** a child process. We double-fork so it is not our
** child and we don't have to clean up after it.
+** verbose -- if TRUE, print out status information.
**
** Returns:
-** none.
+** TRUE if the queue run successfully began.
**
** Side Effects:
** runs things in the mail queue.
@@ -541,15 +542,17 @@ printctladdr(a, tfp)
ENVELOPE QueueEnvelope; /* the queue run envelope */
-void
-runqueue(forkflag)
+bool
+runqueue(forkflag, verbose)
bool forkflag;
+ bool verbose;
{
register ENVELOPE *e;
int njobs;
int sequenceno = 0;
extern ENVELOPE BlankEnvelope;
extern void clrdaemon __P((void));
+ extern void runqueueevent __P((bool));
/*
** If no work will ever be selected, don't even bother reading
@@ -562,15 +565,15 @@ runqueue(forkflag)
{
char *msg = "Skipping queue run -- load average too high";
- if (Verbose)
- printf("%s\n", msg);
+ if (verbose)
+ message("458 %s\n", msg);
#ifdef LOG
if (LogLevel > 8)
syslog(LOG_INFO, "runqueue: %s", msg);
#endif
if (forkflag && QueueIntvl != 0)
- (void) setevent(QueueIntvl, runqueue, TRUE);
- return;
+ (void) setevent(QueueIntvl, runqueueevent, TRUE);
+ return FALSE;
}
/*
@@ -584,27 +587,49 @@ runqueue(forkflag)
#ifdef SIGCHLD
extern void reapchild();
+ blocksignal(SIGCHLD);
(void) setsignal(SIGCHLD, reapchild);
#endif
pid = dofork();
+ if (pid == -1)
+ {
+ const char *msg = "Skipping queue run -- fork() failed";
+ const char *err = errstring(errno);
+
+ if (verbose)
+ message("458 %s: %s\n", msg, err);
+#ifdef LOG
+ if (LogLevel > 8)
+ syslog(LOG_INFO, "runqueue: %s: %s", msg, err);
+#endif
+ if (QueueIntvl != 0)
+ (void) setevent(QueueIntvl, runqueueevent, TRUE);
+ (void) releasesignal(SIGCHLD);
+ return FALSE;
+ }
if (pid != 0)
{
/* parent -- pick up intermediate zombie */
#ifndef SIGCHLD
(void) waitfor(pid);
#else
+ (void) blocksignal(SIGALRM);
proc_list_add(pid);
+ (void) releasesignal(SIGALRM);
+ releasesignal(SIGCHLD);
#endif /* SIGCHLD */
if (QueueIntvl != 0)
- (void) setevent(QueueIntvl, runqueue, TRUE);
- return;
+ (void) setevent(QueueIntvl, runqueueevent, TRUE);
+ return TRUE;
}
/* child -- double fork and clean up signals */
+ proc_list_clear();
#ifndef SIGCHLD
if (fork() != 0)
exit(EX_OK);
#else /* SIGCHLD */
+ releasesignal(SIGCHLD);
(void) setsignal(SIGCHLD, SIG_DFL);
#endif /* SIGCHLD */
(void) setsignal(SIGHUP, intsig);
@@ -623,7 +648,7 @@ runqueue(forkflag)
** Release any resources used by the daemon code.
*/
-# ifdef DAEMON
+# if DAEMON
clrdaemon();
# endif /* DAEMON */
@@ -660,7 +685,10 @@ runqueue(forkflag)
if (QueueLimitId != NULL || QueueLimitSender != NULL ||
QueueLimitRecipient != NULL)
- HostStatDir = NULL;
+ {
+ IgnoreHostStatus = TRUE;
+ MinQueueAge = 0;
+ }
/*
** Start making passes through the queue.
@@ -719,6 +747,20 @@ runqueue(forkflag)
/* exit without the usual cleanup */
e->e_id = NULL;
finis();
+ /*NOTREACHED*/
+ return TRUE;
+}
+
+
+/*
+** RUNQUEUEEVENT -- stub for use in setevent
+*/
+
+void
+runqueueevent(forkflag)
+ bool forkflag;
+{
+ (void) runqueue(forkflag, FALSE);
}
/*
** ORDERQ -- order the work queue.
@@ -1257,7 +1299,7 @@ workcmpf3(a, b)
if (a->w_ctime > b->w_ctime)
return 1;
else if (a->w_ctime < b->w_ctime)
- return 1;
+ return -1;
else
return 0;
}
@@ -1340,6 +1382,7 @@ dowork(id, forkflag, requeueflag, e)
disconnect(1, e);
OpMode = MD_DELIVER;
}
+ setproctitle("%s: from queue", id);
# ifdef LOG
if (LogLevel > 76)
syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
@@ -2054,7 +2097,8 @@ queuename(e, type)
e->e_id = newstr(&qf[2]);
define('i', e->e_id, e);
if (tTd(7, 1))
- printf("queuename: assigned id %s, env=%x\n", e->e_id, e);
+ printf("queuename: assigned id %s, env=%lx\n",
+ e->e_id, (u_long) e);
if (tTd(7, 9))
{
printf(" lockfd=");
diff --git a/usr.sbin/sendmail/src/stab.c b/usr.sbin/sendmail/src/stab.c
index 5f707b1..a9d8736 100644
--- a/usr.sbin/sendmail/src/stab.c
+++ b/usr.sbin/sendmail/src/stab.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stab.c 8.9 (Berkeley) 10/17/96";
+static char sccsid[] = "@(#)stab.c 8.10 (Berkeley) 11/23/96";
#endif /* not lint */
# include "sendmail.h"
@@ -131,7 +131,7 @@ stab(name, type, op)
printf("entered\n");
/* determine size of new entry */
-#ifdef FFR_MEMORY_MISER
+#ifdef _FFR_MEMORY_MISER
if (type >= ST_MCI)
len = sizeof s->s_mci;
else
diff --git a/usr.sbin/sendmail/src/version.c b/usr.sbin/sendmail/src/version.c
index 8a53f29..617e11a 100644
--- a/usr.sbin/sendmail/src/version.c
+++ b/usr.sbin/sendmail/src/version.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)version.c 8.8.3.2 (Berkeley) 11/16/96";
+static char sccsid[] = "@(#)version.c 8.8.4.4 (Berkeley) 12/2/96";
#endif /* not lint */
-char Version[] = "8.8.3";
+char Version[] = "8.8.4";
OpenPOWER on IntegriCloud