diff options
| author | Scott Long <scottl@FreeBSD.org> | 2020-11-14 18:01:14 +0000 |
|---|---|---|
| committer | Scott Long <scottl@FreeBSD.org> | 2020-11-14 18:01:14 +0000 |
| commit | 7ca0d5403ede7308269e39f201fdd08cf5a3fe54 (patch) | |
| tree | adb93742f119551a2e682dca15a0013367b5da04 /usr.sbin/mailwrapper | |
| parent | 98b76d2227cb9b951cc6f006e2c78f243344f1bc (diff) | |
Notes
Diffstat (limited to 'usr.sbin/mailwrapper')
| -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 8a9ec220a26b..083949f266df 100644 --- a/usr.sbin/mailwrapper/mailwrapper.c +++ b/usr.sbin/mailwrapper/mailwrapper.c @@ -105,8 +105,10 @@ main(int argc, char *argv[], char *envp[]) initarg(&al); addarg(&al, argv[0]); - snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf", - getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE); + if ((len = getlocalbase(localmailerconf, MAXPATHLEN)) != 0) + err(EX_OSERR, "cannot determine local path"); + + strlcat(localmailerconf, "/etc/mail/mailer.conf", MAXPATHLEN - len); mailerconf = localmailerconf; if ((config = fopen(localmailerconf, "r")) == NULL) |
