Fail closed when a local group name cannot be resolved to a SID

This commit is contained in:
Viktor Liu
2026-07-29 18:00:04 +02:00
parent c4bc479df6
commit 3c745a8228
3 changed files with 81 additions and 16 deletions
+3 -9
View File
@@ -189,16 +189,10 @@ func (s *Server) SetAllowRootLogin(allow bool) {
// userNameLookup performs user lookup with root login permission check
func (s *Server) userNameLookup(username string) (*user.User, error) {
result := s.CheckPrivileges(PrivilegeCheckRequest{
RequestedUsername: username,
FeatureSupportsUserSwitch: true,
FeatureName: FeatureSSHLogin,
})
if !result.Allowed {
return nil, result.Error
result, err := s.userPrivilegeCheck(username)
if err != nil {
return nil, err
}
return result.User, nil
}