summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-03-02 17:33:02 +0100
committerGitHub <noreply@github.com>2023-03-02 17:33:02 +0100
commitd0adefa390ed20c9a7afeddd875e583f81dd944f (patch)
tree8c95763a163291d71a9af0870d35ba8edcc68303 /src
parent1ab8a32a7cd390a7d470b25e82b411632a3b42a8 (diff)
parentcb177e0ab0efed4dd82bf57138ba64edaa650271 (diff)
downloadvyos-1x-d0adefa390ed20c9a7afeddd875e583f81dd944f.tar.gz
vyos-1x-d0adefa390ed20c9a7afeddd875e583f81dd944f.zip
Merge pull request #1864 from jestabro/system-login-error
login: T5039: catch error on 'my_set' for auth plaintext-password
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/system-login.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conf_mode/system-login.py b/src/conf_mode/system-login.py
index 0a4a88bf8..d15fe399d 100755
--- a/src/conf_mode/system-login.py
+++ b/src/conf_mode/system-login.py
@@ -30,7 +30,7 @@ from vyos.defaults import directories
from vyos.template import render
from vyos.template import is_ipv4
from vyos.util import cmd
-from vyos.util import call
+from vyos.util import call, rc_cmd
from vyos.util import run
from vyos.util import DEVNULL
from vyos.util import dict_search
@@ -203,7 +203,9 @@ def generate(login):
add_user_encrypt = " ".join(add_user_encrypt)
call(f"/opt/vyatta/sbin/my_delete {del_user_plain}", env=env)
- call(f"/opt/vyatta/sbin/my_set {add_user_encrypt}", env=env)
+ ret, out = rc_cmd(f"/opt/vyatta/sbin/my_set {add_user_encrypt}", env=env)
+ if ret:
+ raise ConfigError(out)
else:
try:
if get_shadow_password(user) == dict_search('authentication.encrypted_password', user_config):