Bug 449256
Summary: | exim SMTP authentication with shadow passwords always fails | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Chip Coldwell <coldwell> | ||||
Component: | pam | Assignee: | Tomas Mraz <tmraz> | ||||
Status: | CLOSED NEXTRELEASE | QA Contact: | |||||
Severity: | high | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 5.2 | ||||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2009-10-01 21:04:27 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Chip Coldwell
2008-06-01 03:36:07 UTC
Created attachment 307298 [details]
patch that fixes the issue (but might not be desirable for other reasons)
The check is there for a purpose and cannot be removed. The unix_chkpwd must not allow a regular user to check another user's password hash. The current PAM in Fedora 9 does not do the check explicitely though. It will just do setuid(getuid()) call and so if /etc/shadow would be readable to the exim process - it will allow to proceed and verify the password hash. I am not sure whether the pam_unix module in RHEL-5 would allow this, you can verify that by adding ACL on /etc/shadow or making /etc/shadow group readable and owned by the exim user's group. (In reply to comment #2) > The check is there for a purpose and cannot be removed. The unix_chkpwd must not > allow a regular user to check another user's password hash. That requirement is a bit too heavy handed. I agree that if any user can read the hashes in /etc/shadow then there's no point in storing the hashes in /etc/shadow instead of /etc/passwd; however, I think the Fedora approach: > The current PAM in > Fedora 9 does not do the check explicitely though. It will just do > setuid(getuid()) call and so if /etc/shadow would be readable to the exim > process - it will allow to proceed and verify the password hash. makes a lot more sense. Then, for example, you could have a "shadow" group, and make /etc/shadow readable to members of that group, then add the exim user to it. > I am not sure > whether the pam_unix module in RHEL-5 would allow this, you can verify that by > adding ACL on /etc/shadow or making /etc/shadow group readable and owned by the > exim user's group. It won't; you don't have to do any experiments to see that from the source code for /sbin/unix_chkpwd. In particular, the test I quoted above if (SELINUX_ENABLED && getuid() == 0) { user=argv[1]; } else { user = getuidname(getuid()); /* if the caller specifies the username, verify that user matches it */ if (strcmp(user, argv[1])) { return PAM_AUTH_ERR; } } shows that it will only allow a user to check his own password hash, irregardless of whether or not he can read /etc/shadow. The pam_unix module code is different in RHEL-5 from the F-9 version so it might work if SELinux doesn't prevent it. The checks are slightly relaxed in current Fedora releases which means that RHEL-6 should be OK in this regard. |