From 92629d8551b7b798ff35e5e4739f0cf47489dec8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 25 Aug 2003 15:23:14 +0000 Subject: exim fix git-svn-id: file:///home/lennart/svn/public/pam_dotfile/trunk@17 5391d09e-f7c1-0310-8aa1-84a1c93f5a38 --- src/pam_dotfile.c | 7 +++++-- 1 file 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)); -- cgit