summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mailwrapper
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-01-10 01:25:53 +0000
committerimp <imp@FreeBSD.org>2000-01-10 01:25:53 +0000
commitb725362b4dad4ca62b7928b9edccff9956c0c1ac (patch)
tree1abbc8b3eff2d3676797c5935415ea08e2c5a0ee /usr.sbin/mailwrapper
parentd4409da21099a58aef95304ae121d7dd16935d28 (diff)
downloadFreeBSD-src-b725362b4dad4ca62b7928b9edccff9956c0c1ac.zip
FreeBSD-src-b725362b4dad4ca62b7928b9edccff9956c0c1ac.tar.gz
Fix mysterious sendmail coredump on systems where malloc.conf pointed to
a string containign 'J'. o Properly terminate argv list with a NULL entry. o Use warn() to report the exec failure because free could change errno and err would report the wrong reason. o Don't terminate string to err with ':' since this results in two colons.
Diffstat (limited to 'usr.sbin/mailwrapper')
-rw-r--r--usr.sbin/mailwrapper/mailwrapper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c
index f1ddcdb..536ec71 100644
--- a/usr.sbin/mailwrapper/mailwrapper.c
+++ b/usr.sbin/mailwrapper/mailwrapper.c
@@ -78,7 +78,7 @@ addarg(al, arg, copy)
}
if (copy) {
if ((al->argv[al->argc++] = strdup(arg)) == NULL)
- err(1, "mailwrapper:");
+ err(1, "mailwrapper");
} else
al->argv[al->argc++] = (char *)arg;
}
@@ -152,10 +152,12 @@ main(argc, argv, envp)
(void)fclose(config);
+ al.argv[al.argc] = NULL;
execve(to, al.argv, envp);
+ warn("mailwrapper: execing %s", to);
freearg(&al, 0);
free(line);
- err(1, "mailwrapper: execing %s", to);
+ exit(1);
/*NOTREACHED*/
parse_error:
freearg(&al, 0);
OpenPOWER on IntegriCloud