为什么我的OS X文件是可执行的;为什么?我应该改变吗? [英] Why are my OS X files executable; should I change that?

查看:94
本文介绍了为什么我的OS X文件是可执行的;为什么?我应该改变吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的OS X计算机上使用终端在某些目录中进行散布,我发现许多文件(大多是旧的.doc.xls.jpg甚至是某些.url文件)都具有权限

Rummaging around some directories using Terminal on my OS X machine, I've discovered that many files (mostly old .doc, .xls, .jpg and even some .url files) have permissions

-rwx------+

而不是更常见(和期望的)

rather than the more common (and expected)

-rw-r--r--+

-rw-r--r--@

我不清楚为什么会这样.大多数有问题的文件都比较旧(有些文件很旧,也许是因为它们驻留在Windows计算机上的黑暗时期),并且自创建以来就进行了许多迁移和更新.所以,

I'm unclear why this should be the case. Most of the offending files are older (some quite old, perhaps from the dark days when they resided on a Windows machine) and there have been many migrations and updates since their creation. So,

  1. 是否有大量(通常是较旧的)具有这些权限的文件有任何明显或常见的原因(或可能是正当的理由),并且
  2. 我有什么理由担心它们是可执行文件吗?

如果2的答案是肯定的,我可以简单地找到有问题的文件chmod a-x./p>

I assume if the answer to 2 is yes, I can simply locate the offending files and chmod a-x.

推荐答案

  1. 是否有大量(通常是较旧的)具有这些权限的文件有任何明显或常见的原因(或可能是正当的理由),并且

是的,FAT没有任何权限概念,因此通过FAT卷(即格式化了多少USB记忆棒和SD卡)复制的文件经常具有权限-rwx------.除非使用Unix扩展名,否则SMB也不支持Unix样式权限,因此以这种方式复制的文件也可以最终获得这种权限.

Yes, FAT doesn't have any notion of permissions, so files copied via a FAT volume (which is how many USB sticks and SD cards are formatted) frequently have permissions -rwx------. SMB also doesn't support Unix style permissions, unless using Unix extensions, so files copied that way can also end up with such permissions.

  1. 我有什么理由担心它们是可执行文件吗?

在大多数情况下,没有.如果您在PATH中包含了它们,并且它们的名称遮盖了您正在使用的某些命令,并且它们是一个多语言文档,并且还具有可执行文件的功能,则可能会发生恶作剧.这些情况不太可能出现,但是如果您担心的话,请按照您的描述随意修复权限.

For the most part, no. It's possible that if you had them in your PATH, and they had a name that shadowed some command you were using, and they were a polyglot document that also functioned as an executable, something nefarious could happen. These conditions are unlikely to arise, but if you're worried, feel free to fix the permissions as you describe.

这篇关于为什么我的OS X文件是可执行的;为什么?我应该改变吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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