Distinguished name problem
Hello, list! I'm sure I'm overlooking something fairly obvious her, and I'm hoping that somebody here can point me in the right direction. We have a small ldap-server running here and I've now been given the honor of writing a small Python program to interact with it. >From the command line (ldapsearch) I've got no problem becoming whatever I want. The python-ldap module on the other hand gives me *almost* anything I want. The only thing that I seem to not be able to get is the DN. The documentation makes a somewhat cryptic reference to a function called ldap_get_dn(). It's mentioned only once and not further explained. Trial and error, excessive googling, book flipping etc. unfortunately didn't get me any further either. Bear with me if this is a stupid question. I, as a programmer, have very limited ldap-experience (in fact, this is the first time I'm having anything to do with it), and my ldap guru here has little programming experience, so we're kind of stuck at the moment. Any suggestions very welcome! Thanks in advance. Regards, Fredrik smime.p7s Description: S/MIME Cryptographic Signature -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H___ Python-LDAP-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
Re: Distinguished name problem
Fredrik Melander wrote:
> From the command line (ldapsearch) I've got no problem becoming whatever
> I want. The python-ldap module on the other hand gives me *almost*
> anything I want. The only thing that I seem to not be able to get is the
> DN.
The 2-tuples returned by ldap_search_s() etc. are (dn,entry) where entry
is the dictionary {attrtype:[attrvalues]} and dn is simply a binary
string containing the entry's distinguished name.
See also:
http://python-ldap.sourceforge.net/doc/html/ldap.html#example
> The documentation makes a somewhat cryptic reference to a function
> called ldap_get_dn().
Which documentation? ldap_get_dn() is part of the underlying libldap and
you don't have to mess with that yourself.
Ciao, Michael.
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
Re: Distinguished name problem
Fredrik Melander wrote: > first of all - I noticed (a bit too late) that this actually is the > developer-list (although a user-list doesn't seem to exist). I want to > take the opportunity to thank you for taking time to answer my trivial > questions in spite of this. Much appreciated! There's only one low-traffic mailing list python-ldap-dev and therefore also beginner questions are welcome there. Keep posting questions there. >> Which documentation? ldap_get_dn() is part of the underlying libldap and >> you don't have to mess with that yourself. >> > Well, I was referring to the the downloadable pdf at Sourceforge > (version 2.3.2) which contains this statement: > "The DN in /dn /is extracted using the underlying ldap_get_dn() > function, which may raise an exception if the DN is malformed." > Although admittedly the use of the word "underlying" kind of hinted > that I wouldn't have to touch this myself, I got a bit confused by > this... Hmm, I tried to fix the wording a little bit. Not sure whether that helps avoiding confusion though. Ciao, Michael. -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Python-LDAP-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
