Bug 431607
Summary: | referential integrity plugin incorrectly treats "rename" operations | ||
---|---|---|---|
Product: | [Retired] 389 | Reporter: | Andrey Ivanov <andrey.ivanov> |
Component: | Server - Plugins | Assignee: | Rich Megginson <rmeggins> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Chandrasekar Kannan <ckannan> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 1.1.3 | CC: | benl, yzhang |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | 8.1 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-04-29 23:02:24 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: | |||
Bug Depends On: | |||
Bug Blocks: | 249650, 493682 |
Description
Andrey Ivanov
2008-02-05 21:02:37 UTC
I've looked through the code of the plug-in (the file referint.c). The simplest solution would be the first one (eliminate the spaces that are added by the plug-in code). The lines in the code to rewrite : 404 - 414. Proposed patch (tested, works fine, don't know if there are any interferences with the rest of the code): --- referint.c 2007-10-18 02:08:31.000000000 +0200 +++ referint-patched.c 2008-02-06 14:59:00.000000000 +0100 @@ -401,8 +401,8 @@ dnsize = 0; for(x=1; dnParts[x] != NULL; x++) { - /* +2 for space and comma adding later */ - dnsize += strlen(dnParts[x]) + 2; + /* +1 for comma adding later */ + dnsize += strlen(dnParts[x]) + 1; } /* add the newrDN length */ dnsize += strlen(newrDN) + 1; @@ -411,7 +411,7 @@ strcat(newDN, newrDN); for(x=1; dnParts[x] != NULL; x++) { - strcat(newDN, ", "); + strcat(newDN, ","); strcat(newDN, dnParts[x]); } Andrey - Have you submitted a CLA? http://directory.fedoraproject.org/wiki/Contributing I don't see your name or email address in the cla_done group - https://admin.fedoraproject.org/accounts/group/view/cla_done The process is pretty easy now - basically just create an account in the Fedora Admin system and go through the click through process If you have submitted a CLA then don't worry about it. At any rate, I think we can accept the patch anyway considering that it is only a couple of lines. Checking in referint.c; /cvs/dirsec/ldapserver/ldap/servers/plugins/referint/referint.c,v <-- referint.c new revision: 1.9; previous revision: 1.8 done Bug verified. Bug closed test is below (i am using the same set of data that Andrey is using) 1. setup DS 8.1 (my platform is on RHEL 5.3 i386) 2. enable referential integrity postoperation plugin 3. restart server 4. setup suffix "dc=example,dc=com" 5. follow Andrey's steps: 5.1 inject all testing data (bv1.ldif is below), and verity it 5.2 do rename with bv2.dlif, and verify it 5.3 do another rename with bv3.ldif and verity it test result: pass ==================== test output is below:================ <DS81installed>[root@mv32a-vm ~]# /usr/lib/mozldap/ldapsearch -D "cn=directory manager" -w redhat123 -s sub -b "dc=example,dc=com" objectclass=* dn version: 1 dn: dc=example,dc=com dn: ou=Organisation,dc=example,dc=com dn: ou=Student,ou=Organisation,dc=example,dc=com dn: ou=X02,ou=Student,ou=Organisation,dc=example,dc=com dn: ou=Users,dc=example,dc=com dn: uid=marion.henriet,ou=Users,dc=example,dc=com <DS81installed>[root@mv32a-vm ~]# /usr/lib/mozldap/ldapmodify -D "cn=directory manager" -w redhat123 -f ./bv2.ldif modifying RDN of entry ou=X02,ou=Student,ou=Organisation,dc=example,dc=com and/or moving it beneath a new parent <DS81installed>[root@mv32a-vm ~]# /usr/lib/mozldap/ldapsearch -D "cn=directory manager" -w redhat123 -s sub -b "dc=example,dc=com" objectclass=* dn version: 1 dn: dc=example,dc=com dn: ou=Organisation,dc=example,dc=com dn: ou=Student,ou=Organisation,dc=example,dc=com dn: ou=Y02,ou=Student,ou=Organisation,dc=example,dc=com dn: ou=Users,dc=example,dc=com dn: uid=marion.henriet,ou=Users,dc=example,dc=com <DS81installed>[root@mv32a-vm ~]# ls /var/log/dirsrv/slapd-mv32a-vm/referintls: /var/log/dirsrv/slapd-mv32a-vm/referint: No such file or directory <DS81installed>[root@mv32a-vm ~]# /usr/lib/mozldap/ldapsearch -D "cn=directory manager" -w redhat123 -s sub -b "dc=example,dc=com" objectclass=* version: 1 dn: dc=example,dc=com objectClass: top objectClass: domain dc: example dn: ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Organisation dn: ou=Student,ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Student dn: ou=Y02,ou=Student,ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Y02 dn: ou=Users,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Users dn: uid=marion.henriet,ou=Users,dc=example,dc=com objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson sn: Henriet givenName: Marion uid: marion.henriet cn: Henriet Marion displayName: Henriet Marion (Mlle) ou: ou=X02,ou=Student,ou=Organisation,dc=example,dc=com <DS81installed>[root@mv32a-vm ~]# vi bv3.ldif <DS81installed>[root@mv32a-vm ~]# /usr/lib/mozldap/ldapmodify -D "cn=directory manager" -w redhat123 -f ./bv3.ldif modifying RDN of entry ou=Y02,ou=Student,ou=Organisation,dc=example,dc=com and/or moving it beneath a new parent <DS81installed>[root@mv32a-vm ~]# /usr/lib/mozldap/ldapsearch -D "cn=directory manager" -w redhat123 -s sub -b "dc=example,dc=com" objectclass=* version: 1 dn: dc=example,dc=com objectClass: top objectClass: domain dc: example dn: ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Organisation dn: ou=Student,ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Student dn: ou=Z02,ou=Student,ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Z02 dn: ou=Users,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Users dn: uid=marion.henriet,ou=Users,dc=example,dc=com objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson sn: Henriet givenName: Marion uid: marion.henriet cn: Henriet Marion displayName: Henriet Marion (Mlle) ou: ou=X02,ou=Student,ou=Organisation,dc=example,dc=com =========== cat bv1.ldif =============== dn: dc=example,dc=com objectClass: top objectClass: domain dc: example dn: ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Organisation dn: ou=Student,ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Student dn: ou=X02,ou=Student,ou=Organisation,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: X02 dn: ou=Users,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Users dn: uid=marion.henriet,ou=Users,dc=example,dc=com objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson sn: Henriet givenName: Marion uid: marion.henriet cn: Henriet Marion displayName: Henriet Marion (Mlle) ou: ou=X02,ou=Student,ou=Organisation,dc=example,dc=com ============= cat bv2.ldif ============ dn: ou=X02,ou=Student,ou=Organisation,dc=example,dc=com changetype: modrdn newrdn: ou=Y02 deleteoldrdn: 1 newsuperior: ou=Student,ou=Organisation,dc=example,dc=com ============== cat bv3.ldif ========== dn: ou=Y02,ou=Student,ou=Organisation,dc=example,dc=com changetype: modrdn newrdn: ou=Z02 deleteoldrdn: 1 newsuperior: ou=Student,ou=Organisation,dc=example,dc=com An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-0455.html |