Mailing Lists: Apple Mailing Lists

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

Prob with AuthorizationExecuteWithPrivileges and 'complex' arguments



Hi all,

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 ";"

Its not clear to me what AuthorizationExecuteWithPrivileges() considers
an 'argument', is it any string between whitespace? I tried declaring it
like this, but it doesn't work either:

const char* myArguments[] = {inKextPath, "-type d -exec /bin/chmod 0755
{} \\;", NULL};

What am I doing wrong?

Thanks!


--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Mac Software Designer +1-514-822-6000
Matrox Electronic Systems Ltd. Montrial, Quibec, Canada
_______________________________________________
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.



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.