Merge pull request #683 from zorgiepoo/copy-auth-perm

Handle additional permission denied code when copying files
This commit is contained in:
Kornel committed 2015-11-12 13:51:28 +00:00
commit 6351ee86b9
1 file changed
+3 -1
+3 -1
View File
@@ -386,7 +386,9 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
return YES;
}
if (copyResult != permErr) {
// Note: I have recieved afpAccessDenied error in testing even when not copying from/to an AFP mount,
// when the error should have been a normal permission denied one
if (copyResult != permErr && copyResult != afpAccessDenied) {
if (error != NULL) {
*error = [NSError errorWithDomain:NSOSStatusErrorDomain code:copyResult userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Failed to copy file (%@)", sourceURL.lastPathComponent] }];
}