From c6fabb49cd4e6e4e6e7505ce66d9daec8cc79d3c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 5 Feb 2020 21:29:32 +0100 Subject: user: T1990: encrypted password must be supplied in '' --- src/conf_mode/system-login-user.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/conf_mode/system-login-user.py b/src/conf_mode/system-login-user.py index 4e41ebd21..087279dc7 100755 --- a/src/conf_mode/system-login-user.py +++ b/src/conf_mode/system-login-user.py @@ -162,17 +162,18 @@ def apply(login): # update existing account cmd = "usermod" - # encrypted password must be quited in '' else it won't work! - cmd += ' -p "{}"'.format(user['password_encrypted']) - cmd += ' -s /bin/vbash' + # we need to use '' quotes when passing formatted data to the shell + # else it will not work as some data parts are lost in translation + cmd += " -p '{}'".format(user['password_encrypted']) + cmd += " -s /bin/vbash" if user['full_name']: - cmd += ' -c "{}"'.format(user['full_name']) + cmd += " -c '{}'".format(user['full_name']) if user['home_dir']: - cmd += ' -d "{}"'.format(user['home_dir']) + cmd += " -d '{}'".format(user['home_dir']) - cmd += ' -G frrvty,vyattacfg,sudo,adm,dip,disk' - cmd += ' {}'.format(user['name']) + cmd += " -G frrvty,vyattacfg,sudo,adm,dip,disk" + cmd += " {}".format(user['name']) try: os.system(cmd) -- cgit v1.2.3