mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Merge pull request #541 from zorgiepoo/unable-quarantine-fix
Only remove quarantine with -[NSURL setResourceValue:] when it's present
This commit is contained in:
commit
4d111b96e4
1 file changed
+10
-2
Vendored
+10
-2
@@ -599,7 +599,11 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
}
|
||||
#endif
|
||||
NSURL *rootURL = [NSURL fileURLWithPath:root];
|
||||
[rootURL setResourceValue:[NSNull null] forKey:NSURLQuarantinePropertiesKey error:NULL];
|
||||
id rootResourceValue = nil;
|
||||
[rootURL getResourceValue:&rootResourceValue forKey:NSURLQuarantinePropertiesKey error:NULL];
|
||||
if (rootResourceValue) {
|
||||
[rootURL setResourceValue:[NSNull null] forKey:NSURLQuarantinePropertiesKey error:NULL];
|
||||
}
|
||||
|
||||
// Only recurse if it's actually a directory. Don't recurse into a
|
||||
// root-level symbolic link.
|
||||
@@ -612,7 +616,11 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
|
||||
NSDirectoryEnumerator *directoryEnumerator = [manager enumeratorAtURL:rootURL includingPropertiesForKeys:nil options:(NSDirectoryEnumerationOptions)0 errorHandler:nil];
|
||||
|
||||
for (NSURL *file in directoryEnumerator) {
|
||||
[file setResourceValue:[NSNull null] forKey:NSURLQuarantinePropertiesKey error:NULL];
|
||||
id fileResourceValue = nil;
|
||||
[file getResourceValue:&fileResourceValue forKey:NSURLQuarantinePropertiesKey error:NULL];
|
||||
if (fileResourceValue) {
|
||||
[file setResourceValue:[NSNull null] forKey:NSURLQuarantinePropertiesKey error:NULL];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user