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:
parent
6c833cdfc3
commit
8042e377b8
@ -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.");
|
||||||
|
Loading…
Reference in New Issue
Block a user