_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.");
get_seat_from_display(display, NULL, &vtnr);
}
+ if (seat && !streq(seat, "seat0")) {
+ pam_syslog(handle, LOG_DEBUG,
+ "Ignoring vtnr %d for %s which is not seat0", vtnr, seat);
+ vtnr = 0;
+ }
+
if (!type)
type = !isempty(display) ? "x11" :
!isempty(tty) ? "tty" : "unspecified";