diff options
author | Christian Breunig <christian@breunig.cc> | 2023-10-03 18:00:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 18:00:18 +0200 |
commit | 12d8a4ad1966a32085674976065e5e9e5ca3da36 (patch) | |
tree | e5477e60216cf0664f1df3333e6c4712dc54a3c5 /src/conf_mode | |
parent | 5dc9681ac2792520bb9722e0d44a972578264013 (diff) | |
parent | 074870dad33d80e78128736f9e89bdfa1a0e08fd (diff) | |
download | vyos-1x-12d8a4ad1966a32085674976065e5e9e5ca3da36.tar.gz vyos-1x-12d8a4ad1966a32085674976065e5e9e5ca3da36.zip |
Merge pull request #2334 from vyos/mergify/bp/sagitta/pr-2331
login: T5521: home directory owner changed during reboot (backport #2331)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/system-login.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/conf_mode/system-login.py b/src/conf_mode/system-login.py index 02c97afaa..0dc84039e 100755 --- a/src/conf_mode/system-login.py +++ b/src/conf_mode/system-login.py @@ -28,6 +28,7 @@ from vyos.configverify import verify_vrf from vyos.defaults import directories from vyos.template import render from vyos.template import is_ipv4 +from vyos.utils.boot import boot_configuration_complete from vyos.utils.dict import dict_search from vyos.utils.process import cmd from vyos.utils.process import call @@ -278,8 +279,6 @@ def generate(login): if os.path.isfile(tacacs_nss_config_file): os.unlink(tacacs_nss_config_file) - - # NSS must always be present on the system render(nss_config_file, 'login/nsswitch.conf.j2', login, permission=0o644, user='root', group='root') @@ -303,6 +302,12 @@ def generate(login): def apply(login): + # Script is invoked from vyos-router.service during startup. + # While configuration mounting and so on is not yet complete, + # skip any code that messes with the local user database + if not boot_configuration_complete(): + return None + if 'user' in login: for user, user_config in login['user'].items(): # make new user using vyatta shell and make home directory (-m), |