SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 6.10
SCCS-vsn: usr.sbin/sendmail/src/headers.c 6.7
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 6.10
SCCS-vsn: usr.sbin/sendmail/src/macro.c 6.5
SCCS-vsn: usr.sbin/sendmail/src/convtime.c 6.2
SCCS-vsn: usr.sbin/sendmail/src/main.c 6.18
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 6.15
SCCS-vsn: usr.sbin/sendmail/src/arpadate.c 6.6
SCCS-vsn: usr.sbin/sendmail/src/collect.c 6.4
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 6.12
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 6.6
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 6.8
SCCS-vsn: usr.sbin/sendmail/src/util.c 6.6
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 6.8
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 6.17
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.12
SCCS-vsn: usr.sbin/sendmail/src/conf.c 6.15
SCCS-vsn: usr.sbin/sendmail/src/alias.c 6.11
SCCS-vsn: usr.sbin/sendmail/src/udb.c 6.7
SCCS-vsn: usr.sbin/sendmail/src/map.c 6.5
20 files changed:
#ifndef lint
#ifdef NEWDB
#ifdef NDBM
#ifndef lint
#ifdef NEWDB
#ifdef NDBM
-static char sccsid[] = "@(#)alias.c 6.10 (Berkeley) %G% (with NEWDB and NDBM)";
+static char sccsid[] = "@(#)alias.c 6.11 (Berkeley) %G% (with NEWDB and NDBM)";
-static char sccsid[] = "@(#)alias.c 6.10 (Berkeley) %G% (with NEWDB)";
+static char sccsid[] = "@(#)alias.c 6.11 (Berkeley) %G% (with NEWDB)";
-static char sccsid[] = "@(#)alias.c 6.10 (Berkeley) %G% (with NDBM)";
+static char sccsid[] = "@(#)alias.c 6.11 (Berkeley) %G% (with NDBM)";
-static char sccsid[] = "@(#)alias.c 6.10 (Berkeley) %G% (without NEWDB or NDBM)";
+static char sccsid[] = "@(#)alias.c 6.11 (Berkeley) %G% (without NEWDB or NDBM)";
#endif
#endif
#endif /* not lint */
#endif
#endif
#endif /* not lint */
{
extern char *DelimChar;
{
extern char *DelimChar;
- while (isspace(*p) || *p == ',')
+ while ((isascii(*p) && isspace(*p)) ||
+ *p == ',')
p++;
if (*p == '\0')
break;
p++;
if (*p == '\0')
break;
define('u', user->q_user, e);
define('h', user->q_host, e);
if (ForwardPath == NULL)
define('u', user->q_user, e);
define('h', user->q_host, e);
if (ForwardPath == NULL)
- ForwardPath = newstr("\001z/.forward");
+ ForwardPath = newstr("\201z/.forward");
for (pp = ForwardPath; pp != NULL; pp = ep)
{
for (pp = ForwardPath; pp != NULL; pp = ep)
{
-static char sccsid[] = "@(#)arpadate.c 6.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)arpadate.c 6.6 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
/* now must have date */
tm.tm_mday = atoi(p);
/* now must have date */
tm.tm_mday = atoi(p);
- while (isdigit((int) *p)) /* skip over date */
+ while (isascii(*p) && isdigit(*p)) /* skip over date */
p++;
p = nextatom(p); /* point to month name */
for (tm.tm_mon = 0; MonthList[tm.tm_mon]; tm.tm_mon++)
p++;
p = nextatom(p); /* point to month name */
for (tm.tm_mon = 0; MonthList[tm.tm_mon]; tm.tm_mon++)
tm.tm_year += ((gmt->tm_year - tm.tm_year) / 100) * 100;
}
}
tm.tm_year += ((gmt->tm_year - tm.tm_year) / 100) * 100;
}
}
- while (isdigit((int) *p)) /* skip over year */
+ while (isascii(*p) && isdigit(*p)) /* skip over year */
- p = nextatom(p); /* hours */
+ p = nextatom(p); /* hours */
- while (isdigit((int) *p)) /* skip over hours */
+ while (isascii(*p) && isdigit(*p)) /* skip over hours */
- p = nextatom(p); /* colon */
+ p = nextatom(p); /* colon */
if (*p == ':')
p = nextatom(++p);
if (*p == ':')
p = nextatom(++p);
- p = nextatom(p); /* minutes */
+ p = nextatom(p); /* minutes */
- while (isdigit((int) *p)) /* skip over minutes */
+ while (isascii(*p) && isdigit(*p)) /* skip over minutes */
- p = nextatom(p); /* colon or zone */
- if (*p == ':') /* have seconds field */
+ p = nextatom(p); /* colon or zone */
+ if (*p == ':') /* have seconds field */
{
p = nextatom(++p);
tm.tm_sec = atoi(p);
{
p = nextatom(++p);
tm.tm_sec = atoi(p);
- while (isdigit((int) *p)) /* skip over seconds */
+ while (isascii(*p) && isdigit(*p)) /* skip over seconds */
- p = nextatom(p); /* zone */
+ p = nextatom(p); /* zone */
-static char sccsid[] = "@(#)collect.c 6.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)collect.c 6.4 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
p++;
while (*p == ' ')
p++;
p++;
while (*p == ' ')
p++;
- if (!isupper(*p) || p[3] != ' ' || p[13] != ':' || p[16] != ':')
+ if (!(isascii(*p) && isupper(*p)) ||
+ p[3] != ' ' || p[13] != ':' || p[16] != ':')
continue;
/* we have a possible date */
continue;
/* we have a possible date */
-static char sccsid[] = "@(#)conf.c 6.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 6.15 (Berkeley) %G%";
#endif /* not lint */
# include <sys/ioctl.h>
#endif /* not lint */
# include <sys/ioctl.h>
+ while (isascii(*p) && isspace(*p))
p++;
if (*p != '-')
break;
p++;
if (*p != '-')
break;
map->map_app = ++p;
break;
}
map->map_app = ++p;
break;
}
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
p++;
if (*p != '\0')
*p++ = '\0';
p++;
if (*p != '\0')
*p++ = '\0';
-static char sccsid[] = "@(#)convtime.c 6.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)convtime.c 6.2 (Berkeley) %G%";
#endif /* not lint */
# include <ctype.h>
#endif /* not lint */
# include <ctype.h>
while (*p != '\0')
{
t = 0;
while (*p != '\0')
{
t = 0;
- while (isdigit(c = *p++))
+ while (isascii(c = *p++) && isdigit(c))
t = t * 10 + (c - '0');
if (c == '\0')
p--;
t = t * 10 + (c - '0');
if (c == '\0')
p--;
-static char sccsid[] = "@(#)deliver.c 6.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 6.17 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
for (mvp = m->m_argv; (p = *++mvp) != NULL; )
{
for (mvp = m->m_argv; (p = *++mvp) != NULL; )
{
- while ((p = strchr(p, '\001')) != NULL)
- if (*++p == 'u')
- break;
- if (p != NULL)
+ /* can't use strchr here because of sign extension problems */
+ while (*p != '\0')
+ {
+ if ((*p++ & 0377) == MACROEXPAND)
+ {
+ if (*p == 'u')
+ break;
+ }
+ }
+
+ if (*p != '\0')
break;
/* this entry is safe -- go ahead and process it */
break;
/* this entry is safe -- go ahead and process it */
register MAILER *m;
ENVELOPE *e;
{
register MAILER *m;
ENVELOPE *e;
{
- char *template = "\001l\n";
+ char *template = "\201l\n";
char buf[MAXLINE];
extern char SentDate[];
char buf[MAXLINE];
extern char SentDate[];
char *bang;
char xbuf[MAXLINE];
char *bang;
char xbuf[MAXLINE];
- expand("\001<", buf, &buf[sizeof buf - 1], e);
+ expand("\201<", buf, &buf[sizeof buf - 1], e);
bang = strchr(buf, '!');
if (bang == NULL)
syserr("No ! in UUCP! (%s)", buf);
else
{
*bang++ = '\0';
bang = strchr(buf, '!');
if (bang == NULL)
syserr("No ! in UUCP! (%s)", buf);
else
{
*bang++ = '\0';
- (void) sprintf(xbuf, "From %s \001d remote from %s\n", bang, buf);
+ (void) sprintf(xbuf, "From %s \201d remote from %s\n", bang, buf);
#ifdef NAMED_BIND
if (myhostbuf[0] == '\0')
#ifdef NAMED_BIND
if (myhostbuf[0] == '\0')
- expand("\001j", myhostbuf, &myhostbuf[sizeof myhostbuf - 1], e);
+ expand("\201j", myhostbuf, &myhostbuf[sizeof myhostbuf - 1], e);
nmx = getmxrr(host, mxhosts, myhostbuf, &rcode);
if (nmx <= 0)
nmx = getmxrr(host, mxhosts, myhostbuf, &rcode);
if (nmx <= 0)
-static char sccsid[] = "@(#)headers.c 6.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c 6.7 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
return (0);
}
fvalue = &p[1];
return (0);
}
fvalue = &p[1];
+ while (isascii(*--p) && isspace(*p))
continue;
*++p = '\0';
makelower(fname);
continue;
*++p = '\0';
makelower(fname);
s++;
/* following technically violates RFC822 */
s++;
/* following technically violates RFC822 */
+ while (isascii(*s) && isspace(*s))
printf("crackaddr(%s)\n", addr);
/* strip leading spaces */
printf("crackaddr(%s)\n", addr);
/* strip leading spaces */
- while (*addr != '\0' && isspace(*addr))
+ while (*addr != '\0' && isascii(*addr) && isspace(*addr))
/* back up over the '<' and any spaces */
--p;
/* back up over the '<' and any spaces */
--p;
+ while (isascii(*--p) && isspace(*p))
putg:
if (copylev <= 0 && !putgmac)
{
putg:
if (copylev <= 0 && !putgmac)
{
*bp++ = 'g';
putgmac = TRUE;
}
*bp++ = 'g';
putgmac = TRUE;
}
*/
/* find end of name */
*/
/* find end of name */
- while (isspace(*p) || *p == ',')
+ while ((isascii(*p) && isspace(*p)) || *p == ',')
/* look to see if we have an at sign */
oldp = p;
/* look to see if we have an at sign */
oldp = p;
- while (*p != '\0' && isspace(*p))
+ while (*p != '\0' && isascii(*p) && isspace(*p))
p++;
if (*p != '@' && !isatword(p))
p++;
if (*p != '@' && !isatword(p))
break;
}
p += *p == '@' ? 1 : 2;
break;
}
p += *p == '@' ? 1 : 2;
- while (*p != '\0' && isspace(*p))
+ while (*p != '\0' && isascii(*p) && isspace(*p))
p++;
}
/* at the end of one complete name */
/* strip off trailing white space */
p++;
}
/* at the end of one complete name */
/* strip off trailing white space */
- while (p >= name && (isspace(*p) || *p == ',' || *p == '\0'))
+ while (p >= name &&
+ ((isascii(*p) && isspace(*p)) || *p == ',' || *p == '\0'))
p--;
if (++p == name)
continue;
p--;
if (++p == name)
continue;
extern char lower();
if (lower(p[0]) == 'a' && lower(p[1]) == 't' &&
extern char lower();
if (lower(p[0]) == 'a' && lower(p[1]) == 't' &&
- p[2] != '\0' && isspace(p[2]))
+ p[2] != '\0' && isascii(p[2]) && isspace(p[2]))
return (TRUE);
return (FALSE);
}
return (TRUE);
return (FALSE);
}
-static char sccsid[] = "@(#)macro.c 6.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)macro.c 6.5 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
{
case CONDIF: /* see if var set */
c = *++s;
{
case CONDIF: /* see if var set */
c = *++s;
- case '\001': /* macro interpolation */
+ case MACROEXPAND: /* macro interpolation */
c = *++s;
q = macvalue(c & 0177, e);
if (q == NULL)
c = *++s;
q = macvalue(c & 0177, e);
if (q == NULL)
/* copy to end of q or max space remaining in buf */
while ((c = *q++) != '\0' && xp < &xbuf[sizeof xbuf - 1])
{
/* copy to end of q or max space remaining in buf */
while ((c = *q++) != '\0' && xp < &xbuf[sizeof xbuf - 1])
{
- if (iscntrl(c) && !isspace(c))
+ /* check for any sendmail metacharacters */
+ if ((c & 0340) == 0200)
recurse = TRUE;
*xp++ = c;
}
recurse = TRUE;
*xp++ = c;
}
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 6.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 6.18 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
printf("> %s", buf);
if (buf[0] == '#')
continue;
printf("> %s", buf);
if (buf[0] == '#')
continue;
- for (p = buf; isspace(*p); p++)
+ for (p = buf; isascii(*p) && isspace(*p); p++)
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
-static char sccsid[] = "@(#)map.c 6.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)map.c 6.5 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
register char *p;
for (p = buf; *p != '\0'; p++)
register char *p;
for (p = buf; *p != '\0'; p++)
+ if (isascii(*p) && isupper(*p))
*p = tolower(*p);
}
if (bitset(MF_INCLNULL, map->map_flags))
*p = tolower(*p);
}
if (bitset(MF_INCLNULL, map->map_flags))
register char *p;
for (p = buf; *p != '\0'; p++)
register char *p;
for (p = buf; *p != '\0'; p++)
+ if (isascii(*p) && isupper(*p))
*p = tolower(*p);
}
if (bitset(MF_INCLNULL, map->map_flags))
*p = tolower(*p);
}
if (bitset(MF_INCLNULL, map->map_flags))
+ while (isascii(*p) && isspace(*p))
p++;
if (*p != '-')
break;
p++;
if (*p != '-')
break;
map->map_domain = ++p;
break;
}
map->map_domain = ++p;
break;
}
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
p++;
if (*p != '\0')
*p++ = 0;
p++;
if (*p != '\0')
*p++ = 0;
if (*p == '\0')
return NULL;
map->map_file = p;
if (*p == '\0')
return NULL;
map->map_file = p;
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
p++;
if (*p != '\0')
*p++ = '\0';
p++;
if (*p != '\0')
*p++ = '\0';
register char *p;
for (p = buf; *p != '\0'; p++)
register char *p;
for (p = buf; *p != '\0'; p++)
+ if (isascii(*p) && isupper(*p))
*p = tolower(*p);
}
if (yp_match(map->map_domain, map->map_file, buf, strlen(buf) + 1,
*p = tolower(*p);
}
if (yp_match(map->map_domain, map->map_file, buf, strlen(buf) + 1,
c = '%';
if (c == '%')
goto pushc;
c = '%';
if (c == '%')
goto pushc;
+ if (!(isascii(c) && isdigit(c)))
{
*bp++ = '%';
goto pushc;
{
*bp++ = '%';
goto pushc;
-static char sccsid[] = "@(#)parseaddr.c 6.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c 6.15 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
*/
/* following delimiters are inherent to the internal algorithms */
*/
/* following delimiters are inherent to the internal algorithms */
-# define DELIMCHARS "\001()<>,;\\\"\r\n" /* word delimiters */
+# define DELIMCHARS "\201()<>,;\\\"\r\n" /* word delimiters */
ADDRESS *
parseaddr(addr, a, copyf, delim, e)
ADDRESS *
parseaddr(addr, a, copyf, delim, e)
** See if we resolved to a real mailer.
*/
** See if we resolved to a real mailer.
*/
- if (pvp[0][0] != CANONNET)
+ if ((pvp[0][0] & 0377) != CANONNET)
{
setstat(EX_USAGE);
usrerr("cannot resolve name");
{
setstat(EX_USAGE);
usrerr("cannot resolve name");
{
for (; *addr != '\0'; addr++)
{
{
for (; *addr != '\0'; addr++)
{
- if (!isascii((int) *addr & 0377) ||
- !iscntrl(*addr) || isspace(*addr))
+ if ((*addr & 0340) != 0200)
continue;
setstat(EX_USAGE);
usrerr("Address contained invalid control characters");
continue;
setstat(EX_USAGE);
usrerr("Address contained invalid control characters");
- else if (delim == ' ' && isspace(c))
+ else if (delim == ' ' && isascii(c) && isspace(c))
c = ' ';
else if (c == ':' && !CurEnv->e_oldstyle)
{
c = ' ';
else if (c == ':' && !CurEnv->e_oldstyle)
{
{
static char buf[50];
static bool firstime = TRUE;
{
static char buf[50];
static bool firstime = TRUE;
if (firstime)
{
firstime = FALSE;
if (firstime)
{
firstime = FALSE;
- expand("\001o", buf, &buf[sizeof buf - 1], CurEnv);
+ expand("\201o", buf, &buf[sizeof buf - 1], CurEnv);
(void) strcat(buf, DELIMCHARS);
}
(void) strcat(buf, DELIMCHARS);
}
if (c == MATCHCLASS || c == MATCHREPL || c == MATCHNCLASS)
return (ONE);
#ifdef MACVALUE
if (c == MATCHCLASS || c == MATCHREPL || c == MATCHNCLASS)
return (ONE);
#ifdef MACVALUE
#endif /* MACVALUE */
if (c == '"')
return (QST);
#endif /* MACVALUE */
if (c == '"')
return (QST);
+ if ((c & 0340) == 0200)
+ return (OPR);
if (!isascii(c))
return (ATM);
if (isspace(c) || c == ')')
return (SPC);
if (!isascii(c))
return (ATM);
if (isspace(c) || c == ')')
return (SPC);
- if (iscntrl(c) || strchr(buf, c) != NULL)
+ if (strchr(buf, c) != NULL)
return (OPR);
return (ATM);
}
return (OPR);
return (ATM);
}
+ if ((*rp & 0377) == CANONUSER)
{
rvp++;
rwr = rwr->r_next;
nmatches = 0;
}
{
rvp++;
rwr = rwr->r_next;
nmatches = 0;
}
- else if (*rp == CANONHOST)
+ else if ((*rp & 0377) == CANONHOST)
- else if (*rp == CANONNET)
+ else if ((*rp & 0377) == CANONNET)
rwr = NULL;
/* substitute */
rwr = NULL;
/* substitute */
char begintype;
char db = '\0';
char begintype;
char db = '\0';
- if (**rvp != HOSTBEGIN && **rvp != LOOKUPBEGIN)
+ if ((**rvp & 0377) != HOSTBEGIN &&
+ (**rvp & 0377) != LOOKUPBEGIN)
begintype = **rvp;
hbrvp = rvp;
ubrvp = NULL;
begintype = **rvp;
hbrvp = rvp;
ubrvp = NULL;
- if (**rvp == HOSTBEGIN)
+ if ((**rvp & 0377) == HOSTBEGIN)
{
endtoken = HOSTEND;
mapname = "host";
{
endtoken = HOSTEND;
mapname = "host";
arg_rvp = argvect;
xpvp = NULL;
replac = pvpbuf;
arg_rvp = argvect;
xpvp = NULL;
replac = pvpbuf;
- while (*rvp != NULL && **rvp != endtoken)
+ while (*rvp != NULL && (**rvp & 0377) != endtoken)
+ int nodetype = **rvp & 0377;
if (nodetype != CANONHOST && nodetype != CANONUSER)
{
if (nodetype != CANONHOST && nodetype != CANONUSER)
{
tv++;
if (!strcasecmp(*tv, "error"))
{
tv++;
if (!strcasecmp(*tv, "error"))
{
- if (**++tv == CANONHOST)
+ if ((**++tv & 0377) == CANONHOST)
{
register struct errcodes *ep;
{
register struct errcodes *ep;
+ if (isascii(**++tv) && isdigit(**tv))
(void) strcat(buf, " ");
(void) strcat(buf, *tv);
}
(void) strcat(buf, " ");
(void) strcat(buf, *tv);
}
+ if ((**tv & 0377) != CANONUSER)
syserr("buildaddr: error: no user");
while (*++tv != NULL)
{
syserr("buildaddr: error: no user");
while (*++tv != NULL)
{
}
/* figure out the user */
}
/* figure out the user */
- if (*tv == NULL || **tv != CANONUSER)
+ if (*tv == NULL || (**tv & 0377) != CANONUSER)
{
syserr("buildaddr: no user");
return (NULL);
{
syserr("buildaddr: no user");
return (NULL);
*/
if (canonical || bitnset(M_NOCOMMENT, m->m_flags))
*/
if (canonical || bitnset(M_NOCOMMENT, m->m_flags))
else
fancy = crackaddr(name);
else
fancy = crackaddr(name);
- if (pvp[0] == NULL || pvp[0][0] != CANONNET)
+ if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET)
return;
/* if non-null, mailer destination specified -- has it changed? */
return;
/* if non-null, mailer destination specified -- has it changed? */
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 6.11 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 6.12 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 6.11 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 6.12 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
nullmailer.m_se_rwset = nullmailer.m_sh_rwset = -1;
nullmailer.m_eol = "\n";
nullmailer.m_se_rwset = nullmailer.m_sh_rwset = -1;
nullmailer.m_eol = "\n";
- define('g', "\001f", e);
+ define('g', "\201f", e);
for (h = e->e_header; h != NULL; h = h->h_link)
{
extern bool bitzerop();
for (h = e->e_header; h != NULL; h = h->h_link)
{
extern bool bitzerop();
-static char sccsid[] = "@(#)readcf.c 6.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c 6.8 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
- /* map $ into \001 (ASCII SOH) for macro expansion */
+ /* map $ into \201 for macro expansion */
for (p = bp; *p != '\0'; p++)
{
if (*p == '#' && p > bp && ConfigLevel >= 3)
for (p = bp; *p != '\0'; p++)
{
if (*p == '#' && p > bp && ConfigLevel >= 3)
/* this is an on-line comment */
register char *e;
/* this is an on-line comment */
register char *e;
/* it's from $# -- let it go through */
p++;
break;
/* it's from $# -- let it go through */
p++;
break;
default:
/* delete preceeding white space */
default:
/* delete preceeding white space */
- while (isspace(*p) && p > bp)
+ while (isascii(*p) && isspace(*p) && p > bp)
p--;
if ((e = strchr(++p, '\n')) != NULL)
(void) strcpy(p, e);
p--;
if ((e = strchr(++p, '\n')) != NULL)
(void) strcpy(p, e);
}
/* convert to macro expansion character */
}
/* convert to macro expansion character */
}
/* interpret this line */
}
/* interpret this line */
/* count the number of fuzzy matches in LHS */
for (ap = rwp->r_lhs; *ap != NULL; ap++)
{
/* count the number of fuzzy matches in LHS */
for (ap = rwp->r_lhs; *ap != NULL; ap++)
{
{
case MATCHZANY:
case MATCHANY:
{
case MATCHZANY:
case MATCHANY:
nfuzzy += '0';
for (ap = rwp->r_rhs; *ap != NULL; ap++)
{
nfuzzy += '0';
for (ap = rwp->r_rhs; *ap != NULL; ap++)
{
+ if ((**ap & 0377) != MATCHREPL)
continue;
if ((*ap)[1] <= '0' || (*ap)[1] > nfuzzy)
{
continue;
if ((*ap)[1] <= '0' || (*ap)[1] > nfuzzy)
{
if (bp[0] == 'F')
{
/* read from file */
if (bp[0] == 'F')
{
/* read from file */
- for (p = &bp[2]; *p != '\0' && !isspace(*p); p++)
+ for (p = &bp[2];
+ *p != '\0' && !(isascii(*p) && isspace(*p));
+ p++)
continue;
if (*p == '\0')
p = "%s";
else
{
*p = '\0';
continue;
if (*p == '\0')
p = "%s";
else
{
*p = '\0';
+ while (isascii(*++p) && isspace(*p))
continue;
}
fileclass(bp[1], &bp[2], p, safe);
continue;
}
fileclass(bp[1], &bp[2], p, safe);
register char *wd;
char delim;
register char *wd;
char delim;
- while (*p != '\0' && isspace(*p))
+ while (*p != '\0' && isascii(*p) && isspace(*p))
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
p++;
delim = *p;
*p = '\0';
p++;
delim = *p;
*p = '\0';
p = &bp[1];
while (*p != '\0')
{
p = &bp[1];
while (*p != '\0')
{
+ while (isascii(*p) && isspace(*p))
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
p++;
if (*p != '\0')
*p++ = '\0';
p++;
if (*p != '\0')
*p++ = '\0';
register char *q;
/* strip leading spaces */
register char *q;
/* strip leading spaces */
+ while (isascii(*p) && isspace(*p))
p++;
if (*p == '\0')
break;
/* find the end of the word */
q = p;
p++;
if (*p == '\0')
break;
/* find the end of the word */
q = p;
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
p++;
if (*p != '\0')
*p++ = '\0';
p++;
if (*p != '\0')
*p++ = '\0';
m->m_eol = "\n";
/* collect the mailer name */
m->m_eol = "\n";
/* collect the mailer name */
- for (p = line; *p != '\0' && *p != ',' && !isspace(*p); p++)
+ for (p = line; *p != '\0' && *p != ',' && !(isascii(*p) && isspace(*p)); p++)
continue;
if (*p != '\0')
*p++ = '\0';
continue;
if (*p != '\0')
*p++ = '\0';
/* now scan through and assign info from the fields */
while (*p != '\0')
{
/* now scan through and assign info from the fields */
while (*p != '\0')
{
- while (*p != '\0' && (*p == ',' || isspace(*p)))
+ while (*p != '\0' && (*p == ',' || (isascii(*p) && isspace(*p))))
p++;
/* p now points to field code */
p++;
/* p now points to field code */
syserr("mailer %s: `=' expected", m->m_name);
return;
}
syserr("mailer %s: `=' expected", m->m_name);
return;
}
+ while (isascii(*p) && isspace(*p))
p++;
/* p now points to the field body */
p++;
/* p now points to the field body */
case 'F': /* flags */
for (; *p != '\0'; p++)
case 'F': /* flags */
for (; *p != '\0'; p++)
+ if (!(isascii(*p) && isspace(*p)))
setbitn(*p, m->m_flags);
break;
setbitn(*p, m->m_flags);
break;
while (*p != '\0' && i < MAXPV)
{
q = p;
while (*p != '\0' && i < MAXPV)
{
q = p;
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
+ while (isascii(*p) && isspace(*p))
*p++ = '\0';
argv[i++] = newstr(q);
}
*p++ = '\0';
argv[i++] = newstr(q);
}
- while (*p != '\0' && !isspace(*p))
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
p++;
if (*p != '\0')
*p++ = '\0';
p++;
if (*p != '\0')
*p++ = '\0';
register STAB *map;
STAB *class;
register STAB *map;
STAB *class;
- for (p = line; isspace(*p); p++)
+ for (p = line; isascii(*p) && isspace(*p); p++)
+ if (!(isascii(*p) && isalnum(*p)))
{
syserr("readcf: config K line: no map name");
return;
}
mapname = p;
{
syserr("readcf: config K line: no map name");
return;
}
mapname = p;
+ while (isascii(*++p) && isalnum(*p))
continue;
if (*p != '\0')
*p++ = '\0';
continue;
if (*p != '\0')
*p++ = '\0';
+ while (isascii(*p) && isspace(*p))
+ if (!(isascii(*p) && isalnum(*p)))
{
syserr("readcf: config K line, map %s: no map class", mapname);
return;
}
classname = p;
{
syserr("readcf: config K line, map %s: no map class", mapname);
return;
}
classname = p;
+ while (isascii(*++p) && isalnum(*p))
continue;
if (*p != '\0')
*p++ = '\0';
continue;
if (*p != '\0')
*p++ = '\0';
+ while (isascii(*p) && isspace(*p))
p++;
/* look up the class */
p++;
/* look up the class */
-static char sccsid[] = "@(#)recipient.c 6.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c 6.10 (Berkeley) %G%";
#endif /* not lint */
# include <sys/types.h>
#endif /* not lint */
# include <sys/types.h>
extern char *DelimChar; /* defined in prescan */
/* parse the address */
extern char *DelimChar; /* defined in prescan */
/* parse the address */
- while (isspace(*p) || *p == ',')
+ while ((isascii(*p) && isspace(*p)) || *p == ',')
p++;
a = parseaddr(p, (ADDRESS *) NULL, 1, delimiter, e);
p = DelimChar;
p++;
a = parseaddr(p, (ADDRESS *) NULL, 1, delimiter, e);
p = DelimChar;
-static char sccsid[] = "@(#)savemail.c 6.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 6.6 (Berkeley) %G%";
#endif /* not lint */
# include <sys/types.h>
#endif /* not lint */
# include <sys/types.h>
- expand("\001n", buf, &buf[sizeof buf - 1], e);
+ expand("\201n", buf, &buf[sizeof buf - 1], e);
printf("\r\nMessage from %s...\r\n", buf);
printf("Errors occurred while sending mail.\r\n");
if (e->e_xfp != NULL)
printf("\r\nMessage from %s...\r\n", buf);
printf("Errors occurred while sending mail.\r\n");
if (e->e_xfp != NULL)
/* we have a home directory; open dead.letter */
define('z', p, e);
/* we have a home directory; open dead.letter */
define('z', p, e);
- expand("\001z/dead.letter", buf, &buf[sizeof buf - 1], e);
+ expand("\201z/dead.letter", buf, &buf[sizeof buf - 1], e);
Verbose = TRUE;
message(Arpa_Info, "Saving message in %s", buf);
Verbose = oldverb;
Verbose = TRUE;
message(Arpa_Info, "Saving message in %s", buf);
Verbose = oldverb;
- define('g', "\001f", e);
- define('<', "\001f", e);
+ define('g', "\201f", e);
+ define('<', "\201f", e);
ee = newenvelope(&errenvelope);
ee = newenvelope(&errenvelope);
- define('a', "\001b", ee);
+ define('a', "\201b", ee);
ee->e_puthdr = putheader;
ee->e_putbody = errbody;
ee->e_flags |= EF_RESPONSE;
ee->e_puthdr = putheader;
ee->e_putbody = errbody;
ee->e_flags |= EF_RESPONSE;
addheader("subject", buf, ee);
/* fake up an address header for the from person */
addheader("subject", buf, ee);
/* fake up an address header for the from person */
- expand("\001n", buf, &buf[sizeof buf - 1], e);
+ expand("\201n", buf, &buf[sizeof buf - 1], e);
ee->e_sender = ee->e_returnpath = newstr(buf);
if (parseaddr(buf, &ee->e_from, -1, '\0', e) == NULL)
{
ee->e_sender = ee->e_returnpath = newstr(buf);
if (parseaddr(buf, &ee->e_from, -1, '\0', e) == NULL)
{
/* push state into submessage */
CurEnv = ee;
/* push state into submessage */
CurEnv = ee;
- define('f', "\001n", ee);
+ define('f', "\201n", ee);
define('x', "Mail Delivery Subsystem", ee);
eatheader(ee, FALSE);
define('x', "Mail Delivery Subsystem", ee);
eatheader(ee, FALSE);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)sendmail.h 6.11 (Berkeley) %G%
+ * @(#)sendmail.h 6.12 (Berkeley) %G%
# ifdef _DEFINE
# define EXTERN
# ifndef lint
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 6.11 %G%";
+static char SmailSccsId[] = "@(#)sendmail.h 6.12 %G%";
# endif lint
# else /* _DEFINE */
# define EXTERN extern
# endif lint
# else /* _DEFINE */
# define EXTERN extern
*/
/* left hand side items */
*/
/* left hand side items */
-# define MATCHZANY '\020' /* match zero or more tokens */
-# define MATCHANY '\021' /* match one or more tokens */
-# define MATCHONE '\022' /* match exactly one token */
-# define MATCHCLASS '\023' /* match one token in a class */
-# define MATCHNCLASS '\024' /* match anything not in class */
-# define MATCHREPL '\025' /* replacement on RHS for above */
+# define MATCHZANY 0220 /* match zero or more tokens */
+# define MATCHANY 0221 /* match one or more tokens */
+# define MATCHONE 0222 /* match exactly one token */
+# define MATCHCLASS 0223 /* match one token in a class */
+# define MATCHNCLASS 0224 /* match anything not in class */
+# define MATCHREPL 0225 /* replacement on RHS for above */
# define MATCHLOOKUP '\035' /* look up and replace a sequence */
# define MATCHELOOKUP '\036' /* end of the sequence */
/* right hand side items */
# define MATCHLOOKUP '\035' /* look up and replace a sequence */
# define MATCHELOOKUP '\036' /* end of the sequence */
/* right hand side items */
-# define CANONNET '\026' /* canonical net, next token */
-# define CANONHOST '\027' /* canonical host, next token */
-# define CANONUSER '\030' /* canonical user, next N tokens */
-# define CALLSUBR '\031' /* call another rewriting set */
+# define CANONNET 0226 /* canonical net, next token */
+# define CANONHOST 0227 /* canonical host, next token */
+# define CANONUSER 0230 /* canonical user, next N tokens */
+# define CALLSUBR 0231 /* call another rewriting set */
/* conditionals in macros */
/* conditionals in macros */
-# define CONDIF '\032' /* conditional if-then */
-# define CONDELSE '\033' /* conditional else */
-# define CONDFI '\034' /* conditional fi */
+# define CONDIF 0232 /* conditional if-then */
+# define CONDELSE 0233 /* conditional else */
+# define CONDFI 0234 /* conditional fi */
/* bracket characters for host name lookup */
/* bracket characters for host name lookup */
-# define HOSTBEGIN '\035' /* hostname lookup begin */
-# define HOSTEND '\036' /* hostname lookup end */
+# define HOSTBEGIN 0235 /* hostname lookup begin */
+# define HOSTEND 0236 /* hostname lookup end */
/* bracket characters for generalized lookup */
/* bracket characters for generalized lookup */
-# define LOOKUPBEGIN '\005' /* generalized lookup begin */
-# define LOOKUPEND '\006' /* generalized lookup end */
+# define LOOKUPBEGIN 0205 /* generalized lookup begin */
+# define LOOKUPEND 0206 /* generalized lookup end */
-/* \001 is also reserved as the macro expansion character */
+/* macro substitution character */
+# define MACROEXPAND 0201 /* macro expansion */
/* external <==> internal mapping table */
struct metamac
/* external <==> internal mapping table */
struct metamac
-static char sccsid[] = "@(#)srvrsmtp.c 6.7 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 6.8 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)srvrsmtp.c 6.7 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 6.8 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
RealHostName = MyHostName;
CurHostName = RealHostName;
setproctitle("srvrsmtp %s", CurHostName);
RealHostName = MyHostName;
CurHostName = RealHostName;
setproctitle("srvrsmtp %s", CurHostName);
- expand("\001e", inp, &inp[sizeof inp], e);
+ expand("\201e", inp, &inp[sizeof inp], e);
message("220", "%s", inp);
SmtpPhase = "startup";
sendinghost = NULL;
message("220", "%s", inp);
SmtpPhase = "startup";
sendinghost = NULL;
fprintf(e->e_xfp, "<<< %s\n", inp);
/* break off command */
fprintf(e->e_xfp, "<<< %s\n", inp);
/* break off command */
- for (p = inp; isspace(*p); p++)
+ for (p = inp; isascii(*p) && isspace(*p); p++)
- while (*p != '\0' && !isspace(*p) && cmd < &cmdbuf[sizeof cmdbuf - 2])
+ while (*p != '\0' &&
+ !(isascii(*p) && isspace(*p)) &&
+ cmd < &cmdbuf[sizeof cmdbuf - 2])
*cmd++ = *p++;
*cmd = '\0';
/* throw away leading whitespace */
*cmd++ = *p++;
*cmd = '\0';
/* throw away leading whitespace */
+ while (isascii(*p) && isspace(*p))
p++;
/* decode command */
p++;
/* decode command */
register char *q;
/* find beginning of word */
register char *q;
/* find beginning of word */
+ while (isascii(*p) && isspace(*p))
p++;
q = p;
/* find end of word */
p++;
q = p;
/* find end of word */
- while (*p != '\0' && *p != ':' && !isspace(*p))
+ while (*p != '\0' && *p != ':' && !(isascii(*p) && isspace(*p)))
+ while (isascii(*p) && isspace(*p))
*p++ = '\0';
if (*p != ':')
{
*p++ = '\0';
if (*p != ':')
{
return (NULL);
}
*p++ = '\0';
return (NULL);
}
*p++ = '\0';
+ while (isascii(*p) && isspace(*p))
p++;
/* see if the input word matches desired word */
p++;
/* see if the input word matches desired word */
#ifndef lint
#ifdef USERDB
#ifndef lint
#ifdef USERDB
-static char sccsid [] = "@(#)udb.c 6.6 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c 6.7 (Berkeley) %G% (with USERDB)";
-static char sccsid [] = "@(#)udb.c 6.6 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c 6.7 (Berkeley) %G% (without USERDB)";
+ while (isascii(*spec) && isspace(*spec))
spec++;
spec_end = strchr(spec, ':');
if (spec_end != NULL)
spec++;
spec_end = strchr(spec, ':');
if (spec_end != NULL)
-static char sccsid[] = "@(#)usersmtp.c 6.9 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 6.10 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)usersmtp.c 6.9 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 6.10 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
mci->mci_state = MCIS_ACTIVE;
mci->mci_state = MCIS_ACTIVE;
- expand("\001<", buf, &buf[sizeof buf - 1], e);
+ expand("\201<", buf, &buf[sizeof buf - 1], e);
if (e->e_from.q_mailer == LocalMailer ||
!bitnset(M_FROMPATH, m->m_flags))
{
if (e->e_from.q_mailer == LocalMailer ||
!bitnset(M_FROMPATH, m->m_flags))
{
nmessage(Arpa_Info, "%s", SmtpReplyBuffer);
/* if continuation is required, we can go on */
nmessage(Arpa_Info, "%s", SmtpReplyBuffer);
/* if continuation is required, we can go on */
- if (SmtpReplyBuffer[3] == '-' || !isdigit(SmtpReplyBuffer[0]))
+ if (SmtpReplyBuffer[3] == '-' ||
+ !(isascii(SmtpReplyBuffer[0]) && isdigit(SmtpReplyBuffer[0])))
continue;
/* decode the reply code */
continue;
/* decode the reply code */
-static char sccsid[] = "@(#)util.c 6.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c 6.6 (Berkeley) %G%";
#endif /* not lint */
# include <stdio.h>
#endif /* not lint */
# include <stdio.h>
- while (!isalpha(*s) && *s != '\0')
+ while (!(isascii(*s) && isalpha(*s)) && *s != '\0')
*p++ = *s++;
if (*s == '\0')
break;
*p++ = toupper(*s);
s++;
*p++ = *s++;
if (*s == '\0')
break;
*p++ = toupper(*s);
s++;
+ while (isascii(*s) && isalpha(*s))
lower(c)
register char c;
{
lower(c)
register char c;
{
- return(isascii(c) && isupper(c) ? tolower(c) : c);
+ return((isascii(c) && isupper(c)) ? tolower(c) : c);
}
\f/*
** XPUTS -- put string doing control escapes.
}
\f/*
** XPUTS -- put string doing control escapes.
xputs(s)
register char *s;
{
xputs(s)
register char *s;
{
register struct metamac *mp;
extern struct metamac MetaMacros[];
register struct metamac *mp;
extern struct metamac MetaMacros[];
printf("<null>");
return;
}
printf("<null>");
return;
}
- while ((c = *s++) != '\0')
+ while ((c = (*s++ & 0377)) != '\0')
+ if (c == MATCHREPL || c == MACROEXPAND)
+ {
+ putchar('$');
+ continue;
+ }
+ for (mp = MetaMacros; mp->metaname != '\0'; mp++)
+ {
+ if ((mp->metaval & 0377) == c)
+ {
+ printf("$%c", mp->metaname);
+ break;
+ }
+ }
+ if (mp->metaname != '\0')
+ continue;
(void) putchar('\\');
c &= 0177;
}
(void) putchar('\\');
c &= 0177;
}
- if (c == MATCHREPL || c == '\001')
- {
- putchar('$');
- continue;
- }
- for (mp = MetaMacros; mp->metaname != '\0'; mp++)
- {
- if (mp->metaval == c)
- {
- printf("$%c", mp->metaname);
- c = '\0';
- break;
- }
- }
/* wasn't a meta-macro -- find another way to print it */
switch (c)
/* wasn't a meta-macro -- find another way to print it */
switch (c)