ldap_rename bindings

Michael Ströder michael at stroeder.com
Thu Jan 3 01:07:29 CET 2002

"Lorenzo M. Catucci" wrote:
> 1. If you look into ldap.h, ldap_modrdn is deprecated, and should be
>    expressed as a rename with a null newsuperior. I think in
>    PyArg_ParseTuple( args, "sss|i", &dn, &newrdn, &newSuperior, &delold )
>    the last "s" should be a z, therefore allowing (in the future) to move
>    mod_rdn from _ldap to a back-compatibility helper in ldap.py like in
>         def mod_rdn(dn, newrdn, delete=1):
>                 _ldap.rename(dn,newrdn,None,delete)
>    Even better, if newsuperior is made optional and defaulted to NULL,
>    the user can simply forget about mod_rdn in the long term and choose
>    between:
>         rename(dn, newrdn)
>         rename(dn, newrdn, newsuperior)


BTW always remember: You can do strange things with ModRDN operation
with non-leaf entries on an OpenLDAP 1.x server. You can even abuse
it to do very fast sub-tree deletion. Better called sub-tree
hiding... ;-)

Ciao, Michael.

More information about the python-ldap mailing list