This commit is contained in:
Viktor Liu
2025-07-02 20:10:59 +02:00
parent 279b77dee0
commit 4bbca28eb6
19 changed files with 71 additions and 417 deletions

View File

@@ -129,17 +129,17 @@ func (s *Server) buildUserLookupErrorMessage(err error) string {
switch {
case errors.As(err, &privilegedErr):
if privilegedErr.Username == "root" {
return fmt.Sprintf("root login is disabled on this SSH server\n")
return "root login is disabled on this SSH server\n"
}
return fmt.Sprintf("privileged user access is disabled on this SSH server\n")
return "privileged user access is disabled on this SSH server\n"
case errors.Is(err, ErrPrivilegeRequired):
return fmt.Sprintf("Windows user switching failed - NetBird must run with elevated privileges for user switching\n")
return "Windows user switching failed - NetBird must run with elevated privileges for user switching\n"
case errors.Is(err, ErrPrivilegedUserSwitch):
return fmt.Sprintf("Cannot switch to privileged user - current user lacks required privileges\n")
return "Cannot switch to privileged user - current user lacks required privileges\n"
default:
return fmt.Sprintf("User authentication failed\n")
return "User authentication failed\n"
}
}