Bug 1138581

Summary: sudo with sssd doesn't work correctly with sudoOrder option
Product: Red Hat Enterprise Linux 6 Reporter: David Spurek <dspurek>
Component: sudoAssignee: Daniel Kopeček <dkopecek>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: dapospis, dkopecek, ebenes, pkis, pvrabec, qe-baseos-security
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sudo-1.8.6p3-16.el6 Doc Type: Bug Fix
Doc Text:
Cause: The implementation of SSSD support in sudo wasn't sorting the rules according to the sudoOrder attribute value Consequence: Rules processed in undefined order even if the sudoOrder attribute was present. Fix: Implemented sorting by the sudoOrder attribute value. Result: Rules are sorted in a defined order (as described in the documentation)
Story Points: ---
Clone Of: 1138576 Environment:
Last Closed: 2015-07-22 07:36:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1138576, 1232950, 1247997    
Bug Blocks:    
Attachments:
Description Flags
proposed patch none

Description David Spurek 2014-09-05 08:55:06 UTC
The same problem in rhel6, tested with sudo-1.8.6p3-15.el6 and sssd-1.11.6-28.el6
+++ This bug was initially created as a clone of Bug #1138576 +++

Description of problem:
sudo with sssd doesn't  work correctly with sudoOrder option. rule with the highest value in sudoOrder parameter should be used.

dn: cn=rule_allow,ou=Sudoers,dc=my-domain,dc=com
objectClass: top
objectClass: sudoRole
cn: rule_allow
sudoHost: ALL
sudoUser: userallowed
sudoCommand: /usr/bin/true
sudoOrder: 2

dn: cn=rule_deny,ou=Sudoers,dc=my-domain,dc=com
objectClass: top
objectClass: sudoRole
cn: rule_deny
sudoHost: ALL
sudoUser: userallowed
sudoCommand: !/usr/bin/true
sudoCommand: ALL
sudoOrder: 1

[test]su - userallowed -c 'sudo true'su: warning: cannot change directory to /home/userallowed: No such file or directory
Sorry, user userallowed is not allowed to execute '/bin/true' as root on rhel7.example.com. 


Version-Release number of selected component (if applicable):
sudo-1.8.6p7-11.el7
sssd-1.11.2-65.el7

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Daniel Kopeček 2015-02-24 13:52:31 UTC
Ok, this one looks like a real bug from the logs. Easily fixable.

Comment 4 Daniel Kopeček 2015-03-02 09:33:30 UTC
Created attachment 997008 [details]
proposed patch

Comment 7 errata-xmlrpc 2015-07-22 07:36:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1409.html