]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gp: Password and Kerberos policies fail on unknown key
authorDavid Mulder <dmulder@samba.org>
Fri, 11 Nov 2022 16:41:52 +0000 (09:41 -0700)
committerJeremy Allison <jra@samba.org>
Sat, 12 Nov 2022 00:34:34 +0000 (00:34 +0000)
If unrecognized keys are set in the GptTmpl.inf,
the extensions would fail to apply.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/gp/gp_sec_ext.py

index 667bc4cd48b5bbf0f9ee83119b36d06b52d7db21..16cbc4c70138ae04d2012a344dc4ffdda72f9efa 100644 (file)
@@ -67,6 +67,8 @@ class gp_krb_ext(gp_inf_ext):
                 for section in inf_conf.sections():
                     if section == str(self):
                         for key, value in inf_conf.items(section):
+                            if key not in gp_krb_ext.apply_map:
+                                continue
                             att = gp_krb_ext.apply_map[key]
                             value_func = self.mapper().get(att)
                             self.set_kdc_tdb(att, value_func(value))
@@ -153,6 +155,8 @@ class gp_access_ext(gp_inf_ext):
                 for section in inf_conf.sections():
                     if section == str(self):
                         for key, value in inf_conf.items(section):
+                            if key not in gp_access_ext.apply_map:
+                                continue
                             att = gp_access_ext.apply_map[key]
                             (update_samba, value_func) = self.mapper().get(att)
                             update_samba(att, value_func(value))