Connections established using SASL die after search

Mark Roach mrroach at okmaybe.com
Thu Dec 16 22:38:49 CET 2004


On Tue, 2004-12-14 at 10:55 -0500, Mark Roach wrote:
> On Tue, 2004-12-14 at 08:59 +0100, Michael Ströder wrote:
> > Mark Roach wrote:
> > >     except:
> > >         print "Died on iteration %d" % (i)
> > >         print out
> > >         break
> > 
> > You're catching all LDAP error exceptions here without printing them.

> In order to test where in the ldap/sasl/python stack the problem is
> coming from, I also patched ldapsearch.c to run the same queries. It
> seems to work just fine. The patch is attached.

OK, I promise this will be my last message on the subject. I am
currently using ReconnectLDAPObject as a workaround, and it seems fine
(if not the purist's approach). I just wanted to post one last test
case. It doesn't get much smaller than this :-)



import ldap, ldap.sasl
l = initialize('ldap://my.ldap.server')
l.sasl_interactive_bind_s('', ldap.sasl.gssapi())

# Here's the real work. The use of multiple search bases is key
for i in range(20): 
    [l.search_s('ou=%s,dc=okmaybe,dc=com' % ou, ldap.SCOPE_ONELEVEL, '(objectClass=*)') \
            for ou in ['system','people','groups']]

Thanks again. And sorry for all the noise on this list.

-Mark






More information about the python-ldap mailing list