更改 OS X 系统文件夹的所有者是否安全?

更改 OS X 系统文件夹的所有者是否安全?

我正在尝试让 Homebrew 工作。该程序的诊断工具给了我这些建议:

你可能应该chown/usr/local/etc

...

你可能应该chown

/usr/local/share/man/de
/usr/local/share/man/de/man1

因为这些目录是不可写的。我以前没有更改过所有者或组。现在等的所有者是root,组是wheel,我的用户名是别的。

在 OS X 上更改这些文件夹的所有者是否安全?我担心我的用户不会拥有所有权限root,因此其他应用程序会遇到问题,尽管我的帐户是管理员帐户。

答案1

以下是完整的错误消息,使该问题更易于搜索:

Warning: /usr/local/etc isn't writable.
This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a brew tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/etc

Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1

sudo easy_install如果这些目录是由安装程序(如 MacTeX 或 ImageMagick 安装程序)或由或sudo pip install.创建的,也会发生这种情况。

更改这些目录的所有者应该是安全的:

sudo chown $USER /usr/local/etc /usr/local/share/man/de{,/man1}

这显示了 root 拥有的文件,按创建时间排序:

find /usr/local/{etc,share/man} -user root -exec stat -f '%B %N' {} \; | sort

相关内容