* [PATCH] su: preserve errno in cleanup_pam()
@ 2012-06-05 13:31 Ludwig Nussel
2012-06-05 13:51 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Ludwig Nussel @ 2012-06-05 13:31 UTC (permalink / raw)
To: util-linux; +Cc: Ludwig Nussel
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
---
login-utils/su.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/login-utils/su.c b/login-utils/su.c
index 944d655..0f535b9 100644
--- a/login-utils/su.c
+++ b/login-utils/su.c
@@ -153,6 +153,8 @@ static struct pam_conv conv =
static void
cleanup_pam (int retcode)
{
+ int saved_errno = errno;
+
if (_pam_session_opened)
pam_close_session (pamh, 0);
@@ -160,6 +162,8 @@ cleanup_pam (int retcode)
pam_setcred (pamh, PAM_DELETE_CRED | PAM_SILENT);
pam_end(pamh, retcode);
+
+ errno = saved_errno;
}
/* Signal handler for parent process. */
--
1.7.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-05 13:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 13:31 [PATCH] su: preserve errno in cleanup_pam() Ludwig Nussel
2012-06-05 13:51 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox