sauce-archives / isign

Code sign iOS applications, without proprietary Apple software or hardware
Other
756 stars 316 forks source link

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

Open rfay opened 5 years ago

rfay commented 5 years ago

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.