1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

pam: skip DBUS_SESSION_BUS_ADDRESS export when kdbus is not active

This commit is contained in:
Kay Sievers 2014-01-12 01:18:41 +08:00
parent 6c833cdfc3
commit 8042e377b8

View File

@ -173,6 +173,10 @@ static int export_legacy_dbus_address(
_cleanup_free_ char *s = NULL; _cleanup_free_ char *s = NULL;
int r; 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, if (asprintf(&s, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT,
(unsigned long) uid, runtime) < 0) { (unsigned long) uid, runtime) < 0) {
pam_syslog(handle, LOG_ERR, "Failed to set bus variable."); pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");