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 947561

Summary: filter option in fixup-memberof requires more clarification.
Product: Red Hat Enterprise Linux 7 Reporter: Najmuddin Chirammal <nc>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: amsharma, jgalipea, mreynolds, nhosoi, nkinder, sramling, yjog
Target Milestone: rc   
Target Release: 7.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.1.2-1.el7 Doc Type: Bug Fix
Doc Text:
Cause: If a filter is not supplied, the default filter is "objectclass=inetuser". Consequence: The documentation states that all users(with memberof attributes) should be checked, but in fact only users with a certain objectclass are checked. Fix: Correct the filter to use the proper objectclasses for retrieving the correct entries. Result: The fixup-memberof.pl script/task works as described in the documentation.
Story Points: ---
Clone Of:
: 949364 (view as bug list) Environment:
Last Closed: 2014-06-13 11:48:00 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 949364    

Description Najmuddin Chirammal 2013-04-02 18:11:27 UTC
Description of problem:

fixup-memberof.pl help says, "-f filter: Filter for entries to fix up, If omitted, all entries under the specified base will have their memberOf attribute regenerated".

It seems the filter option uses 'objectClass=inetuser' by default(it renames only entries that matches the default filter) and if this condition is not met, it wont rename the entries.

Adding more clarification to the 'filter' option would really help when someone allows 'memberof' in some other objectClass and do not use inetUser objectClass at all.

How reproducible: Always.


Steps to Reproduce:
1. Use an objectClass that allows 'memberof' attribute (and no inetUser objectClass) in a user entry (eg: objectClass=ipaHost, this allows memberof)
2. Add the user to a group
3. Enable memberof plugin.
4. Run fixup-memberof.pl to add 'memberof' attribute.
  
Actual results: fixup-memberof.pl fixes ony user entries with inetUser objectClass.

Expected results: fixup-memberof.pl fixes all user entries that allows 'memberof' attribute. Currnetly this is possibly by mentioning a filter to override the default(-f option) however this is not documented in the help output (or in documentation).

Additional info:

Comment 1 Nathan Kinder 2013-04-08 01:51:07 UTC
This bug should be used to correct the fixup-memberof.pl usage output and man page.  A separate bug has been opened up to make a change to the Red Hat Directory Server documentation.

Comment 2 Nathan Kinder 2013-04-08 01:53:21 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/47315

Comment 3 Rich Megginson 2013-10-01 23:24:02 UTC
moving all ON_QA bugs to MODIFIED in order to add them to the errata (can't add bugs in the ON_QA state to an errata).  When the errata is created, the bugs should be automatically moved back to ON_QA.

Comment 6 mreynolds 2014-01-17 15:58:20 UTC
Previously the usage/documentation stated that if you don't supply a filter,
then "all" the entries will be checked by the memberof plugin.  Actually only entries that have "objectclass: inetuser" were checked.  This was not complete and could miss entries, so this fix checks for entries that have the objectclass inetadmin as well.

So internally the plugin now looks for entries using this filter "(|(objectclass=inetuser)(objectclass=inetadmin))"

Comment 7 Amita Sharma 2014-01-20 10:56:32 UTC
Executed Steps ::
==================
1. Create a user with objectclass: inetuser and another user with objectclass=inetadmin
2. Add the users to the group.
3. Enable memberof plugin.
4. Run fixup-memberof.pl to add 'memberof' attributes to the users.
ldapsearch -xLLL -p 389 -h localhost -D "cn=Directory Manager" -w Secret123 -b "cn=rhgroup3,ou=people,dc=example,dc=com"
dn: cn=rhgroup3,ou=People,dc=example,dc=com
objectClass: top
objectClass: groupofuniquenames
objectClass: ntGroup
ntGroupDeleteGroup: true
cn: rhgroup3
ntUserDomainId: rhgroup3
ntGroupType: -2147483646
ntUniqueId: 3
uniqueMember: uid=amsharma1,ou=people,dc=example,dc=com
uniqueMember: cn=ams,ou=people,dc=example,dc=com

enabled plugin

[root@dhcp201-149 ~]# fixup-memberof.pl -Z slapd-dhcp201-149 -D "cn=Directory Manager" -w Secret123 -b "dc=example,dc=com"
Successfully added task entry "cn=memberOf_fixup_2014_1_20_14_50_6, cn=memberOf task, cn=tasks, cn=config"

[root@dhcp201-149 ~]# tail -f /var/log/dirsrv/slapd-dhcp201-149/errors
[20/Jan/2014:14:50:05 +051800] memberof-plugin - Memberof task starts (arg: (|(objectclass=inetuser)(objectclass=inetadmin))) ...
[20/Jan/2014:14:50:05 +051800] memberof-plugin - Memberof task finished (arg: (|(objectclass=inetuser)(objectclass=inetadmin))) ...

AND

#man fixup-memberof.pl
-f filterAn  LDAP  query filter to use to select the entries within the subtree to update. If there is no filter set, then the memberOf attribute is regenerated for every entry in the subtree that has the objectclass inetuser/inetadmin.

Comment 8 mreynolds 2014-01-23 17:18:19 UTC
(In reply to Amita Sharma from comment #7)
> Executed Steps ::
> ==================
> 1. Create a user with objectclass: inetuser and another user with
> objectclass=inetadmin
> 2. Add the users to the group.
> 3. Enable memberof plugin.
> 4. Run fixup-memberof.pl to add 'memberof' attributes to the users.
> ldapsearch -xLLL -p 389 -h localhost -D "cn=Directory Manager" -w Secret123
> -b "cn=rhgroup3,ou=people,dc=example,dc=com"
> dn: cn=rhgroup3,ou=People,dc=example,dc=com
> objectClass: top
> objectClass: groupofuniquenames
> objectClass: ntGroup
> ntGroupDeleteGroup: true
> cn: rhgroup3
> ntUserDomainId: rhgroup3
> ntGroupType: -2147483646
> ntUniqueId: 3
> uniqueMember: uid=amsharma1,ou=people,dc=example,dc=com
> uniqueMember: cn=ams,ou=people,dc=example,dc=com
> 
> enabled plugin
> 
> [root@dhcp201-149 ~]# fixup-memberof.pl -Z slapd-dhcp201-149 -D
> "cn=Directory Manager" -w Secret123 -b "dc=example,dc=com"
> Successfully added task entry "cn=memberOf_fixup_2014_1_20_14_50_6,
> cn=memberOf task, cn=tasks, cn=config"
> 
> [root@dhcp201-149 ~]# tail -f /var/log/dirsrv/slapd-dhcp201-149/errors
> [20/Jan/2014:14:50:05 +051800] memberof-plugin - Memberof task starts (arg:
> (|(objectclass=inetuser)(objectclass=inetadmin))) ...
> [20/Jan/2014:14:50:05 +051800] memberof-plugin - Memberof task finished
> (arg: (|(objectclass=inetuser)(objectclass=inetadmin))) ...
> 
> AND
> 
> #man fixup-memberof.pl
> -f filterAn  LDAP  query filter to use to select the entries within the
> subtree to update. If there is no filter set, then the memberOf attribute is
> regenerated for every entry in the subtree that has the objectclass
> inetuser/inetadmin.

This looks correct.

Comment 9 Amita Sharma 2014-01-24 07:33:19 UTC
Marking bug as VERIFIED plz see above comments.

Comment 10 Ludek Smid 2014-06-13 11:48:00 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.