From a5e1e1052ab349acb4573306d6c35735f1e71497 Mon Sep 17 00:00:00 2001 From: Alan Moore Date: Mon, 6 Jan 2025 13:38:36 +0000 Subject: [PATCH 1/2] Fix the _rule_id and var access in template.py --- shared/templates/pam_account_password_faillock/template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/templates/pam_account_password_faillock/template.py b/shared/templates/pam_account_password_faillock/template.py index 654209336c1..5e56392fd69 100644 --- a/shared/templates/pam_account_password_faillock/template.py +++ b/shared/templates/pam_account_password_faillock/template.py @@ -1,7 +1,7 @@ def preprocess(data, lang): if data.get("ext_variable") is None: errmsg = ("The template instance of the rule {0} requires the " - "ext_variable to be defined".format(_rule_id)) + "ext_variable to be defined".format(data["_rule_id"])) raise ValueError(errmsg) for var in ["variable_upper_bound", "variable_lower_bound"]: @@ -11,6 +11,6 @@ def preprocess(data, lang): type(data.get(var)) != int: errmsg = ("The template instance of the rule {0} requires the " "parameter {1} is either 'use_ext_variable' or " - "a number or undefined".formate(_rule_id, var)) + "a number or undefined".formate(data["_rule_id"], date["var"])) raise ValueError(errmsg) return data From f92ed0d2ca9fd7bbb645eddafe9960e73ce6faf2 Mon Sep 17 00:00:00 2001 From: Alan Moore Date: Mon, 6 Jan 2025 15:43:19 +0000 Subject: [PATCH 2/2] Fix more --- shared/templates/pam_account_password_faillock/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/templates/pam_account_password_faillock/template.py b/shared/templates/pam_account_password_faillock/template.py index 5e56392fd69..b2d97387c5c 100644 --- a/shared/templates/pam_account_password_faillock/template.py +++ b/shared/templates/pam_account_password_faillock/template.py @@ -11,6 +11,6 @@ def preprocess(data, lang): type(data.get(var)) != int: errmsg = ("The template instance of the rule {0} requires the " "parameter {1} is either 'use_ext_variable' or " - "a number or undefined".formate(data["_rule_id"], date["var"])) + "a number or undefined".format(data["_rule_id"], data["var"])) raise ValueError(errmsg) return data