diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-10 19:13:29 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-10 19:13:29 +0000 |
commit | 5f6aa7d613017c9571204cb962e27744598ef521 (patch) | |
tree | f73486886a3127cd05534b847b6a3912502db7ef /usr.sbin/smtpd/smtpd.c | |
parent | d22a9a817c515acc064d7766ce700069ff3db84d (diff) |
run external mda with cwd set to $HOME or /; ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/smtpd.c')
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index f687dbc0364..31f173f0f33 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.47 2009/03/10 19:09:29 jacekm Exp $ */ +/* $OpenBSD: smtpd.c,v 1.48 2009/03/10 19:13:28 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -1141,6 +1141,9 @@ parent_external_mda(char *path, struct passwd *pw, struct batch *batchp) if (dup2(pipefd[0], STDIN_FILENO) == -1) fatal("dup2"); + if (chdir(pw->pw_dir) == -1 && chdir("/") == -1) + fatal("chdir"); + if (closefrom(STDERR_FILENO + 1) == -1) fatal("closefrom"); |