From: David Mulder Date: Thu, 6 Aug 2020 19:30:36 +0000 (-0600) Subject: gpo: Clarify the contents of deleted_gpo_list in process_group_policy X-Git-Tag: talloc-2.3.2~709 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a7e2e39847e89ed62e4ba8e4094f224bc627dc3;p=thirdparty%2Fsamba.git gpo: Clarify the contents of deleted_gpo_list in process_group_policy Signed-off-by: David Mulder Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/gp_scripts_ext.py b/python/samba/gp_scripts_ext.py index 9bd828d0687..f36470800c6 100644 --- a/python/samba/gp_scripts_ext.py +++ b/python/samba/gp_scripts_ext.py @@ -35,10 +35,10 @@ class gp_scripts_ext(gp_pol_ext): return 'Unix Settings/Scripts' def process_group_policy(self, deleted_gpo_list, changed_gpo_list, cdir=None): - for gpo in deleted_gpo_list: - self.gp_db.set_guid(gpo[0]) - if str(self) in gpo[1]: - for attribute, script in gpo[1][str(self)].items(): + for guid, settings in deleted_gpo_list: + self.gp_db.set_guid(guid) + if str(self) in settings: + for attribute, script in settings[str(self)].items(): os.unlink(script) self.gp_db.delete(str(self), attribute) self.gp_db.commit() diff --git a/python/samba/gp_sec_ext.py b/python/samba/gp_sec_ext.py index 5e230f73c3c..5e49dec75e1 100644 --- a/python/samba/gp_sec_ext.py +++ b/python/samba/gp_sec_ext.py @@ -34,11 +34,11 @@ class gp_krb_ext(gp_inf_ext): if self.lp.get('server role') != 'active directory domain controller': return inf_file = 'MACHINE/Microsoft/Windows NT/SecEdit/GptTmpl.inf' - for gpo in deleted_gpo_list: - self.gp_db.set_guid(gpo[0]) - for section in gpo[1].keys(): + for guid, settings in deleted_gpo_list: + self.gp_db.set_guid(guid) + for section in settings.keys(): if section == str(self): - for att, value in gpo[1][section].items(): + for att, value in settings[section].items(): update_samba, _ = self.mapper().get(att) update_samba(att, value) self.gp_db.delete(section, att) @@ -127,11 +127,11 @@ class gp_access_ext(gp_inf_ext): if self.lp.get('server role') != 'active directory domain controller': return inf_file = 'MACHINE/Microsoft/Windows NT/SecEdit/GptTmpl.inf' - for gpo in deleted_gpo_list: - self.gp_db.set_guid(gpo[0]) - for section in gpo[1].keys(): + for guid, settings in deleted_gpo_list: + self.gp_db.set_guid(guid) + for section in settings.keys(): if section == str(self): - for att, value in gpo[1][section].items(): + for att, value in settings[section].items(): update_samba, _ = self.mapper().get(att) update_samba(att, value) self.gp_db.delete(section, att) diff --git a/python/samba/gp_sudoers_ext.py b/python/samba/gp_sudoers_ext.py index 6eb033a67c0..5c607564a3f 100644 --- a/python/samba/gp_sudoers_ext.py +++ b/python/samba/gp_sudoers_ext.py @@ -40,10 +40,10 @@ class gp_sudoers_ext(gp_pol_ext): def process_group_policy(self, deleted_gpo_list, changed_gpo_list, sdir='/etc/sudoers.d'): - for gpo in deleted_gpo_list: - self.gp_db.set_guid(gpo[0]) - if str(self) in gpo[1]: - for attribute, sudoers in gpo[1][str(self)].items(): + for guid, settings in deleted_gpo_list: + self.gp_db.set_guid(guid) + if str(self) in settings: + for attribute, sudoers in settings[str(self)].items(): os.unlink(sudoers) self.gp_db.delete(str(self), attribute) self.gp_db.commit()