Implementation of LDAPControls

Deepak Giridharagopal deepak at
Mon Feb 21 21:00:28 CET 2005

On Mon, 2005-02-21 at 19:02 +0100, Michael Ströder wrote:
> Ingo Steuwer wrote:
> > 
> > Enclosed you find my mail including the necessary code-extraction 
> > for basic ldap-controls in python-ldap.
> Glad to see some progress in this field. Thanks.
> Could you please send a unified diff against the CVS tree? I will take a 
> closer look at it.

Well, I'm not Ingo, but for my university here I've finished support for
LDAP controls. This includes server and client control support for every
ldap_*_ext method in LDAPObject.c, and I've also implemented set_option
and get_option (from options.c) for both types of controls as well.

My modifications of the ldap_*_ext functions are always the same 3
1) Parse the serverctrls and clientctrls PyObjects into an array of
LDAPControl structs

2) Modify the actual libldap function call to use those parsed arrays
instead of NULL like we're doing now

3) De-allocate those newly created LDAPControl arrays.

You can see an example of usage in my previous email to the list.

I've attached a unified diff of my changes, which as I said before are
modeled closely after the existing implementation of LDAPMod structures.

> I'm not a lawyer. But I guess strictly speaking we would need kind of a 
> legal person to give the copyright to. Maybe contributing the code under 
> Python style license would be easier...sigh!

Copyright for the patch is all yours! I wouldn't turn down a mention at
the bottom of the README file, though. :)


Deepak Giridharagopal
Applied Research Laboratories
University of Texas at Austin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldapcontrols.patch
Type: text/x-patch
Size: 20113 bytes
Desc: not available
URL: <>

More information about the python-ldap mailing list