summaryrefslogtreecommitdiffstats
path: root/login-utils/login.c
diff options
context:
space:
mode:
authorKarel Zak2007-03-08 22:42:50 +0100
committerKarel Zak2007-03-08 22:42:50 +0100
commit987195ce415a45d0ea98955019634bf2f179ffb1 (patch)
tree4d92588d9468147a1e3ac5d1cb014d4531d57b89 /login-utils/login.c
parentlogin: attempt to run if it has no read/write access to its terminal (diff)
downloadkernel-qcow2-util-linux-987195ce415a45d0ea98955019634bf2f179ffb1.tar.gz
kernel-qcow2-util-linux-987195ce415a45d0ea98955019634bf2f179ffb1.tar.xz
kernel-qcow2-util-linux-987195ce415a45d0ea98955019634bf2f179ffb1.zip
login: omits PAM account validation when auth is skipped (CVE-2006-7108)
The login omits pam_acct_mgmt & chauth_tok when authentication is skipped. Authentication may be skipped, for example, during krlogin because Kerberos already took care of it. The problem with skipping pam_acct_mgmt is that it allows users to use the system when maybe they should not be allowed, such that if they have a Kerberos ticket, the other checks do not apply. If a user had to use password authentication, pam_acct_mgmt may reject the user for several reasons: not allowed to use the system at this time, not allowed to use this system, user's account has been disabled, etc. Why should these tests be skipped just because the user has a ticket? Same with pam_chauthtok: the user may have a valid ticket, but if their password has expired, they need to enter a new one right now. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/login.c')
-rw-r--r--login-utils/login.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/login-utils/login.c b/login-utils/login.c
index 3948cb7d1..1715015d5 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -582,16 +582,22 @@ main(int argc, char **argv)
pam_end(pamh, retcode);
exit(0);
}
+ }
- retcode = pam_acct_mgmt(pamh, 0);
-
- if(retcode == PAM_NEW_AUTHTOK_REQD) {
- retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
- }
+ /*
+ * Authentication may be skipped (for example, during krlogin, rlogin, etc...),
+ * but it doesn't mean that we can skip other account checks. The account
+ * could be disabled or password expired (althought kerberos ticket is valid).
+ * -- kzak@redhat.com (22-Feb-2006)
+ */
+ retcode = pam_acct_mgmt(pamh, 0);
- PAM_FAIL_CHECK;
+ if(retcode == PAM_NEW_AUTHTOK_REQD) {
+ retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
}
+ PAM_FAIL_CHECK;
+
/*
* Grab the user information out of the password file for future usage
* First get the username that we are actually using, though.