X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Fpam_systemd.c;h=d7a708fd0a8e05ebb7c964ef5c80d0dad8c22bdc;hb=e93549ef29c4123d9ee45acb5815048390201e49;hp=9250a6903a83fda59dfdc8c3d2a3470fcbfed872;hpb=63cc4c3138fd0ce9cc97884373a2dd8959a13ee9;p=elogind.git diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index 9250a6903..d7a708fd0 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; } @@ -183,8 +182,7 @@ static int export_legacy_dbus_address( 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; } @@ -346,7 +344,7 @@ _public_ PAM_EXTERN int pam_sm_open_session( } if (seat && !streq(seat, "seat0") && vtnr != 0) { - pam_syslog(handle, LOG_DEBUG, "Ignoring vtnr %d for %s which is not seat0", vtnr, seat); + pam_syslog(handle, LOG_DEBUG, "Ignoring vtnr %"PRIu32" for %s which is not seat0", vtnr, seat); vtnr = 0; } @@ -369,7 +367,7 @@ _public_ PAM_EXTERN int pam_sm_open_session( if (debug) pam_syslog(handle, LOG_DEBUG, "Asking logind to create session: " - "uid=%u pid=%u service=%s type=%s class=%s desktop=%s seat=%s vtnr=%u tty=%s display=%s remote=%s remote_user=%s remote_host=%s", + "uid="UID_FMT" pid="PID_FMT" service=%s type=%s class=%s desktop=%s seat=%s vtnr=%"PRIu32" tty=%s display=%s remote=%s remote_user=%s remote_host=%s", pw->pw_uid, getpid(), strempty(service), type, class, strempty(desktop),