summaryrefslogtreecommitdiffstats
path: root/lib/libpam
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-09-19 11:33:03 +0000
committerdes <des@FreeBSD.org>2003-09-19 11:33:03 +0000
commitb9a4363200f14bcfc8acb1c47415febf1b8a8833 (patch)
treec48d328f4db97ec13bf4c90272c519591a1f872d /lib/libpam
parent21906911ceb5b156c06cf78f9831a1042ab0f844 (diff)
downloadFreeBSD-src-b9a4363200f14bcfc8acb1c47415febf1b8a8833.zip
FreeBSD-src-b9a4363200f14bcfc8acb1c47415febf1b8a8833.tar.gz
Ignore ECHILD from waitpid(2) (our child may have been reaped by the
calling process's SIGCHLD handler) PR: bin/45669
Diffstat (limited to 'lib/libpam')
-rw-r--r--lib/libpam/modules/pam_ssh/pam_ssh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libpam/modules/pam_ssh/pam_ssh.c b/lib/libpam/modules/pam_ssh/pam_ssh.c
index 29c4d5c..24f2c27 100644
--- a/lib/libpam/modules/pam_ssh/pam_ssh.c
+++ b/lib/libpam/modules/pam_ssh/pam_ssh.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/wait.h>
+#include <errno.h>
#include <fcntl.h>
#include <paths.h>
#include <pwd.h>
@@ -410,7 +411,7 @@ pam_sm_close_session(pam_handle_t *pamh, int flags __unused,
}
openpam_log(PAM_LOG_DEBUG, "killing ssh agent %d", (int)pid);
if (kill(pid, SIGTERM) == -1 ||
- waitpid(pid, &status, 0) == -1)
+ (waitpid(pid, &status, 0) == -1 && errno != ECHILD))
return (PAM_SYSTEM_ERR);
return (PAM_SUCCESS);
}
OpenPOWER on IntegriCloud