简体   繁体   English

MacOS:检查“全盘访问”隐私选项

[英]MacOS: check for "Full disk access" privacy option

How can I check with my C application whether it has "Full disk access" permission in the System Preferences > Security & Privacy > Privacy?如何检查我的 C 应用程序在系统偏好设置 > 安全和隐私 > 隐私中是否具有“全盘访问”权限?

There is a similar question but the answer uses an outdated link and actually does not answer the question.有一个类似的问题,但答案使用了一个过时的链接,实际上并没有回答这个问题。

Actually it's pretty easy.其实这很容易。

Try to read/open a file in /Library.尝试读取/打开 /Library 中的文件。
If this fails and you get an error 257 you don't have Full Disk Access.如果此操作失败并且您收到错误 257,则您没有完整的磁盘访问权限。

It is now 2021, and there is still no API that prompts the user to enable Full Disk Access or queries on is it enabled.现在是 2021 年,仍然没有 API 提示用户启用全盘访问或查询是否启用。

There are some hacks with reading read some files, which on some system versions would be accessible only if the app has FDA enabled.读取某些文件有一些技巧,只有在应用程序启用了 FDA 的情况下,才能在某些系统版本上访问这些文件。

There are also some useful info if you could disable SIP.如果您可以禁用 SIP,还有一些有用的信息

Nothing more.而已。

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

相关问题 是否有任何 API 可以获取 macOS 中应用程序的完整磁盘访问信息? - Is there any API to get Full Disk Access info for an application in macOS? macOS 授予对沙盒应用程序的全盘访问权限不起作用 - macOS Granting full-disk access to sandboxed app not working MacOS:在安装过程中要求“全盘访问” - MacOS: Asking for "Full Disk Access" during installation process 如何为在 Xcode 中构建和调试的 macOS 应用程序启用全磁盘访问 - How do I enable Full Disk Access for a macOS app being built and debugged in Xcode MacOS:操作无法完成,因为磁盘已满 - MacOS: The Operation can't be completed because the disk is full Mac应用程序提示用户进行全盘访问 - Mac app to prompt user for Full Disk Access 检测我的应用程序是否具有全盘访问权限 - Detect whether my app has Full Disk Access 如何授予对内置于 Xcode 的 mac 应用程序的全盘访问权限 - How to grant full disk access to mac app built in Xcode 在 Catalina MacOS 10.15 PHP 下 Apache 下可能通过隐私更改限制通过文件链接访问某些文件 - Under Catalina MacOS 10.15 PHP under Apache has restricted access to some files via file links possibly by privacy changes macOS 中是否有用于屏幕录制的 Info.plist 键“Privacy - ... Usage Description”? - Is there an Info.plist key “Privacy - … Usage Description” for screen recording in macOS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM