]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pam_systemd: also print debug lines when ending a session
authorLennart Poettering <lennart@poettering.net>
Thu, 7 May 2020 08:35:48 +0000 (10:35 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 12 May 2020 09:10:30 +0000 (11:10 +0200)
src/login/pam_systemd.c

index 43587a766108f4dcd6ef9d8a7bbe13cac32b9477..b6f5562707c738f56d425f987ea9fa6d918c2faf 100644 (file)
@@ -956,11 +956,23 @@ _public_ PAM_EXTERN int pam_sm_close_session(
                 int argc, const char **argv) {
 
         const void *existing = NULL;
+        bool debug = false;
         const char *id;
         int r;
 
         assert(handle);
 
+        if (parse_argv(handle,
+                       argc, argv,
+                       NULL,
+                       NULL,
+                       NULL,
+                       &debug) < 0)
+                return PAM_SESSION_ERR;
+
+        if (debug)
+                pam_syslog(handle, LOG_DEBUG, "pam-systemd shutting down");
+
         /* Only release session if it wasn't pre-existing when we
          * tried to create it */
         (void) pam_get_data(handle, "systemd.existing", &existing);