richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
65878a
From c9f24bd31d2b980718ecdc55ab33f5baa35ec4a2 Mon Sep 17 00:00:00 2001
65878a
From: Michal Sekletar <msekleta@redhat.com>
65878a
Date: Mon, 10 Feb 2014 13:47:38 +0100
65878a
Subject: [PATCH] pam: retrieve value of debug param first
65878a
65878a
We are setting debug to false by default, so we should should first retrieve
65878a
value of debug parameter and then log only if debug was set. Now we don't take
65878a
the value passed to us into the count.
65878a
---
65878a
 src/login/pam-module.c | 6 +++---
65878a
 1 file changed, 3 insertions(+), 3 deletions(-)
65878a
65878a
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
65878a
index 973daf7..878a704 100644
65878a
--- a/src/login/pam-module.c
65878a
+++ b/src/login/pam-module.c
65878a
@@ -199,9 +199,6 @@ _public_ PAM_EXTERN int pam_sm_open_session(
65878a
 
65878a
         dbus_error_init(&error);
65878a
 
65878a
-        if (debug)
65878a
-                pam_syslog(handle, LOG_INFO, "pam-systemd initializing");
65878a
-
65878a
         /* Make this a NOP on non-logind systems */
65878a
         if (!logind_running())
65878a
                 return PAM_SUCCESS;
65878a
@@ -214,6 +211,9 @@ _public_ PAM_EXTERN int pam_sm_open_session(
65878a
                 goto finish;
65878a
         }
65878a
 
65878a
+        if (debug)
65878a
+                pam_syslog(handle, LOG_INFO, "pam-systemd initializing");
65878a
+
65878a
         r = get_user_data(handle, &username, &pw;;
65878a
         if (r != PAM_SUCCESS)
65878a
                 goto finish;