From cd3ed6af6fa6e590ef3736ed61c7d3962740a9ef Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 7 Dec 2018 19:12:47 +0100 Subject: [PATCH] Explicit root password change each time admin password is changed --- locales/en.json | 2 +- .../data_migrations/0006_sync_admin_and_root_passwords.py | 2 +- src/yunohost/tools.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/locales/en.json b/locales/en.json index 6ce22ca80..6a2852f80 100644 --- a/locales/en.json +++ b/locales/en.json @@ -291,7 +291,6 @@ "migration_0005_postgresql_96_not_installed": "Postgresql 9.4 has been found to be installed, but not postgresql 9.6 !? Something weird might have happened on your system :( ...", "migration_0005_not_enough_space": "Not enough space is available in {path} to run the migration right now :(.", "migration_0006_disclaimer": "Yunohost now expects admin and root passwords to be synchronized. By running this migration, your root password is going to be replaced by the admin password.", - "migration_0006_done": "Your root password have been replaced by your admin password.", "migrations_backward": "Migrating backward.", "migrations_bad_value_for_target": "Invalid number for target argument, available migrations numbers are 0 or {}", "migrations_cant_reach_migration_file": "Can't access migrations files at path %s", @@ -375,6 +374,7 @@ "restore_running_hooks": "Running restoration hooks...", "restore_system_part_failed": "Unable to restore the '{part:s}' system part", "root_password_desynchronized": "The admin password has been changed, but YunoHost was unable to propagate this on the root password !", + "root_password_replaced_by_admin_password": "Your root password have been replaced by your admin password.", "server_shutdown": "The server will shutdown", "server_shutdown_confirm": "The server will shutdown immediatly, are you sure? [{answers:s}]", "server_reboot": "The server will reboot", diff --git a/src/yunohost/data_migrations/0006_sync_admin_and_root_passwords.py b/src/yunohost/data_migrations/0006_sync_admin_and_root_passwords.py index 366363f22..ee3aeefcb 100644 --- a/src/yunohost/data_migrations/0006_sync_admin_and_root_passwords.py +++ b/src/yunohost/data_migrations/0006_sync_admin_and_root_passwords.py @@ -23,7 +23,7 @@ class MyMigration(Migration): new_hash = self._get_admin_hash() self._replace_root_hash(new_hash) - logger.info(m18n.n("migration_0006_done")) + logger.info(m18n.n("root_password_replaced_by_admin_password")) def backward(self): pass diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index baa614fa5..fea1f8398 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -155,6 +155,8 @@ def tools_adminpw(auth, new_password, check_strength=True): except IOError as e: logger.warning(m18n.n('root_password_desynchronized')) return + + logger.info(m18n.n("root_password_replaced_by_admin_password")) logger.success(m18n.n('admin_password_changed'))