summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2014-01-11 18:18:41 +0100
committerKay Sievers <kay@vrfy.org>2014-01-11 18:45:42 +0100
commit8042e377b8bb8f79b7da2dff89d2247ce1f74b66 (patch)
tree854118d4ad3ffee265c249126345c6c0dc19bc2d
parentmake socket_instantiate_service use cleanup gcc attribute (diff)
downloadsystemd-8042e377b8bb8f79b7da2dff89d2247ce1f74b66.tar.xz
systemd-8042e377b8bb8f79b7da2dff89d2247ce1f74b66.zip
pam: skip DBUS_SESSION_BUS_ADDRESS export when kdbus is not active
-rw-r--r--src/login/pam-module.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index e76fef8001..7400734fdc 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -173,6 +173,10 @@ static int export_legacy_dbus_address(
_cleanup_free_ char *s = NULL;
int r;
+ /* skip export if kdbus is not active */
+ if (access("/dev/kdbus", F_OK) < 0)
+ return PAM_SUCCESS;
+
if (asprintf(&s, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT,
(unsigned long) uid, runtime) < 0) {
pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");