X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Fpam_systemd.c;h=d5b29c8af466b5a873ad6917c9efec64c770356e;hb=309a29dfd24f4175de334ca1593e3fe2436ab082;hp=f522d6ec4f20fa83b8b1ecefa22bc8cbb0019174;hpb=fecc80c1ba2eed9dadb9a10c15508c356bcc5fc1;p=elogind.git diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index f522d6ec4..d5b29c8af 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -114,7 +113,7 @@ static int get_user_data( } *ret_pw = pw; - *ret_username = username ? username : pw->pw_name; + *ret_username = username; return PAM_SUCCESS; } @@ -180,11 +179,10 @@ static int export_legacy_dbus_address( int r; /* skip export if kdbus is not active */ - if (access("/dev/kdbus", F_OK) < 0) + if (access("/sys/fs/kdbus", F_OK) < 0) return PAM_SUCCESS; - if (asprintf(&s, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, - uid, runtime) < 0) { + if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0) { pam_syslog(handle, LOG_ERR, "Failed to set bus variable."); return PAM_BUF_ERR; } @@ -213,7 +211,7 @@ _public_ PAM_EXTERN int pam_sm_open_session( *seat = NULL, *type = NULL, *class = NULL, *class_pam = NULL, *type_pam = NULL, *cvtnr = NULL, *desktop = NULL; - _cleanup_bus_unref_ sd_bus *bus = NULL; + _cleanup_bus_close_unref_ sd_bus *bus = NULL; int session_fd = -1, existing, r; bool debug = false, remote; struct passwd *pw; @@ -496,7 +494,7 @@ _public_ PAM_EXTERN int pam_sm_close_session( int argc, const char **argv) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; - _cleanup_bus_unref_ sd_bus *bus = NULL; + _cleanup_bus_close_unref_ sd_bus *bus = NULL; const void *existing = NULL; const char *id; int r;