summaryrefslogtreecommitdiff
diff options
context:
space:
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)