mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] SSH login breaks if password is longer than 127 chars...
This commit is contained in:
parent
920edf8896
commit
fad3edf66a
2 changed files with 6 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
"admin_password": "Administration password",
|
||||
"admin_password_change_failed": "Unable to change password",
|
||||
"admin_password_changed": "The administration password has been changed",
|
||||
"admin_password_too_long": "Please choose a password shorter than 127 characters",
|
||||
"app_already_installed": "{app:s} is already installed",
|
||||
"app_already_installed_cant_change_url": "This app is already installed. The url cannot be changed just by this function. Look into `app changeurl` if it's available.",
|
||||
"app_already_up_to_date": "{app:s} is already up to date",
|
||||
|
|
|
@ -132,6 +132,11 @@ def tools_adminpw(auth, new_password, check_strength=True):
|
|||
if check_strength:
|
||||
assert_password_is_strong_enough("admin", new_password)
|
||||
|
||||
# UNIX seems to not like password longer than 127 chars ...
|
||||
# e.g. SSH login gets broken (or even 'su admin' when entering the password)
|
||||
if len(new_password) >= 127:
|
||||
raise YunohostError('admin_password_too_long')
|
||||
|
||||
new_hash = _hash_user_password(new_password)
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue