Please apply this small patch to su to set PAM_RUSER. Compiled and tested. BTW pam_listfile core dumps if an argument passed to it does not contain '=' . --- sh-utils-2.0/src/su.c.old Thu Feb 15 04:08:25 2001 +++ sh-utils-2.0/src/su.c Thu Feb 15 04:08:35 2001 @@ -317,6 +317,8 @@ correct_password (const struct passwd *pw) { #ifdef USE_PAM + struct passwd *caller; + /* root always succeeds; this isn't an authentication question (no * extra privs are being granted) so it shouldn't authenticate with PAM. * However, we want to create the pam_handle so that proper credentials @@ -331,6 +333,11 @@ exit(1); } + caller = getpwuid(getuid()); + if (caller != NULL && caller->pw_name != NULL) { + retval = pam_set_item(pamh, PAM_RUSER, caller->pw_name); + PAM_BAIL_P; + } retval = pam_authenticate(pamh, 0); PAM_BAIL_P;
Created attachment 10081 [details] su ruser patch
Thanks, added in 2.0.11-8.
Oops, forgot to close the bug after fixing it.