diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2000-11-25 04:40:55 +0000 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2000-11-25 04:40:55 +0000 |
commit | c5d2c9e20e5c6f42750c42397898ab0f1291544b (patch) | |
tree | e69c0fc438d59b04a0cc6aebdcd70dea5220a4dc /modules/pam_pwdb | |
parent | 4ea47216da66274357b14d5d7488ccbde27d75c4 (diff) | |
download | pam-c5d2c9e20e5c6f42750c42397898ab0f1291544b.tar.gz pam-c5d2c9e20e5c6f42750c42397898ab0f1291544b.tar.bz2 pam-c5d2c9e20e5c6f42750c42397898ab0f1291544b.zip |
Relevant BUGIDs: 123399
Purpose of commit: bugfix
Commit summary:
---------------
avoid possibility of SIGPIPE from helper binary non-invocation or
early exit.
Diffstat (limited to 'modules/pam_pwdb')
-rw-r--r-- | modules/pam_pwdb/support.-c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/pam_pwdb/support.-c b/modules/pam_pwdb/support.-c index 2cbcb576..d43e0554 100644 --- a/modules/pam_pwdb/support.-c +++ b/modules/pam_pwdb/support.-c @@ -378,13 +378,14 @@ static int pwdb_run_helper_binary(pam_handle_t *pamh, const char *passwd) exit(PWDB_SUCCESS+1); } else if (child > 0) { /* wait for child */ - close(fds[0]); if (passwd != NULL) { /* send the password to the child */ write(fds[1], passwd, strlen(passwd)+1); passwd = NULL; } else { write(fds[1], "", 1); /* blank password */ } + close(fds[0]); /* we close this after the write because we want + to avoid a possible SIGPIPE. */ close(fds[1]); (void) waitpid(child, &retval, 0); /* wait for helper to complete */ retval = (retval == PWDB_SUCCESS) ? PAM_SUCCESS:PAM_AUTH_ERR; |