Live data from Hacker News

El Capitan and Homebrew

github.com

151–160 of 298 posts

Re: El Capitan and Homebrew

#151
post #17

I'm curious to know if there's a reason everyone installs Homebrew in /usr/local (other than it being the default installation path). I've always chosen to install it in ~/.homebrew and haven't had any problems. Everything I install with Homebrew seems to handle an alternative prefix without issue.

> in ~/.homebrew

Not sure about OS X but common corporate Unix protocol is to make /home/ noexec.

Non-core ( i.e. outside central package management ) installations go to /opt/

Re: El Capitan and Homebrew

#152

Earlier quoted context omitted.

I can't think of anything more standard than /usr/local/.

BSD and Linux use /usr/local, it's not universal. But /usr/local has never been writable by non-privileged users. Homebrew depends on that nonstandard and undesireable permissions model. Apple doesn't bend to accommodate an inappropriate use. Hombrew doesn't want to use a location that is outside the default PATH, and they don't want to install with proper permissions, so they purposefully misinterpret the "standard"…

A. There is no real standard here B. Apple doesn't bend, period. They don't actually care whether the use is appropriate or inappropriate. C. Blaming this on homebrew is hilarious

Remind me again why i should need to reboot into recovery mode to create a directory?

Re: El Capitan and Homebrew

#153
post #70

Earlier quoted context omitted.

So you'd want all those programs to run as root? Isn't that against any notion of security?

Why would they run as root, just because they were owned by root? Only brew itself would need to run as root (just like most package managers do anyway).

>Why would they run as root, just because they were owned by root?

Because "sudo" (that OP wants to run them with) runs them as root by default?

Re: El Capitan and Homebrew

#154
post #67

Homebrew troubles aside, does System Integrity Protection means the end of OpenVPN and FUSE on Mac OS? Those need to add kernel modules and such.

No. The official installers are signed, and are thus not prevented.

Re: El Capitan and Homebrew

#155
post #143
post #95

Earlier quoted context omitted.

Never used Homebrew, but taking ownership of /user/local as I understand it does by default, certainly isn't a 'common unix standard'.

It doesn't take ownership by default IIRC - just recommends that you do so. It will work with sudo if you want to go that way.

I run my Mac with a non-admin account. When I want to install or update Homebrew applications, I su to my admin account and use sudo. Just checked my /usr/local and it's owned by root. I've never had a problem running Homebrew apps from my non-admin account.

Re: El Capitan and Homebrew

#156

It does kind of make sense to me that user-owned things should kind of live in /Users/username. Unfortunately that pattern in this case would lead to the redundant-seeming /Users/username/usr/local, but at least that's rooted to the user in the event other users don't want a "global" Homebrew install. Also, I believe (even if it kills some ignorant build scripts) that Homebrew lets you reconfigure where this director…

It's very common for linux applications to store stuff in $XDG_DATA_HOME (~/.local/share by default) (config files and caches go somewhere else)

In my ~/.local I also have a bin/ directory (created by some Haskell tool), so rather than putting stuff in /Users/username/usr/local, I think it might make more sense to recreate the (needed parts of) a unix fs hierarchy in /Users/username/.local

There's also ~/LibrarySupport on Macosx, if I remember correctly... but I think that contains user editable configuration files as well

Re: El Capitan and Homebrew

#157

Earlier quoted context omitted.

Being required to reboot my computer into recovery mode just to add a directory is certainly a WTF worthy situation. BTW, thanks for the down vote?

To add a directory to a system-protected directory. It's all about protecting the integrity of the installed system. If you don't like/want it, you can reboot into recovery, disable it, and leave it that way.

The integrity of the installed system could be violated by creating a directory?

My system was plenty protected already - it had a root account with a password only I knew. This is just more annoying Apple gatekeeping.

Re: El Capitan and Homebrew

#158
post #74
post #46

This is one of the reasons I love HN: a grapevine of important things to help developers fix their dev environments, security things we need to be aware of for our servers, new APIs to take advantage of, and other important stuff.

Well, if you use OS X, write against Node.JS, work at a SV startup and are interested in big data / machine learning. It is quite a bubble.

I use OS X, write Node.js, live in Northeast Iowa and I too find the information great, like OP said.

Re: El Capitan and Homebrew

#159

Earlier quoted context omitted.

Most Mac users will never need to do this, and the short reboot cycle is, to many, worth the extra security rootless brings. It's hardly WTF.

Being required to reboot my computer into recovery mode just to add a directory is certainly a WTF worthy situation. BTW, thanks for the down vote?

99.99% of users will never need to touch those system directories, (They aren't even required for homebrew), and, at the same time, writing to them poses a huge gaping security hole for all OS X users. Locking them down (particularly in a way that can be trivially reversed with a user who has physical possession of the device and the password) is the right thing to do.

For the 0.01% who need to screw around with the operating system directories, they can take the 90 seconds to hop into recovery mode.

This is a situation where 100% of the user community has a reasonable solution, 99.99% aren't inconvenienced in the slightest, and the security situation goes up significantly. It's like hiding ~/Library by default - 99% of users probably don't need to mess around there, and hiding it probably reduced a lot of failure modes. (and, once again, for the 1%, chflags solves the problem in 5 seconds)

Honestly - I've always been terrified whenever I've been asked for my password during installation (I do a gut check every time an ARQ upgrades asks me for my password - "Do I trust them one more time? Well, they are my backup software, so, ...) - What if it's dropping something in my system directory?

I usually follow up with a cd /; sudo find -cmin -5 to see if things look reasonable - but I'm guess not all users do that. Also - with all the extended attr stuff on OS X, it's not even clear that a find -cmin -5 would be sufficient.

So - count me in the group that is really, really pleased that Apple is locking down those system directories by default.

Re: El Capitan and Homebrew

#160
post #4

I just did this (from [1]): sudo chown -R $(whoami):admin /usr/local And not `sudo chown $(whoami):admin /usr/local`. Are both really necessary? [1]: https://news.ycombinator.com/item?id=10307800

I'd say the "-R" might actually be harmful; for example the mysql GPL distribution binaries from dev.mysql.com installs in /usr/local/mysql and you definitively don't want to mess with the database file permissions there.

It might not be "best practice" to let non-homebrew stuff put things in /usr/local, but it happens.

Post reply on HN