Apache Directory Project - Complex filter not recognized properly

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > June 2006 > Complex filter not recognized properly





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 Complex filter not recognized properly
Vladimir Gjokevski

2006-06-16, 1:11 pm

Hi,
I have created a custom partition that is responsible for serving PGP
keys, and i have the following
problem:

when issuing with ldapsearch the following command:

ldapsearch -x -H ldap://localhost:11500 -D "dn=bugs" -w bunny -b
"dc=pgpkeys" "(&(pgpuserid=test*)(pgpdisabled=0))"

in the search() method of my custom partition class I get a SimpleNode
filter with just (pgpdisabled=0) instead
of more complex filter i guess it should be a BranchNode object that
will represent the filter "(&(pgpuserid=test*)(pgpdisabled=0))"
sent by the client.

Here is the log:
-----------------------------------------------------
2391938 [IoThreadPool-2] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1779] RECEIVED:
org.apache.directory.shared.ldap.message.UnbindRequestImpl@13ada
2391938 [IoThreadPool-2] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1779] CLOSE
2391938 [IoThreadPool-2] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1779] CLOSED
2475391 [IoThreadPool-1] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1783] OPENED
2475422 [IoThreadPool-2] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1783] RECEIVED: BindRequest
Version : '3'
Name : 'dn=bugs'
Simple authentication : 'bunny/0x62 0x75 0x6E 0x6E 0x79 '

2475422 [IoThreadPool-2] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1783] WRITE: BindResponse
Ldap Result
Result code : (ResultCodeEnum[SUCCESS=0]) success
Matched DN : 'null'
Error message : 'null'

2475422 [IoThreadPool-2] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1783] SENT: BindResponse
Ldap Result
Result code : (ResultCodeEnum[SUCCESS=0]) success
Matched DN : 'null'
Error message : 'null'

2475422 [IoThreadPool-1] INFO
org.apache.directory.server.ldap. LdapProtocolProvider$LdapProtocolHandler

- [/127.0.0.1:1783] RECEIVED: SearchRequest
baseDn : 'dc=pgpkeys'
filter : '(pgpdisabled=0) '
scope : whole subtree
typesOnly : false
no limit
Time Limit : no limit
Deref Aliases : never Deref Aliases
attributes :
-----------------------------------------------------

Regards,
Vladimir Gjokjevski

Alex Karasulu

2006-06-17, 1:11 am

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vladimir Gjokevski wrote:
> Hi,
> I have created a custom partition that is responsible for serving PGP
> keys, and i have the following
> problem:
>
> when issuing with ldapsearch the following command:
>
> ldapsearch -x -H ldap://localhost:11500 -D "dn=bugs" -w bunny -b
> "dc=pgpkeys" "(&(pgpuserid=test*)(pgpdisabled=0))"
>
> in the search() method of my custom partition class I get a SimpleNode
> filter with just (pgpdisabled=0) instead
> of more complex filter i guess it should be a BranchNode object that
> will represent the filter "(&(pgpuserid=test*)(pgpdisabled=0))"
> sent by the client.


Hi Vladimir,

Yes this is the expected result if you have not defined pgpuserid as a
valid schema attribute. Basically the server ignores terms (actively
trimming them from the filter's AST) if they are not defined attributes.

LDAP specifies that undefined attribute value assertions in filters are
to be ignored hence the pruning.

To work around this make sure you add pgpuserid in a custom schema to
apacheds. If you've already done this, make sure you have spelled the
attribute identifier correctly.

HTH,
Alex
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEk5GHPVto+tI7JJARAnM6AKD7Yjffr5CK
lRgLy+iA4rlDPwT/nQCfRty2
+vSXSnFwOriuA/mAAqyl6QU=
=ld9Q
-----END PGP SIGNATURE-----

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com