From e54748ac87377321e6a264e5cc407fdda9ceb1f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Sun, 26 Feb 2017 18:01:07 +0000 Subject: [PATCH] Add more info to auth tool run failure --- Sparkle/SUFileManager.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index 98800e3a..7b5e3e49 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -166,10 +166,11 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { 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; }