我是否需要管理员权限才能使用FSEvents监视Mac中的文件 [英] Do i need Administrator privileges to Monitor files in Mac using FSEvents

查看:108
本文介绍了我是否需要管理员权限才能使用FSEvents监视Mac中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用程序在Mac中获取文件系统事件通知.当我在搜索FSEvents时,发现Dropbox也在使用FSEvents,它要求管理员特权来运行"dbfseventsd"进程.我是否还需要对我的应用程序具有管理员权限才能监视目录中的更改??

I'm trying to get the File System Event notifications in Mac for my Application. When i was googling about FSEvents, noticed Dropbox is also using FSEvents and it's asking for administrator privileges to run "dbfseventsd" process. Do i also need to have Administrator privileges for my Application to monitor changes in a Directory ..?

推荐答案

来自Apple的文档

文件系统权限和文件系统事件

File System Permissions and File System Events

与文件系统事件相关的最明显的安全隐患是隐私之一.如果Bob可以看到Alice的主目录更改中的事件列表,则Bob可能会看到Alice不想看到的内容.例如,爱丽丝的目录名称可能与未发布的Apple产品的代码名称一致.

The most obvious security concern related to file system events is one of privacy. If Bob can see a list of events from changes to Alice’s home directory, Bob might see things that Alice does not want him to see. For example, Alice might have a directory name that coincides with the code name of an unreleased Apple product.

为防止这种潜在的安全漏洞,除非用户可以通过标准文件系统权限访问修改后的目录,否则用户不会收到任何事件.

To prevent this potential security leak, users do not receive any events unless the user can reach the modified directory through standard file system permissions.

注意:作为副作用,即使用户正在监视从根开始的所有目录上的所有事件,提供给文件系统事件客户端的事件ID也不一定是连续的. 只能保证以root用户身份运行的应用程序能够接收所有事件.

Note: As a side effect, event IDs presented to a file system events client will not necessarily be consecutive even if the user is monitoring all events on all directories beginning at the root. Only applications running as the root user can be guaranteed to receive all events.

这篇关于我是否需要管理员权限才能使用FSEvents监视Mac中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆