Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1052983

Summary: sudoOrder missing in sudoers
Product: Red Hat Enterprise Linux 7 Reporter: Dmitri Pal <dpal>
Component: ipaAssignee: Martin Kosek <mkosek>
Status: CLOSED CURRENTRELEASE QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.0CC: mkosek, rcritten
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-3.3.3-12.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 09:32:38 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:

Description Dmitri Pal 2014-01-14 14:41:07 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/4107

sudoers compat plugin configuration missed the `sudoOrder` attribute and it thus does not show up in the `ou=sudoers`.

To hotfix it, I did:
{{{
# ldapmodify -h `hostname` -D "cn=Directory Manager" -x -W
dn: cn=sudoers,cn=Schema Compatibility,cn=plugins,cn=config
changetype: modify
add: schema-compat-entry-attribute
schema-compat-entry-attribute: sudoOrder=%{sudoOrder}                                  

modifying entry "cn=sudoers,cn=Schema Compatibility,cn=plugins,cn=config"
}}}

`sudoOrder` was then fixed.

Comment 1 Namita Soman 2014-01-14 21:36:00 UTC
Please add steps to verify this

Comment 2 Martin Kosek 2014-01-15 07:58:00 UTC
Reproduction:

1) Install or update IPA server
2) Add a SUDO rule with order filled:

# ipa sudorule-add orderedrule
-----------------------------
Added Sudo Rule "orderedrule"
-----------------------------
  Rule name: orderedrule
  Enabled: TRUE
# ipa sudorule-mod orderedrule --order 10
--------------------------------
Modified Sudo Rule "orderedrule"
--------------------------------
  Rule name: orderedrule
  Enabled: TRUE
  Sudo order: 10

3) See if sudoOrder attribute is present in the sudoers compat tree:

# ldapsearch -h `hostname` -D "cn=Directory Manager" -x -w Secret123 -b 'cn=orderedrule,ou=sudoers,dc=example,dc=com'
...
# orderedrule, sudoers, idm.lab.bos.redhat.com
dn: cn=orderedrule,ou=sudoers,dc=idm,dc=lab,dc=bos,dc=redhat,dc=com
objectClass: sudoRole
sudoOrder: 10           <<<<<<<<
cn: orderedrule
...

Comment 5 Namita Soman 2014-01-28 18:14:02 UTC
Verified using ipa-server-3.3.3-15.el7.x86_64

# ipa sudorule-add orderedrule
-----------------------------
Added Sudo Rule "orderedrule"
-----------------------------
  Rule name: orderedrule
  Enabled: TRUE


# ipa sudorule-show orderedrule --all --raw
  dn: ipaUniqueID=21ac0b0e-8847-11e3-876f-3440b5890616,cn=sudorules,cn=sudo,dc=testrelm,dc=com
  cn: orderedrule
  ipaEnabledFlag: TRUE
  ipaUniqueID: 21ac0b0e-8847-11e3-876f-3440b5890616
  objectClass: ipaassociation
  objectClass: ipasudorule


# ipa sudorule-mod orderedrule --order 10
--------------------------------
Modified Sudo Rule "orderedrule"
--------------------------------
  Rule name: orderedrule
  Enabled: TRUE
  Sudo order: 10


# ipa sudorule-show orderedrule --all --raw
  dn: ipaUniqueID=21ac0b0e-8847-11e3-876f-3440b5890616,cn=sudorules,cn=sudo,dc=testrelm,dc=com
  cn: orderedrule
  ipaEnabledFlag: TRUE
  ipaUniqueID: 21ac0b0e-8847-11e3-876f-3440b5890616
  objectClass: ipaassociation
  objectClass: ipasudorule
  sudoOrder: 10  <<-----has this attr


# ldapsearch -h `hostname` -D "cn=Directory Manager" -x -w Secret123 -b 'cn=orderedrule,ou=sudoers,dc=testrelm,dc=com'
# extended LDIF
#
# LDAPv3
# base <cn=orderedrule,ou=sudoers,dc=testrelm,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# orderedrule, sudoers, testrelm.com
dn: cn=orderedrule,ou=sudoers,dc=testrelm,dc=com
objectClass: sudoRole
sudoOrder: 10    <<<<<< verified
cn: orderedrule

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

Comment 6 Ludek Smid 2014-06-13 09:32:38 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.