Problems with authorization (error -60002, errAuthorizationInvalidRef)
Problems with authorization (error -60002, errAuthorizationInvalidRef)
- Subject: Problems with authorization (error -60002, errAuthorizationInvalidRef)
- From: deepak gopal <email@hidden>
- Date: Mon, 1 Oct 2007 23:59:24 +0530 (IST)
Hi
I am trying to get "system.privilege.admin" rights to run a script in my code. To get this authorization I am calling the method below. But I am getting the error -60002, errAuthorizationInvalidRef, why am I getting this. The same code works fine in other projects.
-----------------------------------------------
#include <Security/Security.h>
@interface build : NSObject {
AuthroizatonRef authRef;
}
@implementation build {
- (BOOL)getAuthorizationRef {
AuthorizationItem myItems = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights myRights = {1, &myItems};
AuthorizationFlags flags = kAuthorizationFlagDefaults |
kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
OSStatus status = AuthorizationCopyRights(authRef_, &myRights,
kAuthorizationEmptyEnvironment, flags, NULL);
if (status != errAuthorizationSuccess) {
return NO;
}
return YES;
}
Thank you
DG
Share files, take polls, and discuss your passions - all under one roof. Go to http://in.promos.yahoo.com/groups
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden