diff options
author | Warner Losh <imp@FreeBSD.org> | 2000-01-10 01:25:53 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2000-01-10 01:25:53 +0000 |
commit | 59536d28923974d91f133dd596980517846684f2 (patch) | |
tree | 921068bc8418903fb2fbb0babfb467c27db57cd0 /usr.sbin/mailwrapper/mailwrapper.c | |
parent | cf60e8e4bf442e10aeb65803cfcbdb1cd3a875e3 (diff) | |
download | src-59536d28923974d91f133dd596980517846684f2.tar.gz src-59536d28923974d91f133dd596980517846684f2.zip |
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.
Notes
Notes:
svn path=/head/; revision=55698
Diffstat (limited to 'usr.sbin/mailwrapper/mailwrapper.c')
-rw-r--r-- | usr.sbin/mailwrapper/mailwrapper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c index f1ddcdb82341..536ec7106cf1 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); |