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