Permalink
Browse files

Fixes #112

  • Loading branch information...
2ndalpha committed Jan 23, 2017
1 parent 74b0a93 commit bb88b8c678b0fb3925e2f7d080cb3f52066ef4c0
Showing with 5 additions and 9 deletions.
  1. +2 −2 Info.plist
  2. +3 −7 Source/PrivilegedActions.m
View
@@ -42,7 +42,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>0.8.4</string>
+ <string>0.8.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -59,7 +59,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
- <string>0.8.4</string>
+ <string>0.8.5</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key>
View
@@ -90,19 +90,15 @@ + (BOOL)authorizeWithPrompt:(NSString*)prompt
AuthorizationItem items = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights rights = {1, &items};
- AuthorizationEnvironment *environment = NULL;
- if (prompt != nil) {
- AuthorizationItem auth_prompt = {kAuthorizationEnvironmentPrompt, [prompt length], (void *)[prompt UTF8String], 0};
- AuthorizationEnvironment auth_env = { 1, &auth_prompt };
- environment = &auth_env;
- }
+ AuthorizationItem authPrompt = {kAuthorizationEnvironmentPrompt, [prompt length], (void *)[prompt UTF8String], 0};
+ AuthorizationEnvironment environment = { 1, &authPrompt };
flags = kAuthorizationFlagDefaults |
kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
- status = AuthorizationCopyRights (authorizationRef, &rights, environment, flags, NULL);
+ status = AuthorizationCopyRights (authorizationRef, &rights, &environment, flags, NULL);
if (status != errAuthorizationSuccess) {
logDebug(@"Failed to Authorize");

0 comments on commit bb88b8c

Please sign in to comment.