objective c - Change text of smjobbless dialog kAuthorizationEnvironmentPrompt -
smjobbless has dialog prompt tells user installing helper tool , type password proceed. alter text.
instead of changing text, next code puts custom text @ origin , still displays default text. missing or doing wrong?
// creating auth item bless helper tool , install framework authorizationitem authitem = {ksmrightblessprivilegedhelper, 0, null, 0}; // creating set of authorization rights authorizationrights authrights = {1, &authitem}; nsstring *prompttext = @"customized text. privilege?\n\n"; authorizationitem dialogconfiguration[1] = { kauthorizationenvironmentprompt, [prompttext length], (char *) [prompttext utf8string], 0 }; authorizationenvironment authorizationenvironment = { 0 }; authorizationenvironment.items = dialogconfiguration; authorizationenvironment.count = 1; // specifying authorization options authorization authorizationflags flags = kauthorizationflagdefaults | kauthorizationflaginteractionallowed | kauthorizationflagextendrights; // open dialog , prompt user password osstatus status = authorizationcreate(&authrights, &authorizationenvironment, flags, authref);`
use kauthorizationrightexecute instead of ksmrightblessprivilegedhelper short text inquire input password.. , utilize kauthorizationenvironmentprompt environment can add together additional text in origin of tips..
objective-c authorization
No comments:
Post a Comment