1
두 명 이상의 사용자가있는 Mac OS X에서는 Objective C에서 다른 사용자로 프로세스를 실행하는 API 또는 코드가 있습니까?Mac OS X에서 다른 사용자로 프로그램 시작
두 명 이상의 사용자가있는 Mac OS X에서는 Objective C에서 다른 사용자로 프로세스를 실행하는 API 또는 코드가 있습니까?Mac OS X에서 다른 사용자로 프로그램 시작
AuthorizationExecuteWithPrivileges 예를 들어보세요. at http://www.michaelvobrien.com/blog/2009/07/authorizationexecutewithprivileges-a-simple-example/
// Create authorization reference
AuthorizationRef authorizationRef;
OSStatus status;
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
kAuthorizationFlagDefaults, &authorizationRef);
// Run the tool using the authorization reference
char *tool = "/sbin/dmesg";
char *args[] = {NULL};
FILE *pipe = NULL;
status = AuthorizationExecuteWithPrivileges(authorizationRef, tool,
kAuthorizationFlagDefaults, args, &pipe);