Bug 518514 - Bitwise Plugin: Bitwise filter doesn't return except the first entry if its multi-valued
Summary: Bitwise Plugin: Bitwise filter doesn't return except the first entry if its m...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: Server - Plugins
Version: 9.0
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 434914 389_1.2.3
TreeView+ depends on / blocked
 
Reported: 2009-08-20 16:38 UTC by Sankar Ramalingam
Modified: 2016-05-06 14:37 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-06 14:37:38 UTC


Attachments (Terms of Use)
patch (1.84 KB, patch)
2009-09-25 17:42 UTC, Rich Megginson
no flags Details | Diff

Description Sankar Ramalingam 2009-08-20 16:38:05 UTC
Description of problem:

Bitwise filter doesn't return the entries if the entry is defined as  multivalued.

Version-Release number of selected component (if applicable): DS9.0 build dated 08/20.


How reproducible: Consistently.

Steps to Reproduce:

Define schema to create user entries with bit fields.
---------------------------------------
dn: cn=schema
changetype: modify
add: attributeTypes
attributeTypes: ( NAME 'testUserAccountControl' DESC 'Attribute Bitwise filteri-Multi-Valued' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
attributeTypes: ( NAME 'testUserStatus' DESC 'State of User account active/disabled' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

dn: cn=schema
changetype: modify
add: objectClasses
objectClasses: ( NAME 'testperson' SUP top STRUCTURAL MUST ( sn $ cn $ testUserAccountControl $ testUserStatus )
        MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) X-ORIGIN 'BitWise' )
---------------------------------------

Create users with testUserAccountControl attribute as follows. declare multiple values for testUserAccountControl.

# btestuser3, example.com
dn: uid=btestuser3,dc=example,dc=com
mail: btestuser3@redhat.com
uid: btestuser3
givenName: bit
objectClass: top
objectClass: bitwisePerson
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: person
sn: testuser3
cn: bit testuser3
testUserAccountControl: 1
testUserAccountControl: 8388608
testUserAccountControl: 512
userPassword:: e1NTSEF9TGZvbHRrYitjck1DUVVDNDlSdTVGcGViV0d0bXZ3aGtWZEJZYlE9PQ=

Write a bitwise search filter as below.

I can only successfully search for the first defined attribute.  This works ..
ldapsearch -x -D "cn=Directory Manager" -w Secret123 -b "dc=example,dc=com" "(testUserAccountControl:1.2.840.113556.1.4.803:=1)"
This returns nothing ...
ldapsearch -x -D "cn=Directory Manager" -w Secret123 -b "dc=example,dc=com" "(testUserAccountControl:1.2.840.113556.1.4.803:=8388608)"
g

Comment 1 Rich Megginson 2009-09-25 17:42:46 UTC
Created attachment 362701 [details]
patch

Comment 2 Rich Megginson 2009-09-25 17:54:39 UTC
To ssh://git.fedorahosted.org/git/389/ds.git
   ff7d08d..b5b57df  master -> master

commit b5b57df80f5a01774f85d174979dc1deea4f5724
Author: Rich Megginson <rmeggins@redhat.com>
Date:   Fri Sep 25 11:44:22 2009 -0600

    Reviewed by: nhosoi (Thanks!)
    Fix Description: Get the values as a char ** - look through each one until
    we find one that matches.
    Platforms tested: RHEL5 x86_64
    Flag Day: no
    Doc impact: no

Comment 3 Jenny Galipeau 2010-05-13 15:53:50 UTC
verified - Solaris 9

version:

pkginfo -l RHATredhat-dsx-base
   PKGINST:  RHATredhat-dsx-base
      NAME:  Red Hat Directory Server
  CATEGORY:  application
      ARCH:  sparcv9
   VERSION:  8.2.0,REV=2010.05.12.04.34.47
   BASEDIR:  /
      DESC:  Red Hat Directory Server
    PSTAMP:  sun-t1k-02.idm.lab.bos.redhat.com20100512013448
  INSTDATE:  May 13 2010 10:46
    STATUS:  completely installed
     FILES:      285 installed pathnames
                  25 shared pathnames
                  36 directories
                 108 executables
               18323 blocks used (approx)


ALL Three value searches return user with multi valued attribute.

bash-2.05# /usr/lib/sparcv9/mozldap6/ldapsearch -h host.example.com -p 389 -D "cn=Directory Manager" -w Secret -b "dc=example,dc=com" "(testUserAccountControl:1.2.840.113556.1.4.803:=89536)"
version: 1
dn: uid=btestuser10,dc=example,dc=com
mail: btestuser10@redhat.com
uid: btestuser10
givenName: bit
objectClass: top
objectClass: testperson
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: person
sn: testuser10
cn: bit testuser10
testUserAccountControl: 89536
testUserAccountControl: 97546
testUserAccountControl: 96579
testUserStatus: TestVerify1
testUserStatus: TestVerify2
testUserStatus: TestVerify3
userPassword: {SSHA}KLt0taK2ZpnnB06Yd2TgG7Llow7sJaIkYicjIg==


bash-2.05# /usr/lib/sparcv9/mozldap6/ldapsearch -h host.example.com -p 389 -D "cn=Directory Manager" -w Secret -b "dc=example,dc=com" "(testUserAccountControl:1.2.840.113556.1.4.803:=97546)"
version: 1
dn: uid=btestuser10,dc=example,dc=com
mail: btestuser10@redhat.com
uid: btestuser10
givenName: bit
objectClass: top
objectClass: testperson
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: person
sn: testuser10
cn: bit testuser10
testUserAccountControl: 89536
testUserAccountControl: 97546
testUserAccountControl: 96579
testUserStatus: TestVerify1
testUserStatus: TestVerify2
testUserStatus: TestVerify3
userPassword: {SSHA}KLt0taK2ZpnnB06Yd2TgG7Llow7sJaIkYicjIg==


bash-2.05# /usr/lib/sparcv9/mozldap6/ldapsearch -h host.example.com -p 389 -D "cn=Directory Manager" -w Secret -b "dc=example,dc=com" "(testUserAccountControl:1.2.840.113556.1.4.803:=96579)"
version: 1
dn: uid=btestuser10,dc=example,dc=com
mail: btestuser10@redhat.com
uid: btestuser10
givenName: bit
objectClass: top
objectClass: testperson
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: person
sn: testuser10
cn: bit testuser10
testUserAccountControl: 89536
testUserAccountControl: 97546
testUserAccountControl: 96579
testUserStatus: TestVerify1
testUserStatus: TestVerify2
testUserStatus: TestVerify3
userPassword: {SSHA}KLt0taK2ZpnnB06Yd2TgG7Llow7sJaIkYicjIg==


Note You need to log in before you can comment on or make changes to this bug.