From 970d9b0207da923a33ca114b3fc2b10b3952a1c0 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 15 Aug 2017 12:52:44 +0200 Subject: [PATCH] [fix] uses strong hash for admin password --- src/yunohost/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index 5b74883f1..70c867525 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -122,8 +122,11 @@ def tools_adminpw(auth, new_password): new_password """ + from yunohost.user import _hash_user_password try: - auth.con.passwd_s('cn=admin,dc=yunohost,dc=org', None, new_password) + auth.update("cn=admin", { + "userPassword": _hash_user_password(new_password), + }) except: logger.exception('unable to change admin password') raise MoulinetteError(errno.EPERM,