Skip to content

Commit

Permalink
Fix check to detect changes to StaticRules (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlw committed Jun 30, 2023
1 parent d144e27 commit dde42ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/santad/Santad.mm
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,13 @@ void SantadMain(std::shared_ptr<EndpointSecurityAPI> esapi, std::shared_ptr<Logg
selector:@selector(staticRules)
type:[NSArray class]
callback:^(NSArray *oldValue, NSArray *newValue) {
if ([oldValue isEqual:newValue]) return;
NSSet *oldValueSet = [NSSet setWithArray:oldValue ?: @[]];
NSSet *newValueSet = [NSSet setWithArray:newValue ?: @[]];

if ([oldValueSet isEqualToSet:newValueSet]) {
return;
}

LOGI(@"StaticRules set has changed, flushing cache.");
auth_result_cache->FlushCache(
FlushCacheMode::kAllCaches,
Expand Down

0 comments on commit dde42ee

Please sign in to comment.