Bug 693455

Summary: nsMatchingRule does not work with multiple values
Product: [Retired] 389 Reporter: Rich Megginson <rmeggins>
Component: Database - Indexes/SearchesAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: high Docs Contact:
Priority: high    
Version: 1.2.8CC: amsharma
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 693522 (view as bug list) Environment:
Last Closed: 2015-12-07 17:17:38 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, 693522    
Attachments:
Description Flags
0003-Bug-693455-nsMatchingRule-does-not-work-with-multipl.patch nkinder: review+

Description Rich Megginson 2011-04-04 17:55:34 UTC
nsMatchingRule is supposed to be a multi-valued attribute e.g.
nsMatchingRule: 2.16.840.1.113730.3.3.2.15.1
nsMatchingRule: 2.16.840.1.113730.3.3.2.15.1.6
nsMatchingRule: 2.16.840.1.113730.3.3.2.11.1
nsMatchingRule: 2.16.840.1.113730.3.3.2.11.1.6

This does not work.  The server concatenates them all together with no spaces or other delimiters.

Comment 1 Rich Megginson 2011-04-04 21:12:48 UTC
Created attachment 489858 [details]
0003-Bug-693455-nsMatchingRule-does-not-work-with-multipl.patch

Comment 2 Rich Megginson 2011-04-05 01:43:14 UTC
To ssh://git.fedorahosted.org/git/389/ds.git
   27ff25d..466fced  master -> master
commit 58902a28c077309cf0e942bfb03762d96eb9c8af
Author: Rich Megginson <rmeggins>
Date:   Mon Apr 4 11:55:30 2011 -0600
    Reviewed by: nkinder (Thanks!)
    Branch: master
    Fix Description: The variable isFirst was not being used correctly.  Instead
    of using it, just use tmpBuf[0] to see if this is the first iteration or
    not.
    Platforms tested: RHEL6 x86_64
    Flag Day: no
    Doc impact: no

Comment 3 Rich Megginson 2011-04-05 02:08:02 UTC
To ssh://git.fedorahosted.org/git/389/ds.git
   e2288d9..5c1cd5f  389-ds-base-1.2.8 -> 389-ds-base-1.2.8
commit 9a5ad287f2b4d0c3ce49be3107c61c00551b9314
Author: Rich Megginson <rmeggins>
Date:   Mon Apr 4 11:55:30 2011 -0600

Comment 4 Amita Sharma 2011-04-29 06:38:15 UTC
1. [root@rheltest slapd-rheltest]# ldapmodify -a -D "cn=directory manager" -w
Secret123 -p 1389 -h localhost << EOF
> dn: cn=businesscategory,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
> nsMatchingRule: 2.16.840.1.113730.3.3.2.11.1
> nsMatchingRule: 2.16.840.1.113730.3.3.2.3.1
> nsMatchingRule: 2.16.840.1.113730.3.3.2.17.1
> nsIndexType: eq
> nsIndexType: pres
> nsIndexType: sub
> nsSystemIndex: false
> objectClass: top
> objectClass: nsIndex
> cn: businesscategory
> EOF
adding new entry "cn=businesscategory,cn=index,cn=userRoot,cn=ldbm
database,cn=plugins,cn=config"

2. [root@rheltest slapd-rheltest]# cd /usr/lib64/dirsrv/slapd-rheltest/
[root@rheltest slapd-rheltest]# ./db2index.pl -D "cn=Directory Manager" -w
Secret123 -n userRoot -t businesscategory
adding new entry "cn=db2index_2011_4_28_13_45_50, cn=index, cn=tasks,
cn=config"

3. [root@rheltest slapd-rheltest]# ldapsearch -x -D "cn=directory manager" -w
Secret123 -p 1389 -h localhost -b "cn=index,cn=userRoot,cn=ldbm
database,cn=plugins,cn=config"
# businesscategory, index, userRoot, ldbm database, plugins, config
dn: cn=businesscategory,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=co
 nfig
nsMatchingRule: 2.16.840.1.113730.3.3.2.11.1
nsMatchingRule: 2.16.840.1.113730.3.3.2.3.1
nsMatchingRule: 2.16.840.1.113730.3.3.2.17.1
nsIndexType: eq
nsIndexType: pres
nsIndexType: sub
nsSystemIndex: false
objectClass: top
objectClass: nsIndex
cn: businesscategory

[root@rheltest slapd-rheltest]# ldapmodify -x -h localhost -p 1389 -D
"cn=Directory Manager" -w Secret123 << EOF
> dn: uid=amimash,dc=example,dc=com
> changetype: modify
> add: businesscategory
> businesscategory: abcd
> EOF
modifying entry "uid=amimash,dc=example,dc=com"

[root@rheltest slapd-rheltest]# find / -name *.db4 | grep -i
BusinessCategory.db4
/var/lib/dirsrv/slapd-rheltest/db/userRoot/businesscategory.db4

Marking the bug as VERIFIED.