Bug 659131

Summary: DNA Entries in replicated tree contains wrong "RDN" attribute values
Product: [Retired] 389 Reporter: Simo Sorce <ssorce>
Component: Directory ServerAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2.7CC: amsharma, jgalipea, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:48:07 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: 639035, 656390    
Attachments:
Description Flags
Patch nhosoi: review+

Description Simo Sorce 2010-12-02 00:04:25 UTC
While checking the the entries the DNA plugin creates in the replicated part of the tree I noticed that there is an attribute that looks just wrong.

The dnahostname attribute contains a value that is the RDN linearized like if it weren't a multivalue one.

# f2.ipa.ssimo.org + 389, posix-ids, dna, ipa, etc, ipa.ssimo.org
dn: dnaHostname=f2.ipa.ssimo.org+dnaPortNum=389,cn=posix-ids,cn=dna,cn=ipa,cn=
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 etc,dc=ipa,dc=ssimo,dc=org
objectClass: extensibleObject
objectClass: top
dnahostname: f2.ipa.ssimo.org
dnahostname: f2.ipa.ssimo.org+dnaPortNum=389
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dnaportnum: 389
dnasecureportnum: 636
dnaremainingvalues: 0


Nathan suggests this is a bug in the server when checking if the RDN is present as an attribute in the entry.

Comment 1 Simo Sorce 2010-12-02 00:13:49 UTC
On a closer look I have more interesting data.

In my setup I have 2 servers:
f1.ipa.ssimo.org is a Fedora 14 VM (i686.PAE) using 389-ds-base 1.2.7.1-1
f2.ipa.ssimo.org is a Fedora 13 VM (x86_64) using 389-ds-base 1.2.7-2

The following 2 entries were created by the respective DNA plugins:

 # f1.ipa.ssimo.org + 389, posix-ids, dna, ipa, etc, ipa.ssimo.org
dn: dnaHostname=f1.ipa.ssimo.org+dnaPortNum=389,cn=posix-ids,cn=dna,cn=ipa,cn=
 etc,dc=ipa,dc=ssimo,dc=org
objectClass: extensibleObject
objectClass: top
dnahostname: f1.ipa.ssimo.org
dnaportnum: 389
dnasecureportnum: 636
dnaremainingvalues: 999995

# f2.ipa.ssimo.org + 389, posix-ids, dna, ipa, etc, ipa.ssimo.org
dn: dnaHostname=f2.ipa.ssimo.org+dnaPortNum=389,cn=posix-ids,cn=dna,cn=ipa,cn=
 etc,dc=ipa,dc=ssimo,dc=org
objectClass: extensibleObject
objectClass: top
dnahostname: f2.ipa.ssimo.org
dnahostname: f2.ipa.ssimo.org+dnaPortNum=389
dnaportnum: 389
dnasecureportnum: 636
dnaremainingvalues: 0

Comment 3 Nathan Kinder 2011-01-06 19:51:13 UTC
Created attachment 472121 [details]
Patch

Comment 4 Nathan Kinder 2011-01-06 19:53:47 UTC
This bug can be easily reproduced without configuring the DNA plug-in.  To reproduce, simply use ldapmodify to perform the following operation on a platform where 389-ds-base is built against the MozLDAP client libraries (such as F13):

dn: foo=test+bar=test,dc=example,dc=com
changetype: add
objectclass: extensibleobject
foo: test
bar: test

The bug will cause an extra value to be added for the "bar" attribute with a value of "test+foo=test".

Comment 5 Nathan Kinder 2011-01-06 20:00:37 UTC
Pushed to master.  Thanks to Noriko for her review!

Counting objects: 11, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 793 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   90f26ec..8c30b05  master -> master

Comment 6 Amita Sharma 2011-05-24 13:31:17 UTC
/usr/lib64/mozldap/ldapmodify -h localhost -p 389 -D "cn=Directory Manager" -w Secret123 << EOF
> dn: foo=test+bar=test,ou=people,dc=test,dc=com
> changetype: add
> objectclass: extensibleobject
> foo: test
> bar: test
> EOF
adding new entry foo=test+bar=test,ou=people,dc=test,dc=com

Entry Added:
# test + test, people, test.com
dn: bar=test+foo=test,ou=people,dc=test,dc=com
objectClass: extensibleobject
objectClass: top
foo: test
bar: test

[root@testvm scripts]# /usr/lib64/mozldap/ldapmodify -h localhost -p 389 -D "cn=Directory Manager" -w Secret123 << EOF
> dn: bar=txt,ou=people,dc=test,dc=com
> changetype: add
> objectclass: extensibleobject
> foo: test
> bar: test
> EOF
adding new entry bar=txt,ou=people,dc=test,dc=com

Entry Added
# txt, people, test.com
dn: bar=txt,ou=people,dc=test,dc=com
objectClass: extensibleobject
objectClass: top
foo: test
bar: test
bar: txt

# 0, people, test.com
dn: bar=0,ou=people,dc=test,dc=com
objectClass: extensibleobject
objectClass: top
foo: test
bar: test
bar: 0