diff --git a/src/home/pam_systemd_home.c b/src/home/pam_systemd_home.c index 4616f086ed0..b9e5da129c6 100644 --- a/src/home/pam_systemd_home.c +++ b/src/home/pam_systemd_home.c @@ -149,7 +149,7 @@ static int acquire_user_record( _cleanup_free_ char *generic_field = NULL, *json_copy = NULL; _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL; - r = pam_acquire_bus_connection(handle, "pam-systemd-home", &bus, bus_data); + r = pam_acquire_bus_connection(handle, "pam-systemd-home", debug, &bus, bus_data); if (r != PAM_SUCCESS) return r; @@ -563,7 +563,7 @@ static int acquire_home( * request to collect one more password and pass the new and all previously used passwords again. */ _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL; - r = pam_acquire_bus_connection(handle, "pam-systemd-home", &bus, bus_data); + r = pam_acquire_bus_connection(handle, "pam-systemd-home", debug, &bus, bus_data); if (r != PAM_SUCCESS) return r; @@ -892,7 +892,7 @@ _public_ PAM_EXTERN int pam_sm_close_session( return r; _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL; - r = pam_acquire_bus_connection(handle, "pam-systemd-home", &bus, NULL); + r = pam_acquire_bus_connection(handle, "pam-systemd-home", debug, &bus, NULL); if (r != PAM_SUCCESS) return r; @@ -1114,7 +1114,7 @@ _public_ PAM_EXTERN int pam_sm_chauthtok( return pam_syslog_errno(handle, LOG_ERR, r, "Failed to store new password: %m"); _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL; - r = pam_acquire_bus_connection(handle, "pam-systemd-home", &bus, NULL); + r = pam_acquire_bus_connection(handle, "pam-systemd-home", debug, &bus, NULL); if (r != PAM_SUCCESS) return r; diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index a711c89b12b..ad15c57acf7 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -1061,7 +1061,7 @@ _public_ PAM_EXTERN int pam_sm_open_session( return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to get PAM systemd.runtime_max_sec data: @PAMERR@"); /* Talk to logind over the message bus */ - r = pam_acquire_bus_connection(handle, "pam-systemd", &bus, &d); + r = pam_acquire_bus_connection(handle, "pam-systemd", debug, &bus, &d); if (r != PAM_SUCCESS) return r; @@ -1264,7 +1264,7 @@ _public_ PAM_EXTERN int pam_sm_close_session( /* Before we go and close the FIFO we need to tell logind that this is a clean session * shutdown, so that it doesn't just go and slaughter us immediately after closing the fd */ - r = pam_acquire_bus_connection(handle, "pam-systemd", &bus, NULL); + r = pam_acquire_bus_connection(handle, "pam-systemd", debug, &bus, NULL); if (r != PAM_SUCCESS) return r; diff --git a/src/shared/pam-util.c b/src/shared/pam-util.c index 3cbe431531c..af97adb2d08 100644 --- a/src/shared/pam-util.c +++ b/src/shared/pam-util.c @@ -148,6 +148,7 @@ void pam_bus_data_disconnectp(PamBusData **_d) { int pam_acquire_bus_connection( pam_handle_t *handle, const char *module_name, + bool debug, sd_bus **ret_bus, PamBusData **ret_pam_bus_data) { @@ -187,7 +188,7 @@ int pam_acquire_bus_connection( if (r != PAM_SUCCESS) return pam_syslog_pam_error(handle, LOG_ERR, r, "Failed to set PAM bus data: @PAMERR@"); - pam_syslog(handle, LOG_DEBUG, "New sd-bus connection (%s) opened.", d->cache_id); + pam_debug_syslog(handle, debug, "New sd-bus connection (%s) opened.", d->cache_id); success: *ret_bus = sd_bus_ref(d->bus); diff --git a/src/shared/pam-util.h b/src/shared/pam-util.h index d627eb733fc..34a83294b09 100644 --- a/src/shared/pam-util.h +++ b/src/shared/pam-util.h @@ -37,7 +37,7 @@ void pam_bus_data_disconnectp(PamBusData **d); /* Use a different module name per different PAM module. They are all loaded in the same namespace, and this * helps avoid a clash in the internal data structures of sd-bus. It will be used as key for cache items. */ -int pam_acquire_bus_connection(pam_handle_t *handle, const char *module_name, sd_bus **ret_bus, PamBusData **ret_bus_data); +int pam_acquire_bus_connection(pam_handle_t *handle, const char *module_name, bool debug, sd_bus **ret_bus, PamBusData **ret_bus_data); int pam_release_bus_connection(pam_handle_t *handle, const char *module_name); int pam_get_bus_data(pam_handle_t *handle, const char *module_name, PamBusData **ret);