From 6ccbba1cf178e9de46347e2f9df76f69aebcec20 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Thu, 21 Feb 2008 21:12:30 +0000 Subject: Relevant BUGIDs: rhbz#433459 Purpose of commit: bugfix Commit summary: --------------- 2008-02-21 Tomas Mraz * libpam/pam_audit.c (_pam_audit_writelog): Silence syslog message on non-error return. * modules/pam_unix/unix_chkpwd.c (main): Proceed as unprivileged user when checking password of another user. * modules/pam_unix/unix_update.c: Fix comment. --- modules/pam_unix/unix_chkpwd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/pam_unix/unix_chkpwd.c') diff --git a/modules/pam_unix/unix_chkpwd.c b/modules/pam_unix/unix_chkpwd.c index 11ac3aac..5f872d27 100644 --- a/modules/pam_unix/unix_chkpwd.c +++ b/modules/pam_unix/unix_chkpwd.c @@ -101,7 +101,10 @@ int main(int argc, char *argv[]) /* if the caller specifies the username, verify that user matches it */ if (strcmp(user, argv[1])) { - return PAM_AUTH_ERR; + user = argv[1]; + /* no match -> permanently change to the real user and proceed */ + if (setuid(getuid()) != 0) + return PAM_AUTH_ERR; } } -- cgit v1.2.3