summaryrefslogtreecommitdiff
path: root/add-passwd-policy.patch
blob: b993e7a2b8f8c9783dee85bb723799e92b7447c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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