[python-ldap] Struggling to implement persistent search

Jeroen van Meeuwen (Kolab Systems) vanmeeuwen at kolabsys.com
Wed Apr 13 11:38:55 CEST 2011

Michael Ströder wrote:
> Jeroen van Meeuwen (Kolab Systems) wrote:
> > I'm trying to implement the PersistentSearchControl with
> > EntryChangeNotificationControl, but the latter does not seem to have a
> > encodeControlValue method.
> First of all: The API for LDAP controls changed.
> EntryChangeNotificationControl is only an instance of ResponseControl.

Yes, I should have noted I'm continuously working against CVS HEAD.

> > The results I'm getting from a stand-alone PersistentSearchControl
> > (using returnECs=True) however do not seem to represent the changeType
> > in any way.
> Please show your code.

Sure: http://hosted.kolabsys.com/~vanmeeuwen/persistent_search.py

> Note that ResponseControl.decodeControlValue() is
> supposed to set class attributes as side effect, not to return the decoded
> value anymore. Have a look at Demo/page_control.py to get the idea.

I have page control implemented[1], with a routine that did not seem to work 
well for the persistent searching... not sure why but any suggestions are 
welcome! ;-)

> In case of EntryChangeNotificationControl the relevant class attributes are
> changeType, changeNumber and previousDN.

These are what I'm after. I'm just failing to implement it correctly.

> > Has somebody successfully implemented PersistentSearchControl with
> > EntryChangeNotificationControl / changeType,
> Yes.

Cool, that's what I needed to hear after running in trial and error circles 
for much too long ;-)

> The code in ldap.controls.psearch is result of a customer project. I
> want to add also some demo code in Demo/pyasn1/. Not sure when I have time
> to do that.
> Which LDAP server are you working with?

389 Directory Server -so Netscape based as well.

Kind regards,

Jeroen van Meeuwen

[1] http://git.kolab.org/pykolab/tree/pykolab/auth/ldap/__init__.py#n250

Senior Engineer, Kolab Systems AG

e: vanmeeuwen at kolabsys.com
t: +44 77 340 9500
w: http://www.kolabsys.com

pgp: 9342 BF08
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20110413/fff6405e/attachment-0001.html>

More information about the python-ldap mailing list