diff --git a/zenmap/install_scripts/macosx/zenmap_auth.m b/zenmap/install_scripts/macosx/zenmap_auth.m index 3873e2c88..a3eae39b3 100644 --- a/zenmap/install_scripts/macosx/zenmap_auth.m +++ b/zenmap/install_scripts/macosx/zenmap_auth.m @@ -3,12 +3,12 @@ // Objective-C // // This program attempts to run an applescript script which asks for root -// privileges. If the authorization fails or is canceled, Zenmap is run +// privileges. If the authorization fails or is canceled, Zenmap is run // without privileges using applescript. -// +// // This program is the first link in the chain: // zenmap_auth -> zenmap_wrapper.py -> zenmap.bin -// +// #import #import @@ -19,27 +19,27 @@ int main(int argc, const char * argv[]) { NSString *executable_path; NSString *cwd; size_t len_cwd; - + cwd = [[NSBundle mainBundle] bundlePath]; len_cwd = [cwd length]; executable_path = cwd; executable_path = [NSString stringWithFormat:@"%@/Contents/MacOS/%s", executable_path, EXECUTABLE_NAME]; NSLog(@"%@",executable_path); - + NSDictionary *error = [NSDictionary new]; NSString *script = [NSString stringWithFormat:@"do shell script \"%@ %s\" with administrator privileges", executable_path, (char*)argv]; NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script]; if ([appleScript executeAndReturnError:&error]) { NSLog(@"success!"); } else { - NSLog(@"failure!"); + NSLog(@"Failed to execute applescript with admin privileges, trying without."); NSDictionary *error = [NSDictionary new]; NSString *script = [NSString stringWithFormat:@"do shell script \"%@ %s\"", executable_path, (char*)argv]; NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script]; if ([appleScript executeAndReturnError:&error]) { NSLog(@"success!"); } else { - NSLog(@"total failure!"); + NSLog(@"Failed to execute applescript at all."); } } }