Skip to content

Commit

Permalink
Another Slice() -> Iterate()
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Sep 16, 2022
1 parent 078e610 commit a2fb393
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions modules/engine/securitydescriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,23 @@ func (a ACE) matchObjectClassAndGUID(o *Object, requestedAccess Mask, g uuid.UUI
return false
}

for _, classattr := range o.Attr(ObjectClassGUIDs).Slice() {
result := false

ocg := o.Attr(ObjectClassGUIDs)
if ocg.Len() == 0 {
ui.Warn().Msg("That's not right")
}
o.Attr(ObjectClassGUIDs).Iterate(func(classattr AttributeValue) bool {
if class, ok := classattr.Raw().(uuid.UUID); ok {
if a.InheritedObjectType == class {
return true
result = true
return false
}
}
}
return false
return true
})

return result
}

return true
Expand Down

0 comments on commit a2fb393

Please sign in to comment.