OS X 应用程序授权
我期待对以下主题进行更新,因为使用 Xcode 4.1 及更高版本时它不会编译(https://developer.apple.com/library/mac/navigation/#section=Topics&topic=Security)更具体地说是应用程序授权(例如 BetterAuthorizationSample 中突出显示的)。
我的想法是编写一个简单的应用程序来访问 OS X 文件系统受保护区域中的一些 plist 文件(就像 macpilot 那样)来调整 Time Machine。
我编写的应用程序必须访问 /System/Library/LaunchDaemons/ 中的一个文件
上面的示例介绍了一种在给定时间内授予应用程序访问权限的方法。就我而言,我需要文件的写入权限,操作系统应该提示我输入管理员名称和密码,以将更改应用到正确的文件。
I'm looking forward to have an update on the following topic as it does not compile when using Xcode 4.1 and higher (https://developer.apple.com/library/mac/navigation/#section=Topics&topic=Security) and more particularly on Application Authorization (such as hilighted in BetterAuthorizationSample).
The idea I have is to write a simple application to access some plist fils in protected areas of the OS X filesystem (the way macpilot does) to tweak Time Machine.
The application I've written has to access one file in /System/Library/LaunchDaemons/
The above example introduces a way to give an application access rights for a given time. In my case I need write permission for a file and I should be prompted by the OS to enter my administrator name and password to apply changes to the right file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要一个授权助手来实际执行文件修改,而您的应用程序只是一个将信息传递给该助手的 UI。
读这个:
http://www.bornsleepy.com/bornsleepy/os-x-helper-applications
Github 上的示例代码(带有很好的自述文件):
https://github.com/elegantchaos/ECHelper
有关此主题的 Apple 文档:
http://developer.apple.com/库/mac/#documentation/security/conceptual/authorization_concepts/01introduction/introduction.html
You need an authorized helper which actually does the file modifications and your application is just an UI passing information to that helper.
Read this:
http://www.bornsleepy.com/bornsleepy/os-x-helper-applications
Example code on Github (with a good readme):
https://github.com/elegantchaos/ECHelper
Apples documentation on this topic:
http://developer.apple.com/library/mac/#documentation/security/conceptual/authorization_concepts/01introduction/introduction.html