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