This singular debug message gets printed even if debug is not enabled.
Quiet this message when debug is not enabled for consistency.
_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;
* 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;
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;
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;
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;
/* 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;
int pam_acquire_bus_connection(
pam_handle_t *handle,
const char *module_name,
+ bool debug,
sd_bus **ret_bus,
PamBusData **ret_pam_bus_data) {
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);
/* 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);