From 426435c12c7a5226d807d0ae5528a0541d04b62f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 8 Jun 2010 16:54:04 -0400 Subject: [PATCH] If pam_open_session() fails, pass its status to pam_end. --- plugins/sudoers/auth/pam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sudoers/auth/pam.c b/plugins/sudoers/auth/pam.c index ddbd46aa2..a61041439 100644 --- a/plugins/sudoers/auth/pam.c +++ b/plugins/sudoers/auth/pam.c @@ -241,7 +241,7 @@ pam_begin_session(pw, auth) #ifndef NO_PAM_SESSION status = pam_open_session(pamh, 0); if (status != PAM_SUCCESS) { - (void) pam_end(pamh, PAM_SUCCESS | PAM_DATA_SILENT); + (void) pam_end(pamh, status | PAM_DATA_SILENT); pamh = NULL; } #endif -- 2.40.0