Skip to content

Commit

Permalink
Fix style comments from review
Browse files Browse the repository at this point in the history
  • Loading branch information
tnek committed Nov 1, 2021
1 parent 5a222e2 commit 04328c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Source/common/SNTConfigurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
@property(nonatomic) BOOL syncCleanRequired;

///
/// USB Mass Storage Blocking. Defalts to false.
/// USB Mass Storage Blocking. Defaults to false.
///
@property(nonatomic) BOOL blockUSBMassStorage;

Expand Down
10 changes: 5 additions & 5 deletions Source/common/SNTConfigurator.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ @implementation SNTConfigurator
static NSString *const kFCMProject = @"FCMProject";
static NSString *const kFCMEntity = @"FCMEntity";
static NSString *const kFCMAPIKey = @"FCMAPIKey";
static NSString *const kBlockUSBMassStorageKey = @"blockUSBMassStorage";
static NSString *const kBlockUSBMassStorageKey = @"BlockUSBMassStorage";

// The keys managed by a sync server or mobileconfig.
static NSString *const kClientModeKey = @"ClientMode";
Expand Down Expand Up @@ -568,10 +568,6 @@ - (void)setSyncCleanRequired:(BOOL)syncCleanRequired {
[self updateSyncStateForKey:kSyncCleanRequired value:@(syncCleanRequired)];
}

- (void)setBlockUSBMassStorage:(BOOL)enabled {
[self updateSyncStateForKey:kBlockUSBMassStorageKey value:@(enabled)];
}

- (NSString *)machineOwner {
NSString *machineOwner = self.configState[kMachineOwnerKey];
if (machineOwner) return machineOwner;
Expand Down Expand Up @@ -667,6 +663,10 @@ - (BOOL)fcmEnabled {
return (self.fcmProject.length && self.fcmEntity.length && self.fcmAPIKey.length);
}

- (void)setBlockUSBMassStorage:(BOOL)enabled {
[self updateSyncStateForKey:kBlockUSBMassStorageKey value:@(enabled)];
}

- (BOOL)blockUSBMassStorage {
NSNumber *number = self.configState[kBlockUSBMassStorageKey];
return number ? [number boolValue] : NO;
Expand Down
1 change: 0 additions & 1 deletion Source/santad/EventProviders/SNTEndpointSecurityManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ - (void)messageHandler:(es_message_t *)m API_AVAILABLE(macos(10.15)) {
BOOL isUSB = [diskInfo[@"DADeviceProtocol"] isEqualTo:@"USB"];

if (!isRemovable || !isUSB) {
LOGI(@"Did not block mounting %s", m->event.mount.statfs->f_mntfromname);
es_respond_auth_result(self.client, m, ES_AUTH_RESULT_ALLOW, false);
return;
}
Expand Down

0 comments on commit 04328c3

Please sign in to comment.