From 02544f837c5a88d828ab829bc1b01e193766d469 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 28 Nov 2018 16:16:24 +0100 Subject: [PATCH] tools_adminpw was still checking the password strength despite --force-password --- src/yunohost/tools.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 271947b3d..baa614fa5 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -118,7 +118,7 @@ def tools_ldapinit(): return auth -def tools_adminpw(auth, new_password): +def tools_adminpw(auth, new_password, check_strength=True): """ Change admin password @@ -130,7 +130,8 @@ def tools_adminpw(auth, new_password): from yunohost.utils.password import assert_password_is_strong_enough import spwd - assert_password_is_strong_enough("admin", new_password) + if check_strength: + assert_password_is_strong_enough("admin", new_password) new_hash = _hash_user_password(new_password) @@ -416,7 +417,7 @@ def tools_postinstall(operation_logger, domain, password, ignore_dyndns=False, tools_maindomain(auth, domain) # Change LDAP admin password - tools_adminpw(auth, password) + tools_adminpw(auth, password, check_strength=not force_password) # Enable UPnP silently and reload firewall firewall_upnp('enable', no_refresh=True)