Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to back out of a homebrew installation on OS 10.8.2 and am not sure I understand what I need to do to (or whether I need to bother to) restore permissions to what they were before the installation. I've performed all the other suggested steps and want to make sure about the final step of restoring permissions on certain directories to their pre-installation state.

What exactly did homebrew do to my permissions on these directories? Is it safe to leave them changed, or does leaving them changed pose a security risk? Is it perhaps advantageous to leave them changed, so that so that other package managers work more smoothly?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

What exactly did homebrew do to my permissions on these directories?

As far as I can tell, Homebrew lets your user own /usr/local, with the group set to admin (or staff). This applies to all subdirectories created through Homebrew within that directory. By default, I believe /usr/localis owned by the wheel group.

The other directories in /usr/local (i.e. non-Homebrew) will probably be owned by your user but might have other group ownerships (e.g. staff, wheel). See: What is the difference between default groups on Mac OS X?

Finally, to see what permissions Homebrew works best with (or ships with?), check out this Gist: Fix permissions on /usr/local for Homebrew.

Is it safe to leave them changed, or does leaving them changed pose a security risk?

By default, /usr/local isn't used for anything on OS X.

You can safely leave it owned by your user and the admin group. When other installers put files and directories there, you'd be prompted for root access if they needed it, but this is unlikely to happen and would somewhat defeat the purpose of having a user-owned directory.

It's definitely not a security risk.

Is it perhaps advantageous to leave them changed, so that so that other package managers work more smoothly?

If a package manager needed to change permissions to be installed or work smoothly, it'd prompt you to. Even Homebrew checks the permissions and should warn you if they don't match certain criteria. You can confirm this by calling brew doctor.

MacPorts for example won't even use /usr/local, but will install everything under /opt/local by default. Of course you can put it in /usr/local as well, but the MacPorts installer should take care of the permissions here. I'm fairly certain it would change ownership to root here, whereas Homebrew works without elevated privileges.

Oh, and running MacPorts alongside a package manager that lives in /usr/local is not a terribly good idea. See the MacPorts FAQ.

Fink again uses /sw instead of any of the former directories and violates the Filesystem Hierarchy Standard in some way. It can also be installed to /usr/local, and the same things as for MacPorts apply here as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.