• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fw: Problems with authorization (error -60002, errAuthorizationInvalidRef)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: Problems with authorization (error -60002, errAuthorizationInvalidRef)


  • Subject: Fw: Problems with authorization (error -60002, errAuthorizationInvalidRef)
  • From: deepak gopal <email@hidden>
  • Date: Tue, 2 Oct 2007 01:30:14 +0530 (IST)

Resending it as the first attempt failed.

----- Forwarded Message ----
From: deepak gopal <email@hidden>
To: cocoa dev <email@hidden>
Sent: Monday, 1 October, 2007 11:29:24 AM
Subject: Problems with authorization (error -60002, errAuthorizationInvalidRef)

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







       Why delete messages? Unlimited storage is just a click away.





      Forgot the famous last words? Access your message archive online at http://in.messenger.yahoo.com/webmessengerpromo.php
_______________________________________________

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

  • Prev by Date: Re: How can we draw a NSWindow in a custom NSView?
  • Next by Date: Fw: Problems with authorization (error -60002, errAuthorizationInvalidRef)
  • Previous by thread: Re: Converting NSArray of NSString elements into binary?
  • Next by thread: Fw: Problems with authorization (error -60002, errAuthorizationInvalidRef)
  • Index(es):
    • Date
    • Thread