summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/src')
-rw-r--r--contrib/sendmail/src/conf.c80
-rw-r--r--contrib/sendmail/src/headers.c51
-rw-r--r--contrib/sendmail/src/mci.c20
-rw-r--r--contrib/sendmail/src/sendmail.817
4 files changed, 51 insertions, 117 deletions
diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c
index b164d29..be083b4 100644
--- a/contrib/sendmail/src/conf.c
+++ b/contrib/sendmail/src/conf.c
@@ -13,12 +13,9 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: conf.c,v 8.972.2.50 2003/09/03 21:37:03 ca Exp $")
+SM_RCSID("@(#)$Id: conf.c,v 8.972.2.35 2003/03/28 05:46:09 ca Exp $")
#include <sendmail/pathnames.h>
-#if NEWDB
-# include "sm/bdb.h"
-#endif /* NEWDB */
# include <sys/ioctl.h>
# include <sys/param.h>
@@ -468,19 +465,6 @@ setupmaps()
register STAB *s;
#if NEWDB
-# if DB_VERSION_MAJOR > 1
- int major_v, minor_v, patch_v;
-
- (void) db_version(&major_v, &minor_v, &patch_v);
- if (major_v != DB_VERSION_MAJOR || minor_v != DB_VERSION_MINOR)
- {
- errno = 0;
- syserr("Berkeley DB version mismatch: compiled against %d.%d.%d, run-time linked against %d.%d.%d",
- DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
- major_v, minor_v, patch_v);
- }
-# endif /* DB_VERSION_MAJOR > 1 */
-
MAPDEF("hash", ".db", MCF_ALIASOK|MCF_REBUILDABLE,
map_parseargs, hash_map_open, db_map_close,
db_map_lookup, db_map_store);
@@ -2243,7 +2227,7 @@ refuseconnections(name, e, d, active)
sm_setproctitle(true, e, R_MSG_LA, name, CurrentLA);
if (LogLevel > 8)
sm_syslog(LOG_NOTICE, NOQID, R_MSG_LA, name, CurrentLA);
-# if _FFR_REJECT_LOG
+#if _FFR_REJECT_LOG
now = curtime();
if (firstrejtime[d] == 0)
{
@@ -2256,13 +2240,13 @@ refuseconnections(name, e, d, active)
pintvl(now - firstrejtime[d], true));
nextlogtime[d] = now + RejectLogInterval;
}
-# endif /* _FFR_REJECT_LOG */
+#endif /* _FFR_REJECT_LOG */
return true;
}
-# if _FFR_REJECT_LOG
+#if _FFR_REJECT_LOG
else
firstrejtime[d] = 0;
-# endif /* _FFR_REJECT_LOG */
+#endif /* _FFR_REJECT_LOG */
if (DelayLA > 0 && CurrentLA >= DelayLA)
{
@@ -2444,12 +2428,12 @@ initsetproctitle(argc, argv, envp)
*/
align = -1;
-# if _FFR_SPT_ALIGN
-# ifdef SPT_ALIGN_SIZE
+#if _FFR_SPT_ALIGN
+# ifdef SPT_ALIGN_SIZE
for (i = SPT_ALIGN_SIZE; i > 0; i >>= 1)
align++;
-# endif /* SPT_ALIGN_SIZE */
-# endif /* _FFR_SPT_ALIGN */
+# endif /* SPT_ALIGN_SIZE */
+#endif /* _FFR_SPT_ALIGN */
for (i = 0; i < argc; i++)
{
@@ -2834,6 +2818,25 @@ uname(name)
return 0;
}
+# if 0
+ /*
+ ** Popen is known to have security holes.
+ */
+
+ /* try uuname -l to return local name */
+ if ((file = popen("uuname -l", "r")) != NULL)
+ {
+ (void) sm_io_fgets(file, SM_TIME_DEFAULT, name,
+ NODE_LENGTH + 1);
+ (void) pclose(file);
+ n = strchr(name, '\n');
+ if (n != NULL)
+ *n = '\0';
+ if (name->nodename[0] != '\0')
+ return 0;
+ }
+# endif /* 0 */
+
return -1;
}
#endif /* !HASUNAME */
@@ -4730,7 +4733,7 @@ load_if_names()
# ifndef __hpux
lifc.lifc_family = AF_UNSPEC;
lifc.lifc_flags = 0;
-# endif /* ! __hpux */
+# endif /* __hpux */
if (ioctl(s, SIOCGLIFCONF, (char *)&lifc) < 0)
{
if (tTd(0, 4))
@@ -5675,9 +5678,6 @@ char *OsCompileOptions[] =
#if ADDRCONFIG_IS_BROKEN
"ADDRCONFIG_IS_BROKEN",
#endif /* ADDRCONFIG_IS_BROKEN */
-#if ALLOW_255
- "ALLOW_255",
-#endif /* ALLOW_255 */
#ifdef AUTO_NETINFO_HOSTS
"AUTO_NETINFO_HOSTS",
#endif /* AUTO_NETINFO_HOSTS */
@@ -5929,10 +5929,6 @@ char *FFRCompileOptions[] =
/* Stricter checks about queue directory permissions. */
"_FFR_CHK_QUEUE",
#endif /* _FFR_CHK_QUEUE */
-#if _FFR_CLIENT_SIZE
- /* Don't try to send mail if its size exceeds SIZE= of server. */
- "_FFR_CLIENT_SIZE",
-#endif /* _FFR_CLIENT_SIZE */
#if _FFR_CONTROL_MSTAT
/* Extended daemon status. */
"_FFR_CONTROL_MSTAT",
@@ -5993,10 +5989,6 @@ char *FFRCompileOptions[] =
"_FFR_DROP_TRUSTUSER_WARNING",
#endif /* _FFR_DROP_TRUSTUSER_WARNING */
-#if _FFR_EXTRA_MAP_CHECK
- /* perform extra checks on $( $) in R lines */
- "_FFR_EXTRA_MAP_CHECK",
-#endif /* _FFR_EXTRA_MAP_CHECK */
#if _FFR_FIX_DASHT
/*
** If using -t, force not sending to argv recipients, even
@@ -6034,10 +6026,6 @@ char *FFRCompileOptions[] =
/* Use nsswitch on HP-UX */
"_FFR_HPUX_NSSWITCH",
#endif /* _FFR_HPUX_NSSWITCH */
-#if _FFR_IGNORE_BOGUS_ADDR
- /* Ignore addresses for which prescan() failed */
- "_FFR_IGNORE_BOGUS_ADDR",
-#endif /* _FFR_IGNORE_BOGUS_ADDR */
#if _FFR_IGNORE_EXT_ON_HELO
/* Ignore extensions offered in response to HELO */
"_FFR_IGNORE_EXT_ON_HELO",
@@ -6061,16 +6049,12 @@ char *FFRCompileOptions[] =
/* Randall S. Winchester of the University of Maryland */
"_FFR_MAX_FORWARD_ENTRIES",
#endif /* _FFR_MAX_FORWARD_ENTRIES */
-#if _FFR_MAX_SLEEP_TIME
- /* Limit sleep(2) time in libsm/clock.c */
- "_FFR_MAX_SLEEP_TIME",
-#endif /* _FFR_MAX_SLEEP_TIME */
#if MILTER
# if _FFR_MILTER_421
/* If a filter returns 421, close the SMTP connection */
"_FFR_MILTER_421",
# endif /* _FFR_MILTER_421 */
-# if _FFR_MILTER_PERDAEMON
+# if _FFR_MILTER_PERDAEMON
/* Per DaemonPortOptions InputMailFilter lists */
"_FFR_MILTER_PERDAEMON",
# endif /* _FFR_MILTER_PERDAEMON */
@@ -6160,10 +6144,6 @@ char *FFRCompileOptions[] =
/* Donated code (unused). */
"_FFR_SHM_STATUS",
#endif /* _FFR_SHM_STATUS */
-#if _FFR_SLEEP_USE_SELECT
- /* Use select(2) in libsm/clock.c to emulate sleep(2) */
- "_FFR_SLEEP_USE_SELECT ",
-#endif /* _FFR_SLEEP_USE_SELECT */
#if _FFR_SMFI_OPENSOCKET
/* libmilter: smfi_opensocket() to force the socket open early */
"_FFR_SMFI_OPENSOCKET",
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c
index dd871ea..890c280 100644
--- a/contrib/sendmail/src/headers.c
+++ b/contrib/sendmail/src/headers.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: headers.c,v 8.266.4.7 2003/09/03 21:32:20 ca Exp $")
+SM_RCSID("@(#)$Id: headers.c,v 8.266.4.5 2003/03/12 22:42:52 gshapiro Exp $")
static size_t fix_mime_header __P((HDR *, ENVELOPE *));
static int priencode __P((char *));
@@ -140,10 +140,7 @@ chompheader(line, pflag, hdrp, e)
mid = (unsigned char) macid(p);
if (bitset(0200, mid))
- {
p += strlen(macname(mid)) + 2;
- SM_ASSERT(p <= q);
- }
else
p++;
@@ -318,7 +315,6 @@ hse:
qval[l++] = '"';
/* - 3 to avoid problems with " at the end */
- /* should be sizeof(qval), not MAXNAME */
for (k = 0; fvalue[k] != '\0' && l < MAXNAME - 3; k++)
{
switch (fvalue[k])
@@ -1179,7 +1175,7 @@ crackaddr(addr, e)
else if (c == ')')
{
/* syntax error: unmatched ) */
- if (copylev > 0 && SM_HAVE_ROOM && bp > bufhead)
+ if (copylev > 0 && SM_HAVE_ROOM)
bp--;
}
@@ -1353,7 +1349,7 @@ crackaddr(addr, e)
else if (SM_HAVE_ROOM)
{
/* syntax error: unmatched > */
- if (copylev > 0 && bp > bufhead)
+ if (copylev > 0)
bp--;
quoteit = true;
continue;
@@ -1697,12 +1693,6 @@ put_vanilla_header(h, v, mci)
int l;
l = nlp - v;
-
- /*
- ** XXX This is broken for SPACELEFT()==0
- ** However, SPACELEFT() is always > 0 unless MAXLINE==1.
- */
-
if (SPACELEFT(obuf, obp) - 1 < (size_t) l)
l = SPACELEFT(obuf, obp) - 1;
@@ -1713,8 +1703,6 @@ put_vanilla_header(h, v, mci)
if (*v != ' ' && *v != '\t')
*obp++ = ' ';
}
-
- /* XXX This is broken for SPACELEFT()==0 */
(void) sm_snprintf(obp, SPACELEFT(obuf, obp), "%.*s",
(int) (SPACELEFT(obuf, obp) - 1), v);
putxline(obuf, strlen(obuf), mci, putflags);
@@ -1749,7 +1737,6 @@ commaize(h, p, oldstyle, mci, e)
int omax;
bool firstone = true;
int putflags = PXLF_HEADER;
- char **res;
char obuf[MAXLINE + 3];
/*
@@ -1766,8 +1753,6 @@ commaize(h, p, oldstyle, mci, e)
obp = obuf;
(void) sm_snprintf(obp, SPACELEFT(obuf, obp), "%.200s: ",
h->h_field);
-
- /* opos = strlen(obp); */
opos = strlen(h->h_field) + 2;
if (opos > 202)
opos = 202;
@@ -1800,23 +1785,14 @@ commaize(h, p, oldstyle, mci, e)
while ((isascii(*p) && isspace(*p)) || *p == ',')
p++;
name = p;
- res = NULL;
for (;;)
{
auto char *oldp;
char pvpbuf[PSBUFSIZE];
- res = prescan(p, oldstyle ? ' ' : ',', pvpbuf,
- sizeof pvpbuf, &oldp, NULL);
+ (void) prescan(p, oldstyle ? ' ' : ',', pvpbuf,
+ sizeof pvpbuf, &oldp, NULL);
p = oldp;
-#if _FFR_IGNORE_BOGUS_ADDR
- /* ignore addresses that can't be parsed */
- if (res == NULL)
- {
- name = p;
- continue;
- }
-#endif /* _FFR_IGNORE_BOGUS_ADDR */
/* look to see if we have an at sign */
while (*p != '\0' && isascii(*p) && isspace(*p))
@@ -1839,15 +1815,6 @@ commaize(h, p, oldstyle, mci, e)
p--;
if (++p == name)
continue;
-
- /*
- ** if prescan() failed go a bit backwards; this is a hack,
- ** there should be some better error recovery.
- */
-
- if (res == NULL && p > name &&
- !((isascii(*p) && isspace(*p)) || *p == ',' || *p == '\0'))
- --p;
savechar = *p;
*p = '\0';
@@ -1891,7 +1858,7 @@ commaize(h, p, oldstyle, mci, e)
(void) sm_strlcpy(obp, ",\n", SPACELEFT(obuf, obp));
putxline(obuf, strlen(obuf), mci, putflags);
obp = obuf;
- (void) sm_strlcpy(obp, " ", sizeof obuf);
+ (void) sm_strlcpy(obp, " ", sizeof obp);
opos = strlen(obp);
obp += opos;
opos += strlen(name);
@@ -1907,10 +1874,7 @@ commaize(h, p, oldstyle, mci, e)
firstone = false;
*p = savechar;
}
- if (obp < &obuf[sizeof obuf])
- *obp = '\0';
- else
- obuf[sizeof obuf - 1] = '\0';
+ *obp = '\0';
putxline(obuf, strlen(obuf), mci, putflags);
}
/*
@@ -1982,7 +1946,6 @@ fix_mime_header(h, e)
return 0;
/* Split on each ';' */
- /* find_character() never returns NULL */
while ((end = find_character(begin, ';')) != NULL)
{
char save = *end;
diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c
index b8c0de2..033387b 100644
--- a/contrib/sendmail/src/mci.c
+++ b/contrib/sendmail/src/mci.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: mci.c,v 8.205.2.4 2003/03/31 17:35:27 ca Exp $")
+SM_RCSID("@(#)$Id: mci.c,v 8.205.2.3 2003/01/07 03:56:19 ca Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@@ -548,21 +548,11 @@ mci_dump(mci, logit)
}
(void) sm_snprintf(p, SPACELEFT(buf, p), "flags=%lx", mci->mci_flags);
p += strlen(p);
-
- /*
- ** The following check is just for paranoia. It protects the
- ** assignment in the if() clause. If there's not some minimum
- ** amount of space we can stop right now. The check will not
- ** trigger as long as sizeof(buf)=4000.
- */
-
- if (p >= buf + sizeof(buf) - 4)
- goto printit;
if (mci->mci_flags != 0)
{
struct mcifbits *f;
- *p++ = '<'; /* protected above */
+ *p++ = '<';
for (f = MciFlags; f->mcif_bit != 0; f++)
{
if (!bitset(f->mcif_bit, mci->mci_flags))
@@ -1162,7 +1152,7 @@ mci_traverse_persistent(action, pathname)
if (hostptr != host)
*(hostptr++) = '.';
start = end;
- while (start > pathname && *(start - 1) != '/')
+ while (*(start - 1) != '/')
start--;
if (*end == '.')
@@ -1172,7 +1162,7 @@ mci_traverse_persistent(action, pathname)
*(hostptr++) = *scan;
end = start - 2;
- } while (end > pathname && *end == '.');
+ } while (*end == '.');
*hostptr = '\0';
@@ -1362,7 +1352,7 @@ mci_purge_persistent(pathname, hostname)
/*
** MCI_GENERATE_PERSISTENT_PATH -- generate path from hostname
**
-** Given `host', convert from a.b.c to $HostStatDir/c./b./a,
+** Given `host', convert from a.b.c to $QueueDir/.hoststat/c./b./a,
** putting the result into `path'. if `createflag' is set, intervening
** directories will be created as needed.
**
diff --git a/contrib/sendmail/src/sendmail.8 b/contrib/sendmail/src/sendmail.8
index eb67358..1c014fd 100644
--- a/contrib/sendmail/src/sendmail.8
+++ b/contrib/sendmail/src/sendmail.8
@@ -9,9 +9,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: sendmail.8,v 8.51.2.1 2003/05/20 16:38:15 gshapiro Exp $
+.\" $Id: sendmail.8,v 8.51 2002/05/24 15:42:13 ca Exp $
.\"
-.TH SENDMAIL 8 "$Date: 2003/05/20 16:38:15 $"
+.TH SENDMAIL 8 "$Date: 2001/03/23 22:10:00 $"
.SH NAME
sendmail
\- an electronic mail transport agent
@@ -295,21 +295,21 @@ Process jobs in queue group called
.I name
only.
.TP
-\fB\-q\fR[\fI!\fR]I\fIsubstr\fR
+\fB\-q\fR[\fI!\fR]I substr
Limit processed jobs to those containing
.I substr
as a substring of the queue id or not when
.I !
is specified.
.TP
-\fB\-q\fR[\fI!\fR]R\fIsubstr\fR
+\fB\-q\fR[\fI!\fR]R substr
Limit processed jobs to those containing
.I substr
as a substring of one of the recipients or not when
.I !
is specified.
.TP
-\fB\-q\fR[\fI!\fR]S\fIsubstr\fR
+\fB\-q\fR[\fI!\fR]S substr
Limit processed jobs to those containing
.I substr
as a substring of the sender or not when
@@ -687,13 +687,13 @@ collected statistics
/var/spool/mqueue/*
temp files
.SH SEE ALSO
-binmail(1),
mail(1),
-rmail(1),
syslog(3),
aliases(5),
mailaddr(7),
-rc(8)
+mail.local(8),
+rc(8),
+rmail(8)
.PP
DARPA
Internet Request For Comments
@@ -709,3 +709,4 @@ The
.B sendmail
command appeared in
4.2BSD.
+.\" $FreeBSD$
OpenPOWER on IntegriCloud