Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make install should use "install --mode=..." instead of "cp" #111

Open
notorand-it opened this issue Apr 20, 2018 · 2 comments
Open

Make install should use "install --mode=..." instead of "cp" #111

notorand-it opened this issue Apr 20, 2018 · 2 comments

Comments

@notorand-it
Copy link

When running "sudo make install" or simply "make install" as root, the Makefile assumes root umask is something like 0022. Which is just an ... assumption, not a fact.
Many system administrator set root umask to 0077 (no file is created world-readable or world-executable).

The command "install" (from GNU coreutils) has the "--mode" option to enforce file and directory permissions during the file copy. Which very likely is "0644" for Cello.h and libCello.a, and "0755" for libCello.so.

@orangeduck
Copy link
Owner

Thanks for the report. Sorry I'm not really a unix expert. So the issue is that installing libraries with cp does not work in some cases? So what is the fix for this?

@notorand-it
Copy link
Author

notorand-it commented Apr 22, 2018

To be really fool prof you'd:

install --mode=0755 -d /usr/local
install --mode=0755 -d /usr/local/lib
install --mode=0755 -d /usr/local/include

# this creates the directory tree with proper permissions for normal users

install --mode=0644 libCello.a /usr/local/lib
install --mode=0755 libCello.so /usr/local/lib
install --mode=0644 include/Cello.h /usr/local/include
ldconfig

# this last command updates the dynamic loader cache

This also covers my other ticket about the shared object not being installed.

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

No branches or pull requests

2 participants