pam_systemd: Properly check kdbus availability

This properly avoids setting DBUS_SESSION_BUS_ADDRESS if kdbus
is loaded (or built into the kernel) but not wanted.
This commit is contained in:
Jan Alexander Steffens (heftig) 2015-06-21 05:59:34 +02:00 committed by Daniel Mack
parent 94c5528dc2
commit c5d452bb22

View file

@ -181,7 +181,7 @@ static int export_legacy_dbus_address(
int r;
/* skip export if kdbus is not active */
if (access("/sys/fs/kdbus", F_OK) < 0)
if (!is_kdbus_available())
return PAM_SUCCESS;
if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0) {