summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-05 21:29:32 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-05 21:29:32 +0100
commitc6fabb49cd4e6e4e6e7505ce66d9daec8cc79d3c (patch)
tree09ecc3b571422ac618a8b2aa135a85cc92cb62ec /src/conf_mode
parentf5b95cdda6788b12e41ae13aa6979b988a147723 (diff)
downloadvyos-1x-c6fabb49cd4e6e4e6e7505ce66d9daec8cc79d3c.tar.gz
vyos-1x-c6fabb49cd4e6e4e6e7505ce66d9daec8cc79d3c.zip
user: T1990: encrypted password must be supplied in ''
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/system-login-user.py15
1 files 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)