[python-ldap] LDAP Search Failure
Michael Ströder
michael at stroeder.com
Mon Apr 22 09:35:11 CEST 2013
Anurag Chourasia wrote:
> I am doing a search using Python LDAP and the search function is throwing an
> exception *ldap.NO_SUCH_OBJECT*
>
> Session transcript is as follows
>
>>>> import ldap
>>>> l=ldap.initialize('ldap://localhost:389')
>>>> who="CN=guddu,OU=Appl Groups,OU=Central,OU=CL,DC=c.corp,O=App,C=US"
>>>> cred="12345"
>>>> result=l.bind(who,cred)
As said in my other response this is not a full correct bind operation.
>>>> l.result(result)
> (97, [])
>>>> l.search_s('OU=Appl
> Groups,OU=Central,OU=CL,DC=c.corp,O=App,C=US',ldap.SCOPE_SUBTREE,'(cn=gud*)',['cn'])
> [..]
> ldap.NO_SUCH_OBJECT: {'info': "0000208D: NameErr: DSID-031521D2, problem 2001
> (NO_OBJECT), data 0, best match of:\n\t'O=App,C=US'\n", 'matched': 'O=App,C=US', '
> desc': 'No such object'}
This can be caused by the base DN not being correct or the server not
disclosing the DN to you because of incomplete bind before.
Ciao, Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3883 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20130422/6f136467/attachment.bin>
More information about the python-ldap
mailing list