dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
Blob Blame History Raw
From c9f24bd31d2b980718ecdc55ab33f5baa35ec4a2 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Mon, 10 Feb 2014 13:47:38 +0100
Subject: [PATCH] pam: retrieve value of debug param first

We are setting debug to false by default, so we should should first retrieve
value of debug parameter and then log only if debug was set. Now we don't take
the value passed to us into the count.
---
 src/login/pam-module.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 973daf7..878a704 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -199,9 +199,6 @@ _public_ PAM_EXTERN int pam_sm_open_session(
 
         dbus_error_init(&error);
 
-        if (debug)
-                pam_syslog(handle, LOG_INFO, "pam-systemd initializing");
-
         /* Make this a NOP on non-logind systems */
         if (!logind_running())
                 return PAM_SUCCESS;
@@ -214,6 +211,9 @@ _public_ PAM_EXTERN int pam_sm_open_session(
                 goto finish;
         }
 
+        if (debug)
+                pam_syslog(handle, LOG_INFO, "pam-systemd initializing");
+
         r = get_user_data(handle, &username, &pw);
         if (r != PAM_SUCCESS)
                 goto finish;