Hi,
I'm running an uninstallation script through cocoa app, and I noticed that launchctl command doesn't get executed.
This is the part of the code that calls script (which contains sudo launchctl unload "name of the daemon")
//pFileName is the name of the File
NSString* pPath = [pCurrentBundle pathForResource:pFileName ofType:@"sh"];
char* const ppArgs[] = {const_cast<char*>([pPath fileSystemRepresentation]), NULL};
OSStatus status = AuthorizationExecuteWithPrivileges(m_AuthorizationRef, "/bin/sh", kAuthorizationFlagDefaults, ppArgs, NULL);
Since all other script commands get executed properly (and it unloads fine in terminal), I am guessing that I don't have same privilege as root (both EUID and RUID being 0) as TN2083 states.
Has anyone encountered it before? Did you find any solutions?