Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prob with AuthorizationExecuteWithPrivileges and 'complex' arguments



You should pass the arguments as separate char* in an array, as you did in the first place, but because there is no shell to intercept the semicolon, there is no need to escape it with a backslash. Try it as simply ";".

-- F


On Monday, 28 July 2003, at 11:00 AM, Sean McBride wrote:

I am trying to use AuthorizationExecuteWithPrivileges() in an application
to correct a kext's permissions. I am successfully using it to call
'kextload' and 'chown' but am having problems with the more complicated:

/usr/bin/find MyKext.kext -type d -exec /bin/chmod 0755 {} \;

I suspect the problem is either that 'find' calls 'chmod' or just a
problem with having so many parameters. My code is like this:

const char* toolPath = "/usr/bin/find";
const char* myArguments[] = {inKextPath, "-type", "d", "-exec", "/bin/
chmod", "0755", "{}", "\\;", NULL};
err = AuthorizationExecuteWithPrivileges (
authRef,
toolPath,
kAuthorizationFlagDefaults,
(char * const*)myArguments,
NULL);

I see the log "/path/to/mykext.kext: -exec: no terminating ";"
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Prob with AuthorizationExecuteWithPrivileges and 'complex' arguments (From: "Sean McBride" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.