Apache Directory Project - [OT] JNDI search and types only

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > August 2005 > [OT] JNDI search and types only





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [OT] JNDI search and types only
Jérôme Baumgarten

2005-08-29, 5:45 pm

Hi,

Sorry for being off-topic but some on this list may know the answers.

org.apache.ldap.common.message.SearchRequest contains information
about the "types only" search. Also, it is possible to do the same
with the JLDAP [1] API. But I didn't find the way to do this with
JNDI. How am I supposed to pass this information ?

Also, what is the '+' attribute value when doing a search ?

Regards,
J=E9r=F4me

[1] http://www.openldap.org/jldap/

Cimballi

2005-08-29, 5:45 pm

Hi,

There is a poperty to fix in order to return only attributes names :
env.put("java.naming.ldap.typesOnly", "true");
More information here :
http://java.sun.com/products/jndi/t...misc/index.html

The * attribute means all + operational attributes
The + attribute means all + operational attributes + all others

Cimballi


On 8/29/05, J=E9r=F4me Baumgarten <jbaumgarten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>=20
> Sorry for being off-topic but some on this list may know the answers.
>=20
> org.apache.ldap.common.message.SearchRequest contains information
> about the "types only" search. Also, it is possible to do the same
> with the JLDAP [1] API. But I didn't find the way to do this with
> JNDI. How am I supposed to pass this information ?
>=20
> Also, what is the '+' attribute value when doing a search ?
>=20
> Regards,
> J=E9r=F4me
>=20
> [1] http://www.openldap.org/jldap/


Jérôme Baumgarten

2005-08-29, 5:45 pm

Thanks Cimballi.

> There is a poperty to fix in order to return only attributes names :
> env.put("java.naming.ldap.typesOnly", "true");
> More information here :
> http://java.sun.com/products/jndi/t...misc/index.html


So I guess there's a bug in org.apache.ldap.server.protocol.SearchHandler
line 89 : controls.setReturningObjFlag( req.getTypesOnly() );
these two properties are totally different and the following should be adde=
d :

context.addToEnvironment("java.naming.ldap.typesOnly",
String.valueOf(req.getTypesOnly()));

along with its remove counter part in a finally clause. As should also
be done (I believe) for the DEREFALIASES_KEY property.

> The * attribute means all + operational attributes
> The + attribute means all + operational attributes + all others


Again, thanks. I need to find out now what's wrong in my LDAP proxy
(based on ideas from Alex), I only get operational attributes.

> Cimballi
>=20
>=20
> On 8/29/05, J=E9r=F4me Baumgarten <jbaumgarten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>


Emmanuel Lecharny

2005-08-29, 5:45 pm

On Mon, 2005-08-29 at 15:07 +0200, Jérôme Baumgarten wrote:
> Hi,
>
> Sorry for being off-topic but some on this list may know the answers.
>
> org.apache.ldap.common.message.SearchRequest contains information
> about the "types only" search. Also, it is possible to do the same
> with the JLDAP [1] API. But I didn't find the way to do this with
> JNDI. How am I supposed to pass this information ?


There is en env variable
java.naming.ldap.typesOnly
you can set.

>From http://java.sun.com/j2se/1.4.2/docs...di-ldap-gl.html :


"java.naming.ldap.typesOnly
The value of this property is a string that specifies whether only
attribute IDs are returned in results - attribute values are omitted.
Affects the SearchResult.getAttributes and DirContext.getAttributes
methods. The following values are defined for this property:

true
return only attribute IDs.
false
return both attribute IDs and attribute values.

If this property is not set then its default value is false.

For example:


env.put("java.naming.ldap.typesOnly", "true");
causes the server to return attribute IDs but not attribute values."

>
> Also, what is the '+' attribute value when doing a search ?


If it's something like "sn=test+givename=joe, ...", it will be used to
search entries that use multi-valued RDN

Emmanuel



Emmanuel Lecharny

2005-08-29, 5:45 pm

> >
>
> If it's something like "sn=test+givename=joe, ...", it will be used to
> search entries that use multi-valued RDN


Forget about this stupid explanation...

Emmanuel

>
> Emmanuel
>
>
> ---------------------------------------------------------------------------------------
> Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail.
> Aucun virus connu a ce jour par nos services n'a ete detecte.
>
>
>



Alex Karasulu

2005-08-29, 5:45 pm

Jérôme Baumgarten wrote:

>Hi,
>
>Sorry for being off-topic but some on this list may know the answers.
>
>
>

NP that's what the [OT] prefix is for .

>org.apache.ldap.common.message.SearchRequest contains information
>about the "types only" search. Also, it is possible to do the same
>with the JLDAP [1] API. But I didn't find the way to do this with
>JNDI. How am I supposed to pass this information ?
>
>
>

Cimballi and Emmanuel have pointed out the JNDI attribute for doing this.

>Also, what is the '+' attribute value when doing a search ?
>
>

This means return all the operational attributes present within
entries. It's usually used to discover all the operational attributes
resident.

Alex

Alex Karasulu

2005-08-29, 5:45 pm

Jérôme Baumgarten wrote:

>Thanks Cimballi.
>
>
>
>
>So I guess there's a bug in org.apache.ldap.server.protocol.SearchHandler
>line 89 : controls.setReturningObjFlag( req.getTypesOnly() );
>these two properties are totally different and the following should be added :
>
>

Yes there is some ambiguity in fact with JNDI here. I've been trying to
figure this out for some time now. That is the relationship between
the SearchControls returningObjFlag property and the environment
property "java.naming.ldap.typesOnly". I have searched far and wide for
a better understanding about this. I think the best way for us to
understand this is to capture the ASN.1 generated to comprehend the
final effects of setting these properties.

With respect to the SearchHandler I don't have enough information at
this point to conclude which way is correct. I guess we just need to do
some experimentation with the SUN JNDI provider to see the effects of
these properties on the generated ASN.1 requests.

<snip/>

Alex

Cimballi

2005-08-30, 2:45 am

Maybe the "setReturningObjFlag" is for the hability of JNDI to map
entry to real Java Object (via bind and lookup) and this flag let you
return the object or only the classname.

Cimballi


On 8/29/05, Alex Karasulu <aok123-Bdlq13kUjeyLZ21kGMrzwg@public.gmane.org> wrote:
> J=E9r=F4me Baumgarten wrote:
>=20
r[vbcol=seagreen]
dded :[vbcol=seagreen]
> Yes there is some ambiguity in fact with JNDI here. I've been trying to
> figure this out for some time now. That is the relationship between
> the SearchControls returningObjFlag property and the environment
> property "java.naming.ldap.typesOnly". I have searched far and wide for
> a better understanding about this. I think the best way for us to
> understand this is to capture the ASN.1 generated to comprehend the
> final effects of setting these properties.
>=20
> With respect to the SearchHandler I don't have enough information at
> this point to conclude which way is correct. I guess we just need to do
> some experimentation with the SUN JNDI provider to see the effects of
> these properties on the generated ASN.1 requests.
>=20
> <snip/>
>=20
> Alex


Jérôme Baumgarten

2005-08-30, 7:45 am

On 8/30/05, Cimballi <cimballi.cimballi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Maybe the "setReturningObjFlag" is for the hability of JNDI to map
> entry to real Java Object (via bind and lookup) and this flag let you
> return the object or only the classname.


I think that's correct, according to that page
http://www11.informatik.tu-muenchen...cts/reading/se=
arch.html

I would believe that's only relevant on the client side since the
server may not know anything at all regarding Java serialization (like
OpenLDAP).

> Cimballi
>=20


<snip />

J=E9r=F4me

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com