From: <pha...@tr...> - 2003-01-11 23:54:43
|
Hi... I'm just forwarding a bug report I received through the debian BTS. I think the reporter is correct, so could you please apply this patch upstream? Thanks, Peter http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=175710 -- Forwarded message -- hi Peter, the problem is that in ldap.modlist.modifyModlist() new_value gets filtered while old_value doesn't. exploting: user passes a empty list as value of an attribute. modifyModlist() sees this attribute in the new_value and filter it. later, seeing it missing from the new entry, modifyModlist thinks it is the case to schedule it for removal. after modifyModlist() returns the user puts aside this entry for later use. after having changed the value for that attribute, he wants to commit it. he takes his old and new entries and calls modifyModlist. this time the old empty value is not filtered! seeing differences between the old and the new, modifyModlist will choose to delete (again) the old attribute's value and add the new. but ldap server has not any old value because that attribute has been already deleted by the previous call, and an exceptinon is raised. the fix is simple, i attached a patch. a quick workaround for those not having a fixed version is to filter the old_entry by hand, before calling modifyModlist(). cheers cavok -- System Information: Debian Release: testing/unstable Architecture: i386 Kernel: Linux ingiusta 2.4.18-cavok #1 Wed May 15 16:41:15 CEST 2002 i686 Locale: LANG=C, LC_CTYPE=C Versions of packages python2.2-ldap depends on: ii libc6 2.3.1-9 GNU C Library: Shared libraries an ii libldap2 2.0.27-3 OpenLDAP libraries (without TLS su ii libsasl7 1.5.27-3.3 Authentication abstraction library ii python2.2 2.2.2-4 An interactive object-oriented scr -- no debconf information -----[ Domenico Andreoli, aka cavok --[ http://filibusta.crema.unimi.it/~cavok/gpgkey.asc ---[ 3A0F 2F80 F79C 678A 8936 4FEE 0677 9033 A20E BC50 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="modlist-0.1.0.py.patch" --- /usr/lib/python2.2/site-packages/ldap/modlist.py 2002-09-18 16:04:47.000000000 +0200 +++ modlist.py 2003-01-07 16:33:22.000000000 +0100 @@ -75,6 +75,7 @@ new_value = filter(None,new_entry[attrtype]) if attrtype_lower_map.has_key(attrtype_lower): old_value = old_entry.get(attrtype_lower_map[attrtype_lower],[]) + old_value = filter(None,old_value) del attrtype_lower_map[attrtype_lower] else: old_value = [] --zhXaljGHf11kAtnf-- |