diff options
author | oniko94 <onikolaiev94@outlook.com> | 2025-03-25 01:56:28 +0200 |
---|---|---|
committer | oniko94 <onikolaiev94@outlook.com> | 2025-03-25 10:50:58 +0200 |
commit | d9ec5d1e70d3991ac64498734157cfb7934034ee (patch) | |
tree | 0590bbb887e163f72be35a54b466ed1024294e57 /src | |
parent | 3fee8ec30dce8f3987fe468d29109ed4e1bc492a (diff) | |
download | vyos-1x-d9ec5d1e70d3991ac64498734157cfb7934034ee.tar.gz vyos-1x-d9ec5d1e70d3991ac64498734157cfb7934034ee.zip |
T7278: Remove cracklib hack from postinstall script template
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/system_login.py | 3 | ||||
-rwxr-xr-x | src/op_mode/image_installer.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/conf_mode/system_login.py b/src/conf_mode/system_login.py index 1e6061ecf..3fed6d273 100755 --- a/src/conf_mode/system_login.py +++ b/src/conf_mode/system_login.py @@ -160,9 +160,10 @@ def verify(login): dict_object=user_config ) or None + failed_check_status = [EPasswdStrength.WEAK, EPasswdStrength.ERROR] if plaintext_password is not None: result = evaluate_strength(plaintext_password) - if result['strength'] == EPasswdStrength.WEAK: + if result['strength'] in failed_check_status: Warning(result['error']) for pubkey, pubkey_options in (dict_search('authentication.public_keys', user_config) or {}).items(): diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py index c6e9c7f6f..82756daec 100755 --- a/src/op_mode/image_installer.py +++ b/src/op_mode/image_installer.py @@ -783,6 +783,7 @@ def install_image() -> None: break print(MSG_WARN_IMAGE_NAME_WRONG) + failed_check_status = [EPasswdStrength.WEAK, EPasswdStrength.ERROR] # ask for password while True: user_password: str = ask_input(MSG_INPUT_PASSWORD, no_echo=True, @@ -792,7 +793,7 @@ def install_image() -> None: Warning(MSG_WARN_CHANGE_PASSWORD) else: result = evaluate_strength(user_password) - if result['strength'] == EPasswdStrength.WEAK: + if result['strength'] in failed_check_status: Warning(result['error']) confirm: str = ask_input(MSG_INPUT_PASSWORD_CONFIRM, no_echo=True, |