diff options
author | markm <markm@FreeBSD.org> | 2001-07-14 08:38:24 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-07-14 08:38:24 +0000 |
commit | 921b216c2d46fc68420893bb5e60da6c1530a90d (patch) | |
tree | 904d2af18d4bafeb919e898f46c8282c9cc1fbfd /lib | |
parent | 1dec611e105548ea30614e1907e769471c4d661c (diff) | |
download | FreeBSD-src-921b216c2d46fc68420893bb5e60da6c1530a90d.zip FreeBSD-src-921b216c2d46fc68420893bb5e60da6c1530a90d.tar.gz |
Use a better method to get user credentials to account for (legal)
duplications of UID's in /etc/*passwd.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libpam/modules/pam_opie/pam_opie.8 | 3 | ||||
-rw-r--r-- | lib/libpam/modules/pam_opie/pam_opie.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/libpam/modules/pam_opie/pam_opie.8 b/lib/libpam/modules/pam_opie/pam_opie.8 index 3895eb5..996d1d3 100644 --- a/lib/libpam/modules/pam_opie/pam_opie.8 +++ b/lib/libpam/modules/pam_opie/pam_opie.8 @@ -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 , diff --git a/lib/libpam/modules/pam_opie/pam_opie.c b/lib/libpam/modules/pam_opie/pam_opie.c index 566a694..dc5c814 100644 --- a/lib/libpam/modules/pam_opie/pam_opie.c +++ b/lib/libpam/modules/pam_opie/pam_opie.c @@ -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 { |