]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba_tool: Enclose iterator with list
authorNoel Power <noel.power@suse.com>
Sat, 25 Aug 2018 10:39:04 +0000 (11:39 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Oct 2018 03:50:27 +0000 (05:50 +0200)
Really strange bug caused by map being updated while being iterated.
This caused keys to be skipped and inconsistent and incorrect
results from ldapcmp.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/ldapcmp.py

index 63236a4c7616ee0d780f7c1bfc8a4ed5eeca4b38..6508a8fe5db42f2976feec687c48ea04dd550803 100644 (file)
@@ -211,7 +211,7 @@ class LDAPBase(object):
         res = dict(res[0])
         # 'Dn' element is not iterable and we have it as 'distinguishedName'
         del res["dn"]
-        for key in res.keys():
+        for key in list(res.keys()):
             vals = list(res[key])
             del res[key]
             name = self.get_attribute_name(key)