diff options
author | David Mulder <dmulder@suse.com> | 2018-01-08 09:16:11 -0700 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2018-01-13 22:38:05 +0100 |
commit | ef49d0b9eff9b90fa5533d50a0fc26405f44d449 (patch) | |
tree | 4017e82ed58ac2e5a9a857f2cf9f86fd244d848d /python/samba/gpclass.py | |
parent | 08651a08ac10d472a8b170c2f33496192d7faa66 (diff) | |
download | samba-ef49d0b9eff9b90fa5533d50a0fc26405f44d449.tar.gz |
gpo: Fix crashes in gpo unapply
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba/gpclass.py')
-rw-r--r-- | python/samba/gpclass.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/python/samba/gpclass.py b/python/samba/gpclass.py index 00330eb5ecb..ca34120d513 100644 --- a/python/samba/gpclass.py +++ b/python/samba/gpclass.py @@ -217,12 +217,19 @@ class gp_log: exts = guid_obj.findall('gp_ext') if exts is not None: for ext in exts: - ext_map = {val[0]: val[1] for (key, val) in \ - data_maps[ext.attrib['name']].items()} attrs = ext.findall('attribute') for attr in attrs: - ret.append((attr.attrib['name'], attr.text, - ext_map[attr.attrib['name']])) + func = None + if attr.attrib['name'] in data_maps[ext.attrib['name']]: + func = data_maps[ext.attrib['name']]\ + [attr.attrib['name']][-1] + else: + for dmap in data_maps[ext.attrib['name']].keys(): + if data_maps[ext.attrib['name']][dmap][0] == \ + attr.attrib['name']: + func = data_maps[ext.attrib['name']][dmap][-1] + break + ret.append((attr.attrib['name'], attr.text, func)) return ret def delete(self, gp_ext_name, attribute): |