Bug 544089
Summary: | Referential Integrity Plugin does not take into account the attribute subtypes | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] 389 | Reporter: | Andrey Ivanov <andrey.ivanov> | ||||||||||
Component: | Server - Plugins | Assignee: | Rich Megginson <rmeggins> | ||||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Viktor Ashirov <vashirov> | ||||||||||
Severity: | medium | Docs Contact: | |||||||||||
Priority: | high | ||||||||||||
Version: | 1.2.1 | CC: | jgalipea, nhosoi | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | All | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2015-12-07 16:52:48 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: | 434914, 543590 | ||||||||||||
Attachments: |
|
Description
Andrey Ivanov
2009-12-03 21:44:29 UTC
Created attachment 377888 [details]
Proposed patch to referint.c file
Created attachment 377890 [details]
The patched referint.c file
The referint.c file patched with the proposed patch.
https://bugzilla.redhat.com/attachment.cgi?id=377888&action=diff#referint.c_sec4 at line 392 in the new file - you have this: (slapi_attr_value_find(attr, (struct berval *)slapi_value_get_berval(oldDNslv)) == 0)) is it really necessary to cast the return value of slapi_value_get_berval()? int slapi_attr_value_find( const Slapi_Attr *a, const struct berval *v ); so it takes a const, and slapi_value_get_berval() returns a const. No, you're right, it is not necessary. The thing is that the return type of slapi_value_get_berval() is not precisely indicated in RHDS plug-in guide (http://www.redhat.com/docs/manuals/dir-server/8.1/pdf/Plug-in_Guide.pdf). So i've searched an example in the server code. I've found it in ldap/servers/slapd/pw.c (lines 1000-10004) : if (slapi_attr_value_find(attr, (struct berval *)slapi_value_get_berval(vals[0])) == 0 ) Now that i've looked into slapi-plugin.h the return type is indeed const struct berval *... Thanks. In the future, then plugin guide will be generated directly from slapi-plugin.h with doxygen. There is some support already, but there is a lot of API to document . . . Hi Andrey, I'd like to work on bug 557224 "subtree rename breaks the referential integrity plug-in", which looks requiring to change the code this bug fix affects. Could you please provide us a new patch including the change suggested by Rich? We are going to check it. That helps me a lot to work on the bug... Thanks in advance, --noriko Created attachment 386694 [details]
Proposed patch to referint.c file
Modified patch including the change suggested by Rich
Comment on attachment 386694 [details]
Proposed patch to referint.c file
Thank you, Andrey!
Your new patch looks good to me.
Hi Noriko, here is the new patch. You are right, it is much simpler to integrate it now. If we try to do that after the modifications necessary to take into account subtree renames it would be a nightmare... Created attachment 386725 [details]
git patch file containing the fix provided by Andrey.
Thanks to Andrey for providing the patch.
Reviewed by rmeggins and nhosoi.
Pushed to master.
$ git merge work
Updating 0e9fd8b..1a76980
Fast forward
ldap/servers/plugins/referint/referint.c | 152 ++++++++++++++++-------------
1 files changed, 84 insertions(+), 68 deletions(-)
$ git push
Counting objects: 13, done.
Delta compression using 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.86 KiB, done.
Total 7 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
0e9fd8b..1a76980 master -> master
verified - RHEL 4 version: redhat-ds-base-8.2.0-2010051204.el4dsrv before modrdn: # john.doe, People, example.com dn: uid=john.doe,ou=People,dc=example,dc=com uid: john.doe sn: Doe givenName: John cn: DOE John objectClass: inetorgperson objectClass: organizationalPerson objectClass: person objectClass: top manager: uid=small.chief,ou=People,dc=example,dc=com manager;10: uid=big.chief,ou=People,dc=example,dc=com manager;20: uid=small.chief,ou=People,dc=example,dc=com after modrdn: # john.doe, People, example.com dn: uid=john.doe,ou=People,dc=example,dc=com uid: john.doe sn: Doe givenName: John cn: DOE John objectClass: inetorgperson objectClass: organizationalPerson objectClass: person objectClass: top manager: uid=small.chief.jr,ou=people,dc=example,dc=com manager;20: uid=small.chief.jr,ou=people,dc=example,dc=com manager;10: uid=big.chief.jr,ou=people,dc=example,dc=com |