AuthorizationServices - what is wrong here?
AuthorizationServices - what is wrong here?
- Subject: AuthorizationServices - what is wrong here?
- From: Alexander Bokovikov <email@hidden>
- Date: Sat, 08 Oct 2011 11:28:18 +0600
Hi, All,
Here is a piece of code where I'm trying to customize the password
input box.
Nevertheless I can see nothing but generic icon and default prompt text.
The rights are assigned and my helper tool is working correctly.
The problem is just in the interface customization.
Could anybody tell me what I'm doing wrong here?
Thanks in advance.
..........
lpath = [launchPath fileSystemRepresentation];
//
AuthorizationItem right = {"system.privilege.root",
strlen(lpath),
(void *)lpath,
0};
AuthorizationRights rights = {1, &right};
//
char *prompt = "My custom prompt text";
iconFile = [[NSBundle mainBundle] bundlePath];
iconFile = [iconFile stringByAppendingPathComponent:@"Contents/
Resources/icon.png"];
iconPath = [iconFile fileSystemRepresentation];
AuthorizationItem envItem[2];
envItem[0].name = kAuthorizationEnvironmentPrompt;
envItem[0].valueLength = strlen(prompt);
envItem[0].value = prompt;
envItem[0].flags = 0;
envItem[1].name = kAuthorizationEnvironmentIcon;
envItem[1].valueLength = strlen(iconPath),
envItem[1].value = (void *)iconPath,
envItem[1].flags = 0;
AuthorizationItemSet envItems;
envItems.count = 2;
envItems.items = &envItem[0];
//
AuthorizationFlags flags = kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
//
err = AuthorizationCreate(&rights,
&envItems,
flags,
&authorizationRef);
.........
Best regards,
-Alex
_______________________________________________
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