From: Ludwig Nussel <ludwig.nussel@suse.de>
To: util-linux@vger.kernel.org
Cc: Ludwig Nussel <ludwig.nussel@suse.de>
Subject: [PATCH] su: preserve errno in cleanup_pam()
Date: Tue, 5 Jun 2012 15:31:24 +0200 [thread overview]
Message-ID: <1338903084-19479-1-git-send-email-ludwig.nussel@suse.de> (raw)
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
next reply other threads:[~2012-06-05 13:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 13:31 Ludwig Nussel [this message]
2012-06-05 13:51 ` [PATCH] su: preserve errno in cleanup_pam() Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1338903084-19479-1-git-send-email-ludwig.nussel@suse.de \
--to=ludwig.nussel@suse.de \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).