Bug 1123929

Summary: "su: incorrect password" for user access denial on rhel6
Product: Red Hat Enterprise Linux 6 Reporter: Kaushik Banerjee <kbanerje>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: pbrady
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-29 12:09:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Kaushik Banerjee 2014-07-28 16:25:26 UTC
Description of problem:
In the access control tests when access is denied we got "su: Permission denied" on RHEL7.0. But, there is a difference in su output on rhel6.6 and rhel7.0

/var/log/secure always shows "Access denied"


Version-Release number of selected component (if applicable):
# rpm -qf /bin/su
coreutils-8.4-37.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. sssd as the client authenticating with users from AD Server
2. Setup access control in sssd.conf
3. Try to auth as denied user

Actual results:
On RHEL6.6:

# su --shell /bin/sh nobody
sh-4.1$ su user2_dom1@sssdad.com
Password:
su: incorrect password
sh-4.1$


On RHEL7.0:

# su --shell /bin/sh nobody
sh-4.2$ su user1_dom2@sssdad_tree.com
Password:
su: Permission denied
sh-4.2$


Expected results:
"su: Permission denied" on RHEL6.6

Additional info:

Comment 2 Ondrej Vasik 2014-07-29 12:09:03 UTC
If you take a closer look, you will see RHEL 7 su is from util-linux package and on RHEL 6 it is from coreutils. I don't think you can expect the consistency in such small details like message format. In my opinion, this is not a bug, we should not change such messages within major release, as it would break customer scripts checking for "incorrect password" string.

Please provide more information why this change is required if you want this bugzilla reopened.

Comment 3 Kaushik Banerjee 2014-08-01 06:43:10 UTC
My team has automation scripts which tests for user access denials. I was looking to have consistency between rhel6 and 7.

This is not really a blocker for me as I can fix my scripts to make it work on all OSes.

But, I logged this bug because it seemed "su: incorrect password" is wrongfully returned when password was correct but access was denied.

Comment 4 Ondrej Vasik 2014-08-04 13:50:13 UTC
Permission denied probably comes from PAM. Incorrect password comes from su. Different code, different handling - same functionality in most cases. Tests have to be written to deal with both possibilities, otherwise, they are fragile. We can't change this in su.c (btw. differences: util-linux (2.22.2) su.c : 689 lines of code, coreutils (8.4) su.c: 943 lines of code - diff shows: 395 lines added, 649 lines removed - so pretty much complete rewrite.)