Bug 1123929 - "su: incorrect password" for user access denial on rhel6
Summary: "su: incorrect password" for user access denial on rhel6
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: coreutils
Version: 6.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-28 16:25 UTC by Kaushik Banerjee
Modified: 2014-08-04 13:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-29 12:09:03 UTC


Attachments (Terms of Use)

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.)


Note You need to log in before you can comment on or make changes to this bug.