Use a better method to get user credentials to account for (legal)

duplications of UID's in /etc/*passwd.
This commit is contained in:
markm 2001-07-14 08:38:24 +00:00
parent 1dec611e10
commit 921b216c2d
2 changed files with 3 additions and 2 deletions

View File

@ -69,7 +69,7 @@ level.
This option will require the user
to authenticate themself as the user
given by
.Xr getuid 2 ,
.Xr getlogin 2 ,
not as the account they are attempting to access.
This is primarily for services like
.Xr su 1 ,
@ -84,6 +84,7 @@ default OPIE password database.
.El
.Sh SEE ALSO
.Xr passwd 1 ,
.Xr getlogin 2 ,
.Xr opiechallenge 3 ,
.Xr syslog 3 ,
.Xr opie 4 ,

View File

@ -74,7 +74,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
user = NULL;
if (pam_test_option(&options, PAM_OPT_AUTH_AS_SELF, NULL)) {
pwd = getpwuid(getuid());
pwd = getpwnam(getlogin());
user = pwd->pw_name;
}
else {