我正在运行带有选项allow_other和umask 0的保险丝fs。这给了我一组权限设置为777的文件。尽管当我尝试在包含文件的目录中单击ls -l
时,还是得到以下输出:] >
ls: name: Operation not permitted ls: tags: Operation not permitted ls: location: Operation not permitted ls: ext: Operation not permitted ls: experiment_id: Operation not permitted ls: file_path: Operation not permitted
谁能告诉我为什么拥有全局权限(777)但仍无法进行操作?
在运行strace时,我得到以下跟踪:
lstat("tags", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0 lgetxattr("tags", "security.selinux", 0x112ae80, 255) = -1 EPERM (Operation not permitted) write(2, "ls: ", 4ls: ) = 4 write(2, "tags", 4tags) = 4 write(2, ": Operation not permitted", 25: Operation not permitted) = 25 write(2, "\n", 1 ) = 1 lstat("location", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0 lgetxattr("location", "security.selinux", 0x112aea0, 255) = -1 EPERM (Operation not permitted) write(2, "ls: ", 4ls: ) = 4 write(2, "location", 8location) = 8 write(2, ": Operation not permitted", 25: Operation not permitted) = 25 write(2, "\n", 1) = 1 lstat("ext", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0 lgetxattr("ext", "security.selinux", 0x112aec0, 255) = -1 EPERM (Operation not permitted) write(2, "ls: ", 4ls: ) = 4 write(2, "ext", 3ext) = 3 write(2, ": Operation not permitted", 25: Operation not permitted) = 25 write(2, "\n", 1) = 1 lstat("experiment_id", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0 lgetxattr("experiment_id", "security.selinux", 0x112aee0, 255) = -1 EPERM (Operation not permitted) write(2, "ls: ", 4ls: ) = 4 write(2, "experiment_id", 13experiment_id) = 13 write(2, ": Operation not permitted", 25: Operation not permitted) = 25 write(2, "\n", 1) = 1 lstat("file_path", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0 lgetxattr("file_path", "security.selinux", 0x112af00, 255) = -1 EPERM (Operation not permitted) write(2, "ls: ", 4ls: ) = 4 write(2, "file_path", 9file_path) = 9 write(2, ": Operation not permitted", 25: Operation not permitted) = 25 write(2, "\n", 1) = 1
因此从跟踪中看,即使在我的系统上被禁用,它似乎仍试图获取selinux属性。
cat /etc//sysconfig/selinux
SELINUX=disabled
SELINUXTYPE=targeted
我运行带有选项allow_other和umask 0的保险丝fs。这给了我一组权限设置为777的文件。尽管当我尝试在包含文件的目录中执行ls -l时,我得到了...] >
在包含文件的目录
上设置权限。至少使用strace(1)作为>>
strace ls -l
问题出在我的getxattr实现上。我返回的错误是-1,它转换为EPERM,相反,我应该返回ENODATA,这对于我的逻辑来说是更正确的错误情况。这也修复了这些错误。
tags
请按照以下步骤解决问题。我尝试了以下步骤,为我工作了
1.拉下Apple菜单,然后选择“系统偏好设置”2.选择“安全和隐私”控制面板3.现在选择“隐私”选项卡,然后从左侧菜单中选择“全盘访问”4.单击首选项面板左下角的锁定图标,并以管理员级别登录进行身份验证5.现在单击[+]加号按钮以添加具有完全磁盘访问权限的应用程序6.导航到/ Applications / Utilities /文件夹,然后选择“ Terminal”以授予终端“完全磁盘访问”权限7.重新启动终端,“不允许操作”错误消息将消失