Bug 1290726 - The 'eq' index does not get updated properly when deleting and re-adding attributes in the same ldapmodify operation
The 'eq' index does not get updated properly when deleting and re-adding attr...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base (Show other bugs)
Unspecified Unspecified
urgent Severity urgent
: rc
: ---
Assigned To: Noriko Hosoi
Viktor Ashirov
: ZStream
Depends On: 1290600
  Show dependency treegraph
Reported: 2015-12-11 03:55 EST by Jan Kurik
Modified: 2016-02-16 05:50 EST (History)
6 users (show)

See Also:
Fixed In Version: 389-ds-base-
Doc Type: Bug Fix
Doc Text:
Previously, when several values of the same attribute were deleted using the ldapmodify command, and at least one of them was added again during the same operation, the equality index was not updated. As a consequence, an exact search for the re-added attribute value did not return the entry. The logic of the index code has been modified to update the index if at least one of the values in the entry changes, and the exact search for the re-added attribute value now returns the correct entry.
Story Points: ---
Clone Of: 1290600
Last Closed: 2016-02-16 05:50:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Kurik 2015-12-11 03:55:30 EST
This bug has been copied from bug #1290600 and has been proposed
to be backported to 7.2 z-stream (EUS).
Comment 4 Simon Pichugin 2016-01-11 10:45:04 EST
[root@mgmt6 ~]# rpm -qa | grep 389

Verification steps:
1. Setup a RHDS server (stand-alone)

2. Create a user:
[root@serv ~]# ldapadd -x -h localhost -D 'cn=Directory Manager' -w Secret123 << EOF
dn: uid=user0099,ou=People,dc=example,dc=com
givenName: Test
sn: User
loginShell: /bin/bash
uidNumber: 10099
gidNumber: 10099
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: posixAccount
uid: user0099
gecos: Test User
mail: user0099@dev.null
mail: alias@dev.null
cn: Test User
homeDirectory: /home/user0099

3. Update the mail attribute by deleting all values and add only one value,
   that was previously used, in the same ldapmodify command:
[root@serv ~]# ldapmodify -x -h localhost -D 'cn=Directory Manager' -w Secret123 << EOF
dn: uid=user0099,ou=People,dc=example,dc=com
changetype: modify
delete: mail
mail: user0099@dev.null
mail: alias@dev.null
add: mail
mail: user0099@dev.null

4. Search for entries that have 'mail=alias@dev.null' (i.e. the value that was
[root@serv ~]# ldapsearch -LLL -x -h localhost -D 'cn=Directory Manager' -w Secret123 -b "dc=example,dc=com" mail=alias@dev.null cn

5. Check the entry as returned by step 4:
[root@serv ~]# ldapsearch -LLL -x -h localhost -D 'cn=Directory Manager' -w Secret123 -b "dc=example,dc=com" uid=user0099 mail
dn: uid=user0099,ou=People,dc=example,dc=com
mail: user0099@dev.null

6. Check that dbscan of the mail index db doesn't show both values:
[root@serv ~]# dbscan -f /var/lib/dirsrv/slapd-serv/db/userRoot/mail.db | grep ^=

Marking as VERIFIED.
Comment 6 errata-xmlrpc 2016-02-16 05:50:34 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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