I recently wanted to use pod to update the path of a framework.
Cocoapods is installed and can be find here :
/usr/local/bin/
But surprise! It is set to root only access :
ls -l /usr/local drwx------ 504 wheel bin/ drwxr-xr-x@ john staff include/ drwxr-xr-x@ john staff lib/ drwxr-xr-x root wheel share/
So I can't use pod because in any case :
- pod install realm
heeeyy dude, you can't access pod cause you are not root .!.
- sudo pod install realm
heeeyy dude, you can’t use pod as a root! .!.
I feel that this folder shouldn't be set as 'root only' because:
- It is in the env PATH of the usr
- gem install pod in it?
- http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html basically says :
'/usr/local' is widely regarded as a good place in which to keep self-compiled or third-party programs.
I know Linux isn't a BSD but still, it doesn't look that much different no o.O
Finally here are my questions:
- I searched and there is no user with the uid 504, is this suspicious?
(I checked it with ""dscacheutil -q user | grep 504"")
-
What are suposed to be the rights and owner on the folder?
-
Is there someone who had the same problem?
-
Any idea about why this happened?
Best Answer
The default setup for /usr/local is shown here
this means that files and directorries under /usr/local can only be created by the root user e.g. my /usr/local has
So your share directory looks normal but the others have odd changes
include and lib look like you changed the permissions of /usr/local so you could write to it and then created these two directories (The most common setup like that is installing Homebrew) (we need to see what
ls -ld /usr/local
shows.As for bin there must have been several things. First a new user must have been added at some time, normal users (created through the System Preferences GUI start at 501) e.g. I am the second user and so my id is 502 and then the directory was created or chowned to that user- or the directory was created elsewhere and then moved as root to where it is.
Separately the permissions of the directory have been changed by
chmod 700
So the correct setting is as per /usr/local/share unless you are using Homebrew in its default install and then they should be like /usr/local/include