summaryrefslogtreecommitdiff
path: root/add-passwd-policy.patch
diff options
context:
space:
mode:
Diffstat (limited to 'add-passwd-policy.patch')
-rw-r--r--add-passwd-policy.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/add-passwd-policy.patch b/add-passwd-policy.patch
new file mode 100644
index 0000000..b993e7a
--- /dev/null
+++ b/add-passwd-policy.patch
@@ -0,0 +1,45 @@
+From 3562cad5ea86afc5d2ce0ead649e64cf13e39128 Mon Sep 17 00:00:00 2001
+From: sun_hai_10 <sunhai10@huawei.com>
+Date: Mon, 7 Nov 2022 14:48:28 +0800
+Subject: [PATCH] add passwd policy
+
+---
+ data/anaconda.conf | 6 +++---
+ pyanaconda/input_checking.py | 4 ++++
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/data/anaconda.conf b/data/anaconda.conf
+index 703114a..07e500f 100644
+--- a/data/anaconda.conf
++++ b/data/anaconda.conf
+@@ -308,9 +308,9 @@ can_change_users = False
+ # strict Require the minimum quality.
+ #
+ password_policies =
+- root (quality 1, length 6)
+- user (quality 1, length 6, empty)
+- luks (quality 1, length 6)
++ root (quality 1, length 8, strict)
++ user (quality 1, length 8, empty, strict)
++ luks (quality 1, length 8, strict)
+
+
+ [License]
+diff --git a/pyanaconda/input_checking.py b/pyanaconda/input_checking.py
+index 4482b26..4bed6c1 100644
+--- a/pyanaconda/input_checking.py
++++ b/pyanaconda/input_checking.py
+@@ -421,6 +421,10 @@ class PasswordValidityCheck(InputCheck):
+ pw_score = 4
+ status_text = _(constants.SecretStatus.STRONG.value)
+
++ #disable set password without confirnation
++ if not error_message and not check_request.password_confirmation:
++ error_message = _(constants.SECRET_CONFIRM_ERROR_GUI[check_request.secret_type])
++
+ # the policy influences the overall success of the check
+ # - score 0 & strict == True -> success = False
+ # - score 0 & strict == False -> success = True
+--
+2.23.0
+