Skip to content

Commit

Permalink
use a getter
Browse files Browse the repository at this point in the history
  • Loading branch information
tburgin committed Sep 20, 2018
1 parent 0932359 commit 9e4135e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/santad/DataLayer/SNTRuleTable.m
Expand Up @@ -34,10 +34,15 @@ @interface SNTRuleTable ()
@property NSString *launchdCertSHA;
@property NSDate *lastTransitiveRuleCulling;
@property NSDictionary *criticalSystemBinaries;
@property(readonly) NSArray *criticalSystemBinaryPaths;
@end

@implementation SNTRuleTable

- (NSArray *)criticalSystemBinaryPaths {
return @[ @"/usr/libexec/trustd", @"/usr/sbin/securityd", @"/usr/libexec/xpcproxy" ];
}

- (uint32_t)initializeDatabase:(FMDatabase *)db fromVersion:(uint32_t)version {
// Lock this database from other processes
[[db executeQuery:@"PRAGMA locking_mode = EXCLUSIVE;"] close];
Expand Down Expand Up @@ -94,7 +99,7 @@ - (uint32_t)initializeDatabase:(FMDatabase *)db fromVersion:(uint32_t)version {
// Setup critical system binaries
// TODO(tburgin): Add the Santa components to this feature and remove the santadCertSHA rule.
NSMutableDictionary *bins = [NSMutableDictionary dictionary];
for (NSString *path in @[ @"/usr/libexec/trustd", @"/usr/sbin/securityd" ]) {
for (NSString *path in self.criticalSystemBinaryPaths) {
SNTFileInfo *binInfo = [[SNTFileInfo alloc] initWithPath:path];
MOLCodesignChecker *csInfo = [binInfo codesignCheckerWithError:NULL];

Expand Down

0 comments on commit 9e4135e

Please sign in to comment.