[Freeipa-devel] [PATCH] fix modlist order
Kevin McCarthy
kmccarth at redhat.com
Mon Oct 8 20:34:03 UTC 2007
This fixes Trac ticket 8. It turns out the order in the modlist is
important - DELETE's need to come before ADDs or else case-changing
operations fail.
-Kevin
-------------- next part --------------
# HG changeset patch
# User Kevin McCarthy <kmccarth at redhat.com>
# Date 1191875741 25200
# Node ID 5ca8f3c477ab3010f6e5d0ee9844ebdc8c2c51d9
# Parent 730cacd8020a6ebfb6203def05cb3a012b8f5ef0
DELETEs have to come first, in order for "case change" operations to work.
diff -r 730cacd8020a -r 5ca8f3c477ab ipa-server/ipaserver/ipaldap.py
--- a/ipa-server/ipaserver/ipaldap.py Mon Oct 08 10:32:54 2007 -0700
+++ b/ipa-server/ipaserver/ipaldap.py Mon Oct 08 13:35:41 2007 -0700
@@ -428,10 +428,10 @@ class IPAdmin(SimpleLDAPObject):
adds = list(new_values.difference(old_values))
removes = list(old_values.difference(new_values))
+ if len(removes) > 0:
+ modlist.append((ldap.MOD_DELETE, key, removes))
if len(adds) > 0:
modlist.append((ldap.MOD_ADD, key, adds))
- if len(removes) > 0:
- modlist.append((ldap.MOD_DELETE, key, removes))
return modlist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4054 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20071008/12428993/attachment.bin>
More information about the Freeipa-devel
mailing list