unix - ls : Operation not Permitted

标签 unix fuse

我有一个运行带有选项 allow_other 和 umask 0 的 fuse 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

最佳答案

请按照以下步骤解决问题。我尝试了以下步骤,对我有用
1.下拉Apple菜单并选择“系统偏好设置”
2.选择“安全和隐私”控制面板
3.现在选择“隐私”选项卡,然后从左侧菜单中选择“完整磁盘访问”
4.单击首选项面板左下角的锁图标并使用管理员级别登录进行身份验证
5.现在单击[+]加号按钮添加具有全盘访问权限的应用程序
6.导航到/Applications/Utilities/文件夹并选择“终端”以授予具有全盘访问权限的终端
7.重新启动终端,“不允许操作”错误信息将消失

关于unix - ls : Operation not Permitted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25717501/

相关文章:

linux - 为什么 nautilus 会提前读取目录?

linux - 通过一些脚本在多台机器的目录下创建一个文件?

linux - AWK脚本打印字段数最多的行

linux - 是否有 FUSE 文件系统的基准测试工具?

c++ - 如何在 Windows 上编译 encfs4win

c++ - 如何在使用 g++ 编译器时使用 c 样式初始化结构?

linux - POSIX ACL 和应用于目录的 'sticky' 位

perl - 如何使用 unix 命令将字符串拆分为具有特定宽度的行?当输入字符串是无限的?

c - 并发进程的 FIFO 问题

c++ - FUSE getattr 操作是否应该始终序列化?