From a7fe2ff4fdfcb2619b892aff170d42609965b20b Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 11 Jan 2021 19:02:53 +0100 Subject: login: T3208: fix wrong string formatting on my_set Commit e8a1c291 ("login: radius: T3192: migrate to get_config_dict()") did an invalid forward of the newly encrypted passwort to my_set to store it inside the config. --- src/conf_mode/system-login.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/conf_mode/system-login.py b/src/conf_mode/system-login.py index 10d297aff..99af5c757 100755 --- a/src/conf_mode/system-login.py +++ b/src/conf_mode/system-login.py @@ -158,11 +158,11 @@ def generate(login): env = os.environ.copy() env['vyos_libexec_dir'] = '/usr/libexec/vyos' - call(f"/opt/vyatta/sbin/my_delete system login user '{user}' " - "authentication plaintext-password", env=env) + call(f"/opt/vyatta/sbin/my_delete system login user '{user}' " \ + f"authentication plaintext-password", env=env) - call(f"/opt/vyatta/sbin/my_set system login user '{user}' " - "authentication encrypted-password '{encrypted_password}'", env=env) + call(f"/opt/vyatta/sbin/my_set system login user '{user}' " \ + f"authentication encrypted-password '{encrypted_password}'", env=env) else: try: if getspnam(user).sp_pwdp == dict_search('authentication.encrypted_password', user_config): @@ -212,7 +212,6 @@ def apply(login): else: command += f" -d '/home/{user}'" command += f' -G frrvty,vyattacfg,sudo,adm,dip,disk {user}' - try: cmd(command) -- cgit v1.2.3