简体   繁体   English

作为当前Mac OS X用户执行进程,而不是root用户

[英]Execute process as current Mac OS X user, not as root

I have created a Mac OS X helper application that always runs under root. 我创建了一个始终在root下运行的Mac OS X帮助应用程序。 I need to launch other application from it, but not as root. 我需要从它启动其他应用程序,但不能以root身份启动。 I want it to be launched from the current logged in user (not sudoed root). 我希望它从当前登录用户(不是sudoed root)启动。

I've tried to use [NSTask launchedTaskWithLaunchPath:arguments:] and many other methods, but they all use root privileges to launch my application. 我曾尝试使用[NSTask launchedTaskWithLaunchPath:arguments:]和许多其他方法,但它们都使用root权限来启动我的应用程序。

How can I launch my application from helper as a current Mac OS X logged in user? 如何从助手启动我的应用程序作为当前Mac OS X登录用户?

看起来授权服务编程指南可能会对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM