Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 164843 - deleting subtyped attribute value problem.
deleting subtyped attribute value problem.
Product: Red Hat Directory Server
Classification: Red Hat
Component: Directory Server (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nathan Kinder
Orla Hegarty
: 164590 (view as bug list)
Depends On:
Blocks: 152373 159328 182343 182630 184343 240316
  Show dependency treegraph
Reported: 2005-08-01 14:49 EDT by Noriko Hosoi
Modified: 2008-08-11 19:36 EDT (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2005-836
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-11-16 16:11:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
CVS Diffs (14.97 KB, patch)
2005-08-11 17:56 EDT, Nathan Kinder
no flags Details | Diff
CVS Commit (704 bytes, text/plain)
2005-08-12 17:36 EDT, Nathan Kinder
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:836 normal SHIPPED_LIVE Updated redhat-ds package 2005-11-16 00:00:00 EST

  None (edit)
Description Noriko Hosoi 2005-08-01 14:49:26 EDT
Description of problem:
An entry has an attribute (attrA) having the same value (valueA) under the
different subtypes (lang-XX):
attrA: valueA
attrA;lang-en: valueA
attrA;lang-ja: valueA
attrA;lang-ja;phonetic: valueA

If you index attrA, they are indexed under one key "valueA" in the index file

Then, remove one attribute value, e.g., "attrA;lang-ja: valueA",
which deletes the key "valueA" in the index file attrA.db#.

After the key is deleted, search with the filter "(attrA=valueA)" returns none
even if the attribute values still exist in the entry.

Version-Release number of selected component (if applicable):
Found at HP.  Could be reproduced on 7.1 on RHEL4.

How reproducible:
Every time.

Expected results:
We should consult with RFCs to figure out the right behavior:
1) Multiple same values are allowed under the same attribute type?
   Without subtype, it is NOT allowed.  But how about WITH subtypes?
Lu, Grace R C wrote:
> The ldapmodify with replace is broken, how about the original problem
> that the customer reported? In the case of Mail:xyz
> Mail;lang-ja:xyz
> The xyz is removed from mail index database after the mail;lang-ja:xyz
> is removed but the mail:xyz still exists? Is this also a defect? 

dboreham wrote:
> I'm not sure if it's really a different defect.
> If it's the case that the two values shouldn't be allowed anyway, then
> the indexing is behaving as designed. I'll need to check the RFCs
> to figure out how duplicate values in subtypes should be handled.

2) If having the same value is allowed:
attrA: valueA
attrA;lang-en: valueA
What is the right behavior?
Deleting one attribute value "attrA;lang-en: valueA" should delete another
"attrA: valueA" in the entry?
Or deleting one attribute value should not delete the key "valueA" in the index
file attrA.db#?

From the customer's point of view, the last is most preferable.
Here is the original report from HP:
"Lu, Grace R C" <grace.lu@hp.com> wrote:
> We have a customer asking the following:
> They set mail: xyz 
> And then mail;lang-ja: xyz,

> Then they remove the mail;lang-ja:xyz.

> The mail index database becomes empty, when there is still an copy of
> xyz value in the database.

> This does not happen for
> Mail:xyz
> Mail:xyz
> And remove one mail:xyz.

> The index database can be rebuilt, however, they don't want to do that
> over and over again in working environment.
> Can the problem be fixed easily?
Comment 1 Nathan Kinder 2005-08-03 12:43:53 EDT
RFC 3866, section 2.5 states:

  A client can provide multiple attributes with the same attribute type
  and value, so long as each attribute has a different set of language
  tag options.

This means that the following is allowed:

  attrA: valueA
  attrA;lang-en: valueA

RFC 3866, section 2.6 states:

  Attribute types and language tag options MUST match exactly against
  values stored in the directory.  For example, if the modification is
  a "delete", then if the stored values to be deleted have language tag
  options, then those language tag options MUST be provided in the
  modify operation, and if the stored values to be deleted do not have
  any language tag option, then no language tag option is to be

Basically, a delete of an attribute with a subtype must explicitly call out that
subtype.  This means that we need to check if any subtypes with the same value
exist in the entry that you are modifying before removing the key from an index.
Comment 2 Nathan Kinder 2005-08-11 17:56:48 EDT
Created attachment 117663 [details]
CVS Diffs

These changes affect the delete and replace operations when being performed
against an indexed attribute.  They basically compile a list of values whose
indexes need to be removed, and another list of which index values are to
remain.  It putting these lists together, attribute subtypes and multivalued
attributes are taken into account.  These lists are then used to modify the
Comment 3 Nathan Kinder 2005-08-12 17:36:32 EDT
Created attachment 117696 [details]
CVS Commit

Checked into ldapserver.  Reviewed by Rich (thanks!).
Comment 4 Rich Megginson 2005-08-24 16:57:33 EDT
Moved to 7.1 sp 1
Comment 5 Orla Hegarty 2005-10-14 12:22:47 EDT
Verified fixed against all supported platforms - RHEL3, RHEL4, Solaris 9 32 and
54 bit, HP-UX 11i. 

Run indexes test plan.
Comment 6 Orla Hegarty 2005-10-31 19:36:22 EST
A client can provide multiple attributes with the same attribute type and value,
 only if those attributes are language sub-types

This means that the following is allowed:

  attrA: valueA
  attrA;lang-en: valueA

If that attribute is indexed, performing a delete which explicitly calls out the
attribute language sub-type to be deleted will not remove the index for  the
remaining attribute.
Comment 7 John Ha 2005-11-10 00:58:59 EST
pasted from release notes:

In Red Hat Directory Server 7.1, indexing of multi-valued attributes with
language subtypes was not handled correctly. This issue has been fixed.
Comment 8 Red Hat Bugzilla 2005-11-16 16:11:20 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Comment 9 Nathan Kinder 2006-02-23 14:01:42 EST
*** Bug 164590 has been marked as a duplicate of this bug. ***
Comment 10 To Ngan 2006-03-14 10:30:49 EST
Verified DS6.21 SP3 candidates 20060222.1 and 20060310.1 on all platforms.
Comment 11 Chandrasekar Kannan 2008-08-11 19:36:35 EDT
Bug already CLOSED. setting screened+ flag

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