util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

* Re: [PATCH] su: preserve errno in cleanup_pam()
  2012-06-05 13:31 [PATCH] su: preserve errno in cleanup_pam() Ludwig Nussel
@ 2012-06-05 13:51 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2012-06-05 13:51 UTC (permalink / raw)
  To: Ludwig Nussel; +Cc: util-linux

On Tue, Jun 05, 2012 at 03:31:24PM +0200, Ludwig Nussel wrote:
>  login-utils/su.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[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;
as well as URLs for NNTP newsgroup(s).