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 9554ce6067c5fc1eccaf15bd0f3a5791d10fcf70..6f941f836fbb23094d14b20682eff49ef782a0d1 100644 (file)
@@ -181,7 +181,7 @@ static int export_legacy_dbus_address(
         int r;
 
         /* skip export if kdbus is not active */
         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) {
                 return PAM_SUCCESS;
 
         if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0) {