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 (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 arch...@mail-archive.com

Reply via email to