Bug 1118059

Summary: [RFE] add fixup-memberuid.pl script
Product: Red Hat Enterprise Linux 7 Reporter: Noriko Hosoi <nhosoi>
Component: 389-ds-baseAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.0CC: jgalipea, nhosoi, nkinder, rmeggins
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.3.1-1.el7 Doc Type: Enhancement
Doc Text:
The new fixup-memberuid.pl script corrects mismatched member and uniquemember values If the member and uniquemember attribute values in the posixGroup entries on the Directory Server (DS) and Active Directory (AD) do not match, the new fixup-memberuid.pl script is now available to fix the problem. Running fixup-memberuid.pl on DS recreates the memberuid values and automatically modifies the member and uniquemember values to match the values defined on AD.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 09:36:11 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 Noriko Hosoi 2014-07-09 22:47:33 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/555

This script can trigger a task for recreating memberuid values

Comment 4 Noriko Hosoi 2014-10-28 21:33:18 UTC
Correction: fixup-memberuid.pl was implemented by Carsten Grzemba <grzemba> and added to 389-ds-base-1.3.3.
/usr/lib64/dirsrv/slapd-ID/fixup-memberuid.pl

The script fixes up the mismatched member/uniquemember in the posixGroup between DS and AD.

Usage: fixup-memberuid.pl [-v] -D rootdn { -w password | -w - | -j filename }
        -b baseDN [-f filter]
 Opts: -D rootdn           - Directory Manager
     : -w password         - Directory Manager's password
     : -w -                - Prompt for Directory Manager's password
     : -j filename         - Read Directory Manager's password from file
     : -b baseDN           - Base DN that contains entries to fix up
     : -f filter           - Filter for entries to fix up
                             If omitted, all entries under the specified
                             base will have their memberUid attribute
                             regenerated.
     : -v                  - verbose

To verify, disconnect DS and AD.
Add member and uniquemember to the posixgroup entries on each server.
Run fixup-memberuid.pl (see the above usage)

Comment 5 Sankar Ramalingam 2014-11-25 21:01:21 UTC
Fixup memberuid.pl script fails to add a task and throws error 32.

./fixup-memberuid.pl   -D "cn=Directory Manager" -w Secret123 -b "dc=memofsuff,dc=com"
adding new entry "cn=memberUid_fixup_2014_11_26_2_23_36, cn=memberuid task, cn=tasks, cn=config"
ldap_add: No such object (32)

ldapsearch -x -p 1989 -h localhost -D "cn=Directory Manager" -w Secret123 -b "cn=tasks,cn=config" |grep -i memberuid
[root@vm-idm-042 slapd-testinst1]# 

It looks like the memberuid task is not added to the list of tasks. Hence, changing the status to assigned.

Comment 6 Sankar Ramalingam 2014-12-03 12:23:51 UTC
I went ahead and manually added the task entry for this. Then, I could successfully run fixupmemberid.pl script. Hence, marking the bug as Verified.

[root@vm-idm-035 slapd-test3]# /usr/bin/ldapmodify -ax -h localhost -p 9389 -D "cn=Directory Manager" -w Secret123 << EOF
dn: cn=memberuid task,cn=tasks,cn=config
objectClass: top
objectClass: extensibleObject
EOF

adding new entry "cn=memberuid task,cn=tasks,cn=config"

[root@vm-idm-035 slapd-test3]# ./fixup-memberuid.pl -D "cn=Directory Manager" -w Secret123 -b "dc=example,dc=com" -f "uid=new*"
adding new entry "cn=memberUid_fixup_2014_12_3_17_47_44, cn=memberuid task, cn=tasks, cn=config"


For other tasks, the task entries are already present under "cn=tasks, cn=config". So, if this is something you missed, please add so in the next build.

Comment 8 errata-xmlrpc 2015-03-05 09:36:11 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-0416.html