ldap.modlist.modifyModlist() bug?

Craig Balfour craig at cs.uct.ac.za
Mon Dec 10 13:32:21 CET 2007


I've been using ldap.compare_s(), ldap.modlist.modifyModlist() and
ldap_modify_s() to keep an OpenLDAP database up to date from an
external datasource. 

I've just noticed, however, that when the old and new entry consist of
the same characters but in a different order (as occurs when initials
are swapped around, for example) ldap_compare_s() returns
COMPARE_FALSE but modifyModlist() returns an empty list - the result
being that nothing gets updated.

Here's some examples:

modlist = ldap.modlist.modifyModlist({"givenName": "Fred"}, {"givenName": "Bob"})
print str(modlist)
[(1, 'givenName', None), (0, 'givenName', 'Bob')]

modlist = ldap.modlist.modifyModlist({"givenName": "Fred"}, {"givenName": "derF"})
print str(modlist)
[]

Is this a bug in modifyModlist() or a feature? 

Craig
--
Craig Balfour <craig at cs.uct.ac.za> - Unix Systems Administrator 
Computer Science, University of Cape Town, Private Bag, Rondebosch, 7701




More information about the python-ldap mailing list