summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDavid Mulder <dmulder@samba.org>2022-11-11 09:41:52 -0700
committerJeremy Allison <jra@samba.org>2022-11-12 00:34:34 +0000
commit3ad8e8d4d43b08cf1747da048c2fcc16d45a59c5 (patch)
tree31fff1c8b6e6bf7e6ecd53684e66316d649cf703 /python
parent09e9dd576dad5a38287b2241a965f769f1264292 (diff)
downloadsamba-3ad8e8d4d43b08cf1747da048c2fcc16d45a59c5.tar.gz
gp: Password and Kerberos policies fail on unknown key
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>
Diffstat (limited to 'python')
-rw-r--r--python/samba/gp/gp_sec_ext.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/samba/gp/gp_sec_ext.py b/python/samba/gp/gp_sec_ext.py
index 667bc4cd48b..16cbc4c7013 100644
--- a/python/samba/gp/gp_sec_ext.py
+++ b/python/samba/gp/gp_sec_ext.py
@@ -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))