From 24db258f35eced3ea8ed89fc8cfe86cd958f4e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Fri, 19 Sep 2003 11:33:03 +0000 Subject: [PATCH] Ignore ECHILD from waitpid(2) (our child may have been reaped by the calling process's SIGCHLD handler) PR: bin/45669 --- lib/libpam/modules/pam_ssh/pam_ssh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libpam/modules/pam_ssh/pam_ssh.c b/lib/libpam/modules/pam_ssh/pam_ssh.c index 29c4d5ce0f5..24f2c276826 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 #include +#include #include #include #include @@ -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); }