[Sandbox Broker] Synchronize full access operation

Full access should be synchronized, otherwise rapid access to the same
path from different threads will cause crashes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-27 01:00:11 -07:00
parent f567750d56
commit 66262c2a71
1 changed files with 9 additions and 9 deletions

View File

@ -266,18 +266,18 @@ static SandboxBroker *kSharedSandboxBroker = nil;
if(!_entry) {
_entry = [self recursivePathTest:folderUrl];
}
}
if(_entry) {
[storage addObject:_entry];
if(_entry) {
[storage addObject:_entry];
if(_entry.secureUrl) {
[_entry.secureUrl startAccessingSecurityScopedResource];
if(_entry.secureUrl) {
[_entry.secureUrl startAccessingSecurityScopedResource];
}
return CFBridgingRetain(_entry);
} else {
return NULL;
}
return CFBridgingRetain(_entry);
} else {
return NULL;
}
}