Skip to content

Commit

Permalink
Add more info to auth tool run failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Feb 26, 2017
1 parent 3b04c45 commit e54748a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sparkle/SUFileManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ - (BOOL)_authorizeAndExecuteCommand:(char *)command sourcePath:(char *)sourcePat
FILE *pipe = NULL;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (AuthorizationExecuteWithPrivileges(_auth, toolPath, kAuthorizationFlagDefaults, arguments, &pipe) != errAuthorizationSuccess) {
OSStatus runStatus = AuthorizationExecuteWithPrivileges(_auth, toolPath, kAuthorizationFlagDefaults, arguments, &pipe);
if (runStatus != errAuthorizationSuccess) {
#pragma clang diagnostic pop
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:@"Failed to run authorization tool." }];
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed to run authorization tool %s (%d).", toolPath, (int)runStatus] }];
}
return NO;
}
Expand Down

0 comments on commit e54748a

Please sign in to comment.