chiark / gitweb /
pam_systemd: Properly check kdbus availability
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Sun, 21 Jun 2015 03:59:34 +0000 (05:59 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:03:50 +0000 (10:03 +0100)
This properly avoids setting DBUS_SESSION_BUS_ADDRESS if kdbus
is loaded (or built into the kernel) but not wanted.

src/login/pam_elogind.c

index 9554ce6..6f941f8 100644 (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) {