summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sendmail/src/main.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-23 00:20:00 +0000
committerpst <pst@FreeBSD.org>1995-02-23 00:20:00 +0000
commit37063bd4edb87b70b019d35bddf18209ab478c44 (patch)
treec2ec59123a60e285b451f58acfbedc78a4aab7f2 /usr.sbin/sendmail/src/main.c
parentbabe0fd0e29aedfa2e1d473fbb3dcec915a3b575 (diff)
downloadFreeBSD-src-37063bd4edb87b70b019d35bddf18209ab478c44.zip
FreeBSD-src-37063bd4edb87b70b019d35bddf18209ab478c44.tar.gz
Sendmail 8.6.10 update for security problems.
Imported on CSRG/V_8_6_10 branch. Obtained from: CSRG/Allman
Diffstat (limited to 'usr.sbin/sendmail/src/main.c')
-rw-r--r--usr.sbin/sendmail/src/main.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/usr.sbin/sendmail/src/main.c b/usr.sbin/sendmail/src/main.c
index e2af9df..d7923ea 100644
--- a/usr.sbin/sendmail/src/main.c
+++ b/usr.sbin/sendmail/src/main.c
@@ -39,7 +39,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.55 (Berkeley) 4/15/94";
+static char sccsid[] = "@(#)main.c 8.55.1.3 (Berkeley) 2/10/95";
#endif /* not lint */
#define _DEFINE
@@ -463,7 +463,11 @@ main(argc, argv, envp)
break;
case 'B': /* body type */
- CurEnv->e_bodytype = newstr(optarg);
+ if (strcasecmp(optarg, "7bit") == 0 ||
+ strcasecmp(optarg, "8bitmime") == 0)
+ CurEnv->e_bodytype = newstr(optarg);
+ else
+ usrerr("Illegal body type %s", optarg);
break;
case 'C': /* select configuration file (already done) */
@@ -486,7 +490,7 @@ main(argc, argv, envp)
ExitStat = EX_USAGE;
break;
}
- from = newstr(optarg);
+ from = newstr(denlstring(optarg));
if (strcmp(RealUserName, from) != 0)
warn_f_flag = j;
break;
@@ -516,11 +520,21 @@ main(argc, argv, envp)
case 'p': /* set protocol */
p = strchr(optarg, ':');
if (p != NULL)
+ {
*p++ = '\0';
+ if (*p != '\0')
+ {
+ ep = xalloc(strlen(p) + 1);
+ cleanstrcpy(ep, p, MAXNAME);
+ define('s', ep, CurEnv);
+ }
+ }
if (*optarg != '\0')
- define('r', newstr(optarg), CurEnv);
- if (p != NULL && *p != '\0')
- define('s', newstr(p), CurEnv);
+ {
+ ep = xalloc(strlen(optarg) + 1);
+ cleanstrcpy(ep, optarg, MAXNAME);
+ define('r', ep, CurEnv);
+ }
break;
case 'q': /* run queue files at intervals */
@@ -714,6 +728,10 @@ main(argc, argv, envp)
break;
}
+ /* full names can't have newlines */
+ if (FullName != NULL && strchr(FullName, '\n') != NULL)
+ FullName = newstr(denlstring(FullName));
+
/* do heuristic mode adjustment */
if (Verbose)
{
OpenPOWER on IntegriCloud