summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMantas Mikulėnas <grawity@gmail.com>2014-01-08 14:08:34 +0200
committerKay Sievers <kay@vrfy.org>2014-01-08 21:46:38 +0800
commit9130f2128b64de19a3b7d6db7e0d371adfd296c2 (patch)
tree2d947d5759480bbd6f0f02b23f7b14659fe8dc3f
parent06150d9039296a6c37aa300463e9bd0c7f296542 (diff)
bus: export bus address also when compiled without kdbus
It was removed from user@.service, so it should be added here.
-rw-r--r--src/login/pam-module.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index e76fef8001..ea606b7fc9 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -169,22 +169,28 @@ static int export_legacy_dbus_address(
uid_t uid,
const char *runtime) {
-#ifdef ENABLE_KDBUS
_cleanup_free_ char *s = NULL;
int r;
+#ifdef ENABLE_KDBUS
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.");
return PAM_BUF_ERR;
}
+#else
+ if (asprintf(&s, UNIX_USER_BUS_FMT, runtime) < 0) {
+ pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
+ return PAM_BUF_ERR;
+ }
+#endif
r = pam_misc_setenv(handle, "DBUS_SESSION_BUS_ADDRESS", s, 0);
if (r != PAM_SUCCESS) {
pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
return r;
}
-#endif
+
return PAM_SUCCESS;
}