Bug 1018914

Summary: fixup memberof task does not work: task entry not added
Product: Red Hat Enterprise Linux 7 Reporter: Nathan Kinder <nkinder>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Sankar Ramalingam <sramling>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: amsharma, jgalipea
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.1.6-7.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:30:12 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 Nathan Kinder 2013-10-14 16:51:26 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/47560

memberof plugins supports fixup tasks. A task can be created with the perl script /usr/lib64/dirsrv/slapd-<instance>/fixup-memberof.pl. It calls /usr/sbin/fixup-memberof.pl to open a connection with the DS instances, bind and create a task entry.

The ldap task entry is not created because '$entry' is not initialized (1.3.1 and after)

Comment 1 Nathan Kinder 2013-10-15 14:19:35 UTC
Steps to reproduce: Rapid

create instance - stop instance - enable mbo - start instance
 /usr/lib64/dirsrv/slapd-<instance>/fixup-memberof.pl -D "cn=directory
 manager" -w xxx -P LDAP -b "dc=com"

 With the fix (check access log to see the ADD):
 [15/Oct/2013:10:58:20 +0200] conn=4 fd=65 slot=65 connection from
 192.168.1.2 to 192.168.1.2
 [15/Oct/2013:10:58:20 +0200] conn=4 op=0 BIND dn="cn=directory manager"
 method=128 version=3
 [15/Oct/2013:10:58:20 +0200] conn=4 op=0 RESULT err=0 tag=97 nentries=0
 etime=0 dn="cn=directory manager"
 [15/Oct/2013:10:58:20 +0200] conn=4 op=1 ADD
 dn="cn=memberOf_fixup_2013_10_15_10_58_20,cn=memberOf
 task,cn=tasks,cn=config"
 [15/Oct/2013:10:58:20 +0200] conn=4 op=1 RESULT err=0 tag=105 nentries=0
 etime=0
 [15/Oct/2013:10:58:20 +0200] conn=4 op=2 UNBIND
 [15/Oct/2013:10:58:20 +0200] conn=4 op=2 fd=65 closed - U1

 Without the fix:
 [15/Oct/2013:10:59:03 +0200] conn=5 fd=65 slot=65 connection from
 192.168.1.2 to 192.168.1.2
 [15/Oct/2013:10:59:03 +0200] conn=5 op=0 BIND dn="cn=directory manager"
 method=128 version=3
 [15/Oct/2013:10:59:03 +0200] conn=5 op=0 RESULT err=0 tag=97 nentries=0
 etime=0 dn="cn=directory manager"
 [15/Oct/2013:10:59:03 +0200] conn=5 op=1 UNBIND
 [15/Oct/2013:10:59:03 +0200] conn=5 op=1 fd=65 closed - U1


Others steps to reproduce:
create instance
add the following entries:


 dn: uid=x4,dc=com
 uid: x4
 objectClass: top
 objectClass: person
 objectClass: organizationalPerson
 objectClass: inetorgperson
 objectClass: inetuser
 sn: x4
 cn: x4

 dn: cn=RedHat,dc=com
 objectClass: top
 objectClass: groupOfNames
 objectClass: inetuser
 cn: RedHat


Make x4 memberof group 'redhat'


 ldapmodify -h localhost -p xxx -D "cn=directory manager" -w Secret123
 dn: uid=x4,dc=com
 changetype: modify
 add: memberof
 memberof: cn=RedHat,dc=com


stop instance - enable mbo - start instance

without the fix:

 /usr/lib64/dirsrv/slapd-<instance>/fixup-memberof.pl -D "cn=directory
 manager" -w xxx -P LDAP -b "dc=com"

 ldapsearch -LLL -h localhost -p 47398 -D "cn=directory manager" -w xxx -b
 "dc=com" "cn=redhat*"
 dn: cn=RedHat,dc=com
 objectClass: top
 objectClass: groupOfNames
 objectClass: inetuser
 cn: RedHat

 ldapsearch -LLL -h localhost -p 47398 -D "cn=directory manager" -w xxx -b
 "dc=com" "uid=x4"
 dn: uid=x4,dc=com
 uid: x4
 objectClass: top
 objectClass: person
 objectClass: organizationalPerson
 objectClass: inetorgperson
 objectClass: inetuser
 sn: x4
 cn: x4
 memberOf: cn=RedHat,dc=com



With the fix (entry x4 has no longer the memberof value):

 /usr/lib64/dirsrv/slapd-<instance>/fixup-memberof.pl -D "cn=directory
 manager" -w xxx -P LDAP -b "dc=com"

 ldapsearch -LLL -h localhost -p 47398 -D "cn=directory manager" -w xxx -b
 "dc=com" "cn=redhat*"
 dn: cn=RedHat,dc=com
 objectClass: top
 objectClass: groupOfNames
 objectClass: inetuser
 cn: RedHat

 ldapsearch -LLL -h localhost -p 47398 -D "cn=directory manager" -w xxx -b
 "dc=com" "uid=x4"
 dn: uid=x4,dc=com
 uid: x4
 objectClass: top
 objectClass: person
 objectClass: organizationalPerson
 objectClass: inetorgperson
 objectClass: inetuser
 sn: x4
 cn: x4

Comment 3 Amita Sharma 2014-02-04 11:11:24 UTC
[root@dhcp201-149 export]# /usr/lib64/dirsrv/slapd-dhcp201-149/fixup-memberof.pl -D "cn=directory manager" -w Secret123 -P LDAP -b "dc=com"
Successfully added task entry "cn=memberOf_fixup_2014_2_4_16_18_38, cn=memberOf task, cn=tasks, cn=config"

[root@dhcp201-149 export]# tail -f /var/log/dirsrv/slapd-dhcp201-149/access
[04/Feb/2014:16:18:37 +051800] conn=1 op=0 RESULT err=0 tag=101 nentries=1 etime=0
[04/Feb/2014:16:18:37 +051800] conn=1 op=1 UNBIND
[04/Feb/2014:16:18:37 +051800] conn=1 op=1 fd=64 closed - U1
[04/Feb/2014:16:18:37 +051800] conn=2 fd=65 slot=65 connection from 10.65.201.149 to 10.65.201.149
[04/Feb/2014:16:18:37 +051800] conn=2 op=0 BIND dn="cn=directory manager" method=128 version=3
[04/Feb/2014:16:18:37 +051800] conn=2 op=0 RESULT err=0 tag=97 nentries=0 etime=0 dn="cn=directory manager"
[04/Feb/2014:16:18:37 +051800] conn=2 op=1 ADD dn="cn=memberOf_fixup_2014_2_4_16_18_38,cn=memberOf task,cn=tasks,cn=config"
[04/Feb/2014:16:18:37 +051800] conn=2 op=1 RESULT err=0 tag=105 nentries=0 etime=0
[04/Feb/2014:16:18:37 +051800] conn=2 op=2 UNBIND
[04/Feb/2014:16:18:37 +051800] conn=2 op=2 fd=65 closed - U1

Hence marking as VERIFIED.

Comment 4 Amita Sharma 2014-03-12 07:08:54 UTC
This bug is covered under mbo test suit already,
====================================================

Test Case :: startTask4()

TeT File :: /export/svrbld/ds_acceptance/RHEL7/testcases/DS/6.0/mbo/acceptance/mboMisc.sh

Results::
Lauching fix-up task using fixup-memberof.pl...
Successfully added task entry "cn=memberOf_fixup_2014_3_3_8_1_26, cn=memberOf task, cn=tasks, cn=config"

Result Link :: http://wiki.idm.lab.bos.redhat.com/qa/archive/beaker/RHEL-7.0-20140226.0/x86_64/389-ds-base-1.3.1.6-21.el7.x86_64/output/Linux/20140303-021144/mbo/acceptance/mbo.run.out.12761

Comment 5 Ludek Smid 2014-06-13 11:30:12 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.