X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Fpam-module.c;h=7400734fdc975f0c83eeb3dbc240c87cb66f7166;hb=6a38d04a036475bfc222f40961e2adcaa70a6174;hp=e76fef8001586cc02d7673b08d4ae752be3f2011;hpb=5eecd85f15d35198807e6cd4b5ca5ec7dfdb11b3;p=elogind.git diff --git a/src/login/pam-module.c b/src/login/pam-module.c index e76fef800..7400734fd 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.");