Skip to content

Commit

Permalink
Merge pull request #116 from 2ndalpha/issue_112
Browse files Browse the repository at this point in the history
Fixes #112
  • Loading branch information
2ndalpha authored Jan 23, 2017
2 parents 74b0a93 + bb88b8c commit 6561102
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
10 changes: 3 additions & 7 deletions Source/PrivilegedActions.m
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 6561102

Please sign in to comment.