diff options
author | Lennart Poettering <lennart@poettering.net> | 2003-08-25 15:23:14 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2003-08-25 15:23:14 +0000 |
commit | 92629d8551b7b798ff35e5e4739f0cf47489dec8 (patch) | |
tree | 56cd4b5ca3b7e76a12790dc7858375800829eef2 /src/pam_dotfile.c | |
parent | 0c64290eb8cb21a1c4bdd02196371e2bd7364de9 (diff) |
exim fix
git-svn-id: file:///home/lennart/svn/public/pam_dotfile/trunk@17 5391d09e-f7c1-0310-8aa1-84a1c93f5a38
Diffstat (limited to 'src/pam_dotfile.c')
-rw-r--r-- | src/pam_dotfile.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pam_dotfile.c b/src/pam_dotfile.c index 5223f90..405f494 100644 --- a/src/pam_dotfile.c +++ b/src/pam_dotfile.c @@ -90,6 +90,8 @@ static int _fork_authentication(context_t *c, const char *username, const char * }; char * envp[] = { NULL }; + close(p[1]); + if (p[0] != 0 && dup2(p[0], 0) != 0) { logmsg(c, LOG_ERR, "dup2(): %s", strerror(errno)); exit(2); @@ -97,8 +99,9 @@ static int _fork_authentication(context_t *c, const char *username, const char * close(1); close(2); - close(p[0]); - close(p[1]); + + if (p[0] != 0) + close(p[0]); if (open("/dev/null", O_WRONLY) != 1) { logmsg(c, LOG_ERR, "open(\"/dev/null\", O_WRONLY): %s", strerror(errno)); |