SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 8.38
SCCS-vsn: usr.sbin/sendmail/src/headers.c 8.50
SCCS-vsn: usr.sbin/sendmail/src/macro.c 8.10
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.91
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 8.52
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 8.58
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 8.103
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 8.56
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 8.74
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.56
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.74
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.130
SCCS-vsn: usr.sbin/sendmail/src/queue.c 8.68
SCCS-vsn: usr.sbin/sendmail/src/alias.c 8.39
14 files changed:
# include <pwd.h>
#ifndef lint
# include <pwd.h>
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.38 (Berkeley) %G%";
+static char sccsid[] = "@(#)alias.c 8.39 (Berkeley) %G%";
ep = strchr(pp, ':');
if (ep != NULL)
*ep = '\0';
ep = strchr(pp, ':');
if (ep != NULL)
*ep = '\0';
- expand(pp, buf, &buf[sizeof buf - 1], e);
+ expand(pp, buf, sizeof buf, e);
if (ep != NULL)
*ep++ = ':';
if (tTd(27, 3))
if (ep != NULL)
*ep++ = ':';
if (tTd(27, 3))
#ifndef lint
#ifdef DAEMON
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.73 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.74 (Berkeley) %G% (with daemon mode)";
-static char sccsid[] = "@(#)daemon.c 8.73 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.74 (Berkeley) %G% (without daemon mode)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
{
char jbuf[MAXHOSTNAMELEN];
{
char jbuf[MAXHOSTNAMELEN];
- expand("\201j", jbuf, &jbuf[sizeof jbuf - 1], CurEnv);
+ expand("\201j", jbuf, sizeof jbuf, CurEnv);
j_has_dot = strchr(jbuf, '.') != NULL;
}
#endif
j_has_dot = strchr(jbuf, '.') != NULL;
}
#endif
-static char sccsid[] = "@(#)deliver.c 8.129 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 8.130 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
break;
/* this entry is safe -- go ahead and process it */
break;
/* this entry is safe -- go ahead and process it */
- expand(*mvp, buf, &buf[sizeof buf], e);
+ expand(*mvp, buf, sizeof buf, e);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 3])
{
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 3])
{
- expand(*mvp, buf, &buf[sizeof buf], e);
+ expand(*mvp, buf, sizeof buf, e);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 2])
{
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV - 2])
{
while (!clever && *++mvp != NULL)
{
while (!clever && *++mvp != NULL)
{
- expand(*mvp, buf, &buf[sizeof buf], e);
+ expand(*mvp, buf, sizeof buf, e);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV])
syserr("554 deliver: pv overflow after $u for %s", pv[0]);
*pvp++ = newstr(buf);
if (pvp >= &pv[MAXPV])
syserr("554 deliver: pv overflow after $u for %s", pv[0]);
q = strchr(p, ':');
if (q != NULL)
*q = '\0';
q = strchr(p, ':');
if (q != NULL)
*q = '\0';
- expand(p, buf, &buf[sizeof buf], e);
+ expand(p, buf, sizeof buf, e);
if (q != NULL)
*q++ = ':';
if (tTd(11, 20))
if (q != NULL)
*q++ = ':';
if (tTd(11, 20))
char *bang;
char xbuf[MAXLINE];
char *bang;
char xbuf[MAXLINE];
- expand("\201g", buf, &buf[sizeof buf - 1], e);
+ expand("\201g", buf, sizeof buf, e);
bang = strchr(buf, '!');
if (bang == NULL)
{
bang = strchr(buf, '!');
if (bang == NULL)
{
}
}
# endif /* UGLYUUCP */
}
}
# endif /* UGLYUUCP */
- expand(template, buf, &buf[sizeof buf - 1], e);
+ expand(template, buf, sizeof buf, e);
putxline(buf, mci, FALSE);
}
\f/*
putxline(buf, mci, FALSE);
}
\f/*
-static char sccsid[] = "@(#)envelope.c 8.51 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 8.52 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
char nbuf[100];
SuprErrs = TRUE;
char nbuf[100];
SuprErrs = TRUE;
- expand("\201n", nbuf, &nbuf[sizeof nbuf], e);
+ expand("\201n", nbuf, sizeof nbuf, e);
if (parseaddr(from = newstr(nbuf), &e->e_from,
RF_COPYALL, ' ', NULL, e) == NULL &&
parseaddr(from = "postmaster", &e->e_from,
if (parseaddr(from = newstr(nbuf), &e->e_from,
RF_COPYALL, ' ', NULL, e) == NULL &&
parseaddr(from = "postmaster", &e->e_from,
-static char sccsid[] = "@(#)headers.c 8.49 (Berkeley) %G%";
+static char sccsid[] = "@(#)headers.c 8.50 (Berkeley) %G%";
#endif /* not lint */
# include <errno.h>
#endif /* not lint */
# include <errno.h>
char *oldg = macvalue('g', e);
define('g', p, e);
char *oldg = macvalue('g', e);
define('g', p, e);
- expand(fancy, buf, &buf[sizeof buf], e);
+ expand(fancy, buf, sizeof buf, e);
define('g', oldg, e);
fvalue = buf;
}
define('g', oldg, e);
fvalue = buf;
}
/* do early binding */
if (bitset(H_DEFAULT, h->h_flags))
{
/* do early binding */
if (bitset(H_DEFAULT, h->h_flags))
{
- expand(h->h_value, buf, &buf[sizeof buf], e);
+ expand(h->h_value, buf, sizeof buf, e);
if (buf[0] != '\0')
{
h->h_value = newstr(buf);
if (buf[0] != '\0')
{
h->h_value = newstr(buf);
p = h->h_value;
if (bitset(H_DEFAULT, h->h_flags))
{
p = h->h_value;
if (bitset(H_DEFAULT, h->h_flags))
{
- expand(p, buf, &buf[sizeof buf], e);
+ expand(p, buf, sizeof buf, e);
p = buf;
if (p == NULL || *p == '\0')
{
p = buf;
if (p == NULL || *p == '\0')
{
-static char sccsid[] = "@(#)macro.c 8.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)macro.c 8.10 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
** Parameters:
** s -- the string to expand.
** buf -- the place to put the expansion.
** Parameters:
** s -- the string to expand.
** buf -- the place to put the expansion.
-** buflim -- the buffer limit, i.e., the address
-** of the first byte after buf.
+** bufsize -- the size of the buffer.
** e -- envelope in which to work.
**
** Returns:
** e -- envelope in which to work.
**
** Returns:
-expand(s, buf, buflim, e)
+expand(s, buf, bufsize, e)
register char *s;
register char *buf;
register char *s;
register char *buf;
register ENVELOPE *e;
{
register char *xp;
register ENVELOPE *e;
{
register char *xp;
/* recurse as appropriate */
if (recurse)
{
/* recurse as appropriate */
if (recurse)
{
- expand(xbuf, buf, buflim, e);
+ expand(xbuf, buf, bufsize, e);
return;
}
/* copy results out */
return;
}
/* copy results out */
- i = buflim - buf - 1;
- if (i > xp - xbuf)
- i = xp - xbuf;
+ i = xp - xbuf;
+ if (i >= bufsize)
+ i = bufsize - 1;
bcopy(xbuf, buf, i);
buf[i] = '\0';
}
bcopy(xbuf, buf, i);
buf[i] = '\0';
}
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.90 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 8.91 (Berkeley) %G%";
#endif /* not lint */
#define _DEFINE
#endif /* not lint */
#define _DEFINE
}
/* our name for SMTP codes */
}
/* our name for SMTP codes */
- expand("\201j", jbuf, &jbuf[sizeof jbuf - 1], CurEnv);
+ expand("\201j", jbuf, sizeof jbuf, CurEnv);
MyHostName = jbuf;
if (strchr(jbuf, '.') == NULL)
message("WARNING: local host name (%s) is not qualified; fix $j in config file",
MyHostName = jbuf;
if (strchr(jbuf, '.') == NULL)
message("WARNING: local host name (%s) is not qualified; fix $j in config file",
-static char sccsid[] = "@(#)parseaddr.c 8.57 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c 8.58 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
char obuf[50];
firsttime = FALSE;
char obuf[50];
firsttime = FALSE;
- expand("\201o", obuf, &obuf[sizeof obuf - sizeof DELIMCHARS], CurEnv);
+ expand("\201o", obuf, sizeof obuf - sizeof DELIMCHARS, CurEnv);
strcat(obuf, DELIMCHARS);
for (p = obuf; *p != '\0'; p++)
{
strcat(obuf, DELIMCHARS);
for (p = obuf; *p != '\0'; p++)
{
/* need to make sure route-addrs have <angle brackets> */
if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
/* need to make sure route-addrs have <angle brackets> */
if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
- expand("<\201g>", buf, &buf[sizeof buf], e);
+ expand("<\201g>", buf, sizeof buf, e);
- expand(fancy, buf, &buf[sizeof buf], e);
+ expand(fancy, buf, sizeof buf, e);
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 8.67 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.68 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 8.67 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.68 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
/* expand macros; if null, don't output header at all */
if (bitset(H_DEFAULT, h->h_flags))
{
/* expand macros; if null, don't output header at all */
if (bitset(H_DEFAULT, h->h_flags))
{
- (void) expand(h->h_value, buf, &buf[sizeof buf], e);
+ (void) expand(h->h_value, buf, sizeof buf, e);
if (buf[0] == '\0')
continue;
}
if (buf[0] == '\0')
continue;
}
-static char sccsid[] = "@(#)readcf.c 8.73 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c 8.74 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
/* expand and save the LHS */
*p = '\0';
/* expand and save the LHS */
*p = '\0';
- expand(&bp[1], exbuf, &exbuf[sizeof exbuf], e);
+ expand(&bp[1], exbuf, sizeof exbuf, e);
rwp->r_lhs = prescan(exbuf, '\t', pvpbuf,
sizeof pvpbuf, NULL);
nfuzzy = 0;
rwp->r_lhs = prescan(exbuf, '\t', pvpbuf,
sizeof pvpbuf, NULL);
nfuzzy = 0;
while (*p != '\0' && *p != '\t')
p++;
*p = '\0';
while (*p != '\0' && *p != '\t')
p++;
*p = '\0';
- expand(q, exbuf, &exbuf[sizeof exbuf], e);
+ expand(q, exbuf, sizeof exbuf, e);
rwp->r_rhs = prescan(exbuf, '\t', pvpbuf,
sizeof pvpbuf, NULL);
if (rwp->r_rhs != NULL)
rwp->r_rhs = prescan(exbuf, '\t', pvpbuf,
sizeof pvpbuf, NULL);
if (rwp->r_rhs != NULL)
if (bp[0] == 'C')
{
mid = macid(&bp[1], &ep);
if (bp[0] == 'C')
{
mid = macid(&bp[1], &ep);
- expand(ep, exbuf, &exbuf[sizeof exbuf], e);
+ expand(ep, exbuf, sizeof exbuf, e);
-static char sccsid[] = "@(#)savemail.c 8.55 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 8.56 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
- expand("\201n", buf, &buf[sizeof buf - 1], e);
+ expand("\201n", buf, sizeof buf, 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("\201z/dead.letter", buf, &buf[sizeof buf - 1], e);
+ expand("\201z/dead.letter", buf, sizeof buf, e);
Verbose = TRUE;
message("Saving message in %s", buf);
Verbose = oldverb;
Verbose = TRUE;
message("Saving message in %s", buf);
Verbose = oldverb;
addheader("Subject", msg, ee);
/* fake up an address header for the from person */
addheader("Subject", msg, ee);
/* fake up an address header for the from person */
- expand("\201n", buf, &buf[sizeof buf - 1], e);
+ expand("\201n", buf, sizeof buf, e);
if (parseaddr(buf, &ee->e_from, RF_COPYALL|RF_SENDERADDR, '\0', NULL, e) == NULL)
{
syserr("553 Can't parse myself!");
if (parseaddr(buf, &ee->e_from, RF_COPYALL|RF_SENDERADDR, '\0', NULL, e) == NULL)
{
syserr("553 Can't parse myself!");
sprintf(buf, "The original message was received at %s",
arpadate(ctime(&e->e_parent->e_ctime)));
putline(buf, mci);
sprintf(buf, "The original message was received at %s",
arpadate(ctime(&e->e_parent->e_ctime)));
putline(buf, mci);
- expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
+ expand("from \201_", buf, sizeof buf, e->e_parent);
putline(buf, mci);
putline("", mci);
putline(buf, mci);
putline("", mci);
{
while (fgets(buf, sizeof buf, xfile) != NULL)
{
{
while (fgets(buf, sizeof buf, xfile) != NULL)
{
- expand(buf, buf, &buf[sizeof buf - 1], e);
+ expand(buf, buf, sizeof buf, e);
putline(buf, mci);
}
(void) fclose(xfile);
putline(buf, mci);
}
(void) fclose(xfile);
- expand(ErrMsgFile, buf, &buf[sizeof buf - 1], e);
+ expand(ErrMsgFile, buf, sizeof buf, e);
putline(buf, mci);
putline("", mci);
}
putline(buf, mci);
putline("", mci);
}
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)sendmail.h 8.102 (Berkeley) %G%
+ * @(#)sendmail.h 8.103 (Berkeley) %G%
# ifdef _DEFINE
# define EXTERN
# ifndef lint
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 8.102 %G%";
+static char SmailSccsId[] = "@(#)sendmail.h 8.103 %G%";
# endif
# else /* _DEFINE */
# define EXTERN extern
# endif
# else /* _DEFINE */
# define EXTERN extern
extern time_t curtime __P(());
extern bool transienterror __P((int));
extern const char *errstring __P((int));
extern time_t curtime __P(());
extern bool transienterror __P((int));
extern const char *errstring __P((int));
-extern void expand __P((char *, char *, char *, ENVELOPE *));
+extern void expand __P((char *, char *, size_t, ENVELOPE *));
extern void define __P((int, char *, ENVELOPE *));
extern char *macvalue __P((int, ENVELOPE *));
extern char *macname __P((int));
extern void define __P((int, char *, ENVELOPE *));
extern char *macvalue __P((int, ENVELOPE *));
extern char *macname __P((int));
-static char sccsid[] = "@(#)srvrsmtp.c 8.55 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.56 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)srvrsmtp.c 8.55 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.56 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
CurSmtpClient = CurHostName;
setproctitle("server %s startup", CurSmtpClient);
CurSmtpClient = CurHostName;
setproctitle("server %s startup", CurSmtpClient);
- expand("\201e", inp, &inp[sizeof inp], e);
+ expand("\201e", inp, sizeof inp, e);
if (BrokenSmtpPeers)
{
p = strchr(inp, '\n');
if (BrokenSmtpPeers)
{
p = strchr(inp, '\n');
-static char sccsid[] = "@(#)usersmtp.c 8.37 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.38 (Berkeley) %G% (with SMTP)";
-static char sccsid[] = "@(#)usersmtp.c 8.37 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.38 (Berkeley) %G% (without SMTP)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
!bitnset(M_NO_NULL_FROM, m->m_flags))
(void) strcpy(buf, "");
else
!bitnset(M_NO_NULL_FROM, m->m_flags))
(void) strcpy(buf, "");
else
- expand("\201g", buf, &buf[sizeof buf], e);
+ expand("\201g", buf, sizeof buf, e);
if (buf[0] == '<')
{
/* strip off <angle brackets> (put back on below) */
if (buf[0] == '<')
{
/* strip off <angle brackets> (put back on below) */