Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

sudo should not be used with homebrew in INSTALL.sh (macOS) #126

Open
rfay opened this issue Jul 1, 2019 · 0 comments
Open

sudo should not be used with homebrew in INSTALL.sh (macOS) #126

rfay opened this issue Jul 1, 2019 · 0 comments

Comments

@rfay
Copy link

rfay commented Jul 1, 2019

sudo has not been usable or appropriate with Homebrew on macOS for a few years now. The INSTALL.sh should not be sudo sudo, or should use sudo to escalate only when not running homebrew. See the Homebrew FAQ:

Why does Homebrew say sudo is bad?
tl;dr Sudo is dangerous, and you installed TextMate.app without sudo anyway.

Homebrew refuses to work using sudo.

You should only ever sudo a tool you trust. Of course, you can trust Homebrew 😉 But do you trust the multi-megabyte Makefile that Homebrew runs? Developers often understand C++ far better than they understand make syntax. It’s too high a risk to sudo such stuff. It could modify (or upload) any files on your system. And indeed, we’ve seen some build scripts try to modify /usr even when the prefix was specified as something else entirely.

We use the macOS sandbox to stop this but this doesn’t work when run as the root user (which also has read and write access to almost everything on the system).

Did you chown root /Applications/TextMate.app? Probably not. So is it that important to chown root wget?

If you need to run Homebrew in a multi-user environment, consider creating a separate user account especially for use of Homebrew.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant