]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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)
committerDaniel Mack <daniel@zonque.org>
Sun, 21 Jun 2015 09:24:59 +0000 (11:24 +0200)
This properly avoids setting DBUS_SESSION_BUS_ADDRESS if kdbus
is loaded (or built into the kernel) but not wanted.

src/login/pam_systemd.c

index 0ebdfdf19e587e394e0185a934814c9ee436a00e..dd192b90ce0b64a19046f6026488e93de11ddcf2 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) {