diff --git a/unix/vncserver b/unix/vncserver index 43d4e15..f8ca7d2 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -42,10 +42,8 @@ $pidFile = "$vncUserDir/$host:$displayNumber.pid"; $kasmAuthEnabled = 1; &DisableVncAuth(); -@kasmPasswdUsers = &LoadKasmPasswdUsers(); -if ($kasmAuthEnabled && !&AtLeastOneUserConfigured()) { - &GuideUserToSetupKasmPasswdUser(); - @kasmPasswdUsers = &LoadKasmPasswdUsers(); +if ($kasmAuthEnabled) { + &EnsureAtLeastOneKasmUserExists(); } &SetupXauthorityFile(); @@ -1048,3 +1046,11 @@ sub PrepareDefaultsForPassingToXvnc { &SetReasonabeDefaults(); &LoadSystemThenUserThenMandatoryConfigs(); } + +sub EnsureAtLeastOneKasmUserExists { + @kasmPasswdUsers = &LoadKasmPasswdUsers(); + if (!&AtLeastOneUserConfigured()) { + &GuideUserToSetupKasmPasswdUser(); + @kasmPasswdUsers = &LoadKasmPasswdUsers(); + } +}