pam_systemd: also print debug lines when ending a session

This commit is contained in:
Lennart Poettering 2020-05-07 10:35:48 +02:00
parent 3400bc866d
commit 45c5fa253a
1 changed files with 12 additions and 0 deletions

View File

@ -956,11 +956,23 @@ _public_ PAM_EXTERN int pam_sm_close_session(
int argc, const char **argv) { int argc, const char **argv) {
const void *existing = NULL; const void *existing = NULL;
bool debug = false;
const char *id; const char *id;
int r; int r;
assert(handle); 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 /* Only release session if it wasn't pre-existing when we
* tried to create it */ * tried to create it */
(void) pam_get_data(handle, "systemd.existing", &existing); (void) pam_get_data(handle, "systemd.existing", &existing);