From 9d0e615bb46f1b9ab04b216776313f486908aba8 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 14 Aug 2017 15:24:45 +0200 Subject: [PATCH] [enh] use the full length of available chars for salt generation --- src/yunohost/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/user.py b/src/yunohost/user.py index a5b659e04..85e890301 100644 --- a/src/yunohost/user.py +++ b/src/yunohost/user.py @@ -136,7 +136,7 @@ def user_create(auth, username, firstname, lastname, mail, password, # Adapt values for LDAP fullname = '%s %s' % (firstname, lastname) - char_set = string.ascii_uppercase + string.digits + char_set = string.ascii_uppercase + string.ascii_lowercase + string.digits + "./" salt = ''.join([random.SystemRandom().choice(char_set) for x in range(8)]) salt = '$1$' + salt + '$' user_pwd = '{CRYPT}' + crypt.crypt(str(password), salt)