I am in a admin account when testing the issue.  
Ive created a User Interface to add a print queue using lpadmin.  In my User 
Interface,
i set my authorization not as admin. before  my lpa
dmin was called, an authentication dialog asking for user name and password
appears which is expected since i set my authorization to 0. When i click 
"Cancel" in the authentication dialog, i raised my
NSBeginCriticalAlertSheet stating "queue not added". When clicking "OK" button 
from my  NSBeginCriticalAlertSheet, my application quits.

here is the crash log:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x00633000

Thread 0 Crashed:
0  com.apple.Foundation          0x92bdfdc0 _NSAddExceptionHandlerForLock + 332
1  com.apple.AppKit                    0x937caec4 -[NSViewHierarchyLock 
lockForReadingWithExceptionHandler:] + 368
2  com.apple.AppKit                    0x937d02a0 -[NSView displayIfNeeded] + 80
3  com.apple.AppKit                    0x93856f34 -[NSControl mouseDown:] + 184
4  com.apple.AppKit                    0x937f8890 -[NSWindow sendEvent:] + 4616
5  com.apple.AppKit                    0x937a18d4 -[NSApplication sendEvent:] + 
4172
6  com.apple.AppKit                    0x93798d10 -[NSApplication run] + 508
7  com.apple.AppKit                    0x9388987c NSApplicationMain + 452

here are my snippet codes:
-(BOOL) createQueue : (AuthorizationRef) authRef
{
          //launch authentication dialog.

}
- (void)errorSheet:(NSNotification*)aNotification
{
    //raise error dialog
    NSBeginCriticalAlertSheet(@"failed", button1, button2, button3, 
nil,self,nil, @selector (sheetDidEnd:returnCode:contextInfo:),nil,@"queue not 
added");
}

-(void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode 
contextInfo:(void *)contextInfo
{
    //recover error from errorSheet
    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification 
notificationWithName:@"recoverfromfail" object:nil userInfo:                
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber 
numberWithBool:(returnCode==NSAlertDefaultReturn)?YES:NO],@"recover",nil]]];
}


+ (BOOL)runAsAdmin
{
      AuthorizationRights rightSet = { 0, &right 
};/*----------------------------------- intentionally set to 0 so that i will 
prompt an                  authenticaion 
dialog---------------------------------------*/

}

Static AuthorizationRef authRef = NULL;
+(AuthorizationRef)authRef
{
    return authRef;
}


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to