[Sandbox] Don't try to grant access to container
Do not try to grant access to the app's container folder when searching for paths to add. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
0e4ff8a55c
commit
1e03df2aab
|
@ -18,6 +18,11 @@
|
||||||
@property(nonatomic) NSURL *_Nullable url;
|
@property(nonatomic) NSURL *_Nullable url;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
static NSURL *containerDirectory(void) {
|
||||||
|
NSString *path = [@"~" stringByExpandingTildeInPath];
|
||||||
|
return [NSURL fileURLWithPath:path];
|
||||||
|
}
|
||||||
|
|
||||||
// XXX this is only for comparison, not "escaping the sandbox"
|
// XXX this is only for comparison, not "escaping the sandbox"
|
||||||
static NSURL *pathEscape(NSString *path) {
|
static NSURL *pathEscape(NSString *path) {
|
||||||
NSString *componentsToRemove = [NSString stringWithFormat:@"Library/Containers/%@/Data/", [[NSBundle mainBundle] bundleIdentifier]];
|
NSString *componentsToRemove = [NSString stringWithFormat:@"Library/Containers/%@/Data/", [[NSBundle mainBundle] bundleIdentifier]];
|
||||||
|
@ -92,6 +97,8 @@ static NSURL *defaultMoviesDirectory(void) {
|
||||||
NSURL *defaultDownloads = defaultDownloadsDirectory();
|
NSURL *defaultDownloads = defaultDownloadsDirectory();
|
||||||
NSURL *defaultMovies = defaultMoviesDirectory();
|
NSURL *defaultMovies = defaultMoviesDirectory();
|
||||||
|
|
||||||
|
NSURL *container = containerDirectory();
|
||||||
|
|
||||||
id sandboxBrokerClass = NSClassFromString(@"SandboxBroker");
|
id sandboxBrokerClass = NSClassFromString(@"SandboxBroker");
|
||||||
|
|
||||||
NSMutableArray *items = [[NSMutableArray alloc] init];
|
NSMutableArray *items = [[NSMutableArray alloc] init];
|
||||||
|
@ -125,6 +132,8 @@ static NSURL *defaultMoviesDirectory(void) {
|
||||||
aSubdirectoryOf:defaultDownloads] ||
|
aSubdirectoryOf:defaultDownloads] ||
|
||||||
[sandboxBrokerClass isPath:url
|
[sandboxBrokerClass isPath:url
|
||||||
aSubdirectoryOf:defaultMovies] ||
|
aSubdirectoryOf:defaultMovies] ||
|
||||||
|
[sandboxBrokerClass isPath:url
|
||||||
|
aSubdirectoryOf:container] ||
|
||||||
[sandboxPathBehaviorController matchesPath:url])
|
[sandboxPathBehaviorController matchesPath:url])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue