[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>
This commit is contained in:
Christopher Snowhill 2022-06-27 01:00:11 -07:00
parent f567750d56
commit 66262c2a71

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;
}
}