summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-08-02 10:35:41 +0000
committermarkm <markm@FreeBSD.org>2001-08-02 10:35:41 +0000
commit78112d89854b6b9668fb096ce5eda367bd92d4f7 (patch)
tree626bf5be6d7be3661a5db92fee3c9b7378bd380c
parent4de8e0e1a0b3240f877fcd6be5933e8e49e03e1c (diff)
downloadFreeBSD-src-78112d89854b6b9668fb096ce5eda367bd92d4f7.zip
FreeBSD-src-78112d89854b6b9668fb096ce5eda367bd92d4f7.tar.gz
Repair the get/set UID() stuff so this works in both su(1) and login(1)
modes.
-rw-r--r--lib/libpam/modules/pam_ssh/pam_ssh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libpam/modules/pam_ssh/pam_ssh.c b/lib/libpam/modules/pam_ssh/pam_ssh.c
index b8a4075..2e18050 100644
--- a/lib/libpam/modules/pam_ssh/pam_ssh.c
+++ b/lib/libpam/modules/pam_ssh/pam_ssh.c
@@ -104,15 +104,15 @@ auth_via_key(pam_handle_t *pamh, int type, const char *file,
syslog(LOG_CRIT, "%s: %m", MODULE_NAME);
return PAM_SERVICE_ERR;
}
- saved_uid = getuid();
+ saved_uid = geteuid();
/*
* Try to decrypt the private key with the passphrase provided.
* If success, the user is authenticated.
*/
- setreuid(user->pw_uid, saved_uid);
+ seteuid(user->pw_uid);
key = key_load_private_type(type, path, pass, &comment);
free(path);
- setuid(saved_uid);
+ seteuid(saved_uid);
if (key == NULL)
return PAM_AUTH_ERR;
/*
OpenPOWER on IntegriCloud