1 Star 0 Fork 107

MerlinDust/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
add-passwd-policy.patch 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
sun_hai 提交于 2022-11-08 20:26 . update anaconda to 36.16.5
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/DustMerlin/anaconda.git
git@gitee.com:DustMerlin/anaconda.git
DustMerlin
anaconda
anaconda
master

搜索帮助