Bug 594747 - a search return only one multi-valued attribute
Summary: a search return only one multi-valued attribute
Keywords:
Status: CLOSED EOL
Alias: None
Product: penrose
Classification: Retired
Component: Engine
Version: unspecified
Hardware: All
OS: All
low
medium
Target Milestone: ---
Assignee: Jim Yang
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-21 13:50 UTC by Hubert FONGARNAND
Modified: 2020-03-27 19:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:34:27 UTC


Attachments (Terms of Use)
Search log... debug enabled (25.00 KB, text/plain)
2010-05-21 14:15 UTC, Hubert FONGARNAND
no flags Details
Search log with the searched object as the base dn (25.28 KB, text/plain)
2010-05-21 14:34 UTC, Hubert FONGARNAND
no flags Details

Description Hubert FONGARNAND 2010-05-21 13:50:05 UTC
Description of problem:

I've an organisationalUnit (groups) with some groupOfUniqueNames inside.
Theses groups contains some uniqueMember attributes

if i do a search in the ou, only one of the uniqueMember attribute is returned.


Version-Release number of selected component (if applicable):

  
Actual results:
hfongarnand@hfongarnand-desktop:~$ ldapsearch -h 10.69.100.92 -p 10389 -b ou=groups,ou=usersgroups,dc=fiducial,dc=net -x -L '(&(uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9))' uniqueMember 
version: 1

#
# LDAPv3
# base <ou=groups,ou=usersgroups,dc=fiducial,dc=net> with scope subtree
# filter: (&(uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9))
# requesting: uniqueMember 
#

# d401edfd-b997-44d0-a575-84329e33aec9, groups, usersgroups, fiducial.net
dn: uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9,ou=groups,ou=usersgr
 oups,dc=fiducial,dc=net
uniqueMember: uid=l.durand,ou=usersfull,ou=usersgroups,dc=fiducial,dc=net


BUT if you do the search with the searched object as the base dn :
hfongarnand@hfongarnand-desktop:~$ ldapsearch -h 10.69.100.92 -p 10389 -b uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9,ou=groups,ou=usersgroups,dc=fiducial,dc=net -x -L '(&(objectClass=groupOfUniqueNames)(uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9))'  uniqueMember
version: 1

#
# LDAPv3
# base <uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9,ou=groups,ou=usersgroups,dc=fiducial,dc=net> with scope subtree
# filter: (&(objectClass=groupOfUniqueNames)(uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9))
# requesting: uniqueMember 
#

# d401edfd-b997-44d0-a575-84329e33aec9, groups, usersgroups, fiducial.net
dn: uniqueIdentifier=d401edfd-b997-44d0-a575-84329e33aec9,ou=groups,ou=usersgr
 oups,dc=fiducial,dc=net
uniqueMember: uid=n.beaumard,ou=usersfull,ou=usersgroups,dc=fiducial,dc=net
uniqueMember: uid=n.jacotin,ou=usersfull,ou=usersgroups,dc=fiducial,dc=net
uniqueMember: uid=n.lucas,ou=usersfull,ou=usersgroups,dc=fiducial,dc=net
uniqueMember: uid=jp.bodin,ou=usersfull,ou=usersgroups,dc=fiducial,dc=net
uniqueMember: uid=m.hance,ou=usersfull,ou=usersgroups,dc=fiducial,dc=net
uniqueMember: uid=l.durand,ou=usersfull,ou=usersgroups,dc=fiducial,dc=net


It works


Expected results:
it should return all the uniqueMember attributes

Additional info:

Comment 1 Hubert FONGARNAND 2010-05-21 14:15:45 UTC
Created attachment 415698 [details]
Search log... debug enabled

Comment 2 Hubert FONGARNAND 2010-05-21 14:34:00 UTC
Created attachment 415705 [details]
Search log with the searched object as the base dn

Comment 3 Hubert FONGARNAND 2010-05-21 14:41:11 UTC
In the sources : DynamicEntry.java:981
boolean baseSearch = (scope == SearchRequest.SCOPE_BASE || scope == SearchRequest.SCOPE_SUB)

                && getDn().matches(baseDn);

if baseSearch is true... all attributes are well retrieved

if baseSearch is false only on attribute is retrieved...

Comment 4 Hubert FONGARNAND 2010-05-25 08:40:50 UTC
I've found a way to fix this problem : here's the patch, can you review it ?:


diff --git a/core/src/java/org/safehaus/penrose/directory/DynamicEntry.java b/core/src/java/org/safehaus/penrose/directory/DynamicEntry.java
index 942b361..8da25a0 100644
--- a/core/src/java/org/safehaus/penrose/directory/DynamicEntry.java
+++ b/core/src/java/org/safehaus/penrose/directory/DynamicEntry.java
@@ -1248,7 +1251,12 @@ public class DynamicEntry extends Entry implements Cloneable {
                 if (firstSource) {
                     DN dn = createDn(sa);
                     if (debug) log.debug("Found "+dn+".");
-
+                    // Try to merge...
+                    SourceAttributes prev = results.get(dn);
+                    if (prev!=null) {
+                       //prev.print();
+                       sa.add(prev);
+                    }
                     results.put(dn, sa);


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