SFAuthorization bug / crash

  • Hi guys,

    Strange crash. It happens for one user "on a couple 10.5 machines." objc_assign_strongCast seems to be GC related, but I'm not using GC.

    It seems that maybe this is a 10.5 bug where initWithFlags:rights:environment: is returning junk?

    Any ideas?

    /*
    OS Version:      Mac OS X 10.5.8 (9L31a)
    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
    Crashed Thread:  0

    Thread 0 Crashed:
    0  ???                            0xa0565027 objc_assign_strongCast + 9
    1  com.apple.securityfoundation    0x9770343b -[SFAuthorization obtainWithRight:flags:error:] + 163
    2  ...iumgroup.AraeliumFoundation  0x00094413 -[AGAuthentication authorization] + 183
    */

    - (SFAuthorization *)authorization;
    {
        if (!mAuthorization) {
            AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed;
            AuthorizationItem item = {kAuthorizationRightExecute, 0, 0, 0}; // system.privilege.admin
            AuthorizationRights rights = {1, &item};

            mAuthorization = [[SFAuthorization alloc] initWithFlags:flags rights:&rights environment:kAuthorizationEmptyEnvironment];

            if (![mAuthorization obtainWithRight:kAuthorizationRightExecute flags:flags error:nil]) {
                [mAuthorization release];
                mAuthorization = nil;
            }
        }

        return mAuthorization;
    }

    --
    Seth Willits
previous month april 2010 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today