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

installed files have wrong permissions #585

Closed
dirtyharrycallahan opened this issue Jun 23, 2022 · 9 comments
Closed

installed files have wrong permissions #585

dirtyharrycallahan opened this issue Jun 23, 2022 · 9 comments

Comments

@dirtyharrycallahan
Copy link
Contributor

Describe the bug
Installation seems to use cp in some places resulting in installation that is influenced by installer's environment/umask

To Reproduce
set umask to 077 and run ./configure --prefix=/... && make install
check permissions on libexec/term/colors.lua, ... init/fish_tab_completion/module.fish

Expected behavior
The assumption is that the install is usable by everyone.

Desktop (please complete the following information):

  • Linux distribution: Red Hat Enterprise Linux 7
  • Lmod Version: 8.7.4

Additional context
Add any other context about the problem here.

@rtmclay
Copy link
Member

rtmclay commented Jun 23, 2022

I'm not sure that this should be "fixed". I am willing to add a test that is part of make install that says that the permissions are not useable by everyone. But I can see cases where some site might test Lmod that way.

Comments?

@rtmclay
Copy link
Member

rtmclay commented Jun 23, 2022

Also many times a user installs Lmod in their own account and a umask 077 should definitely be allowed in that case.

@kcgthb
Copy link
Contributor

kcgthb commented Jul 27, 2022

Having the installer's umask control the final permissions of the installed files does make sense, especially in the context of user-specific installations.

But it may also be counter-intuitive compared to things like make install, which often use install to deploy compiled files with pre-defined permissions and ownership.

@dirtyharrycallahan
Copy link
Contributor Author

I believe that the problem I had is because my umask was 077 when I extracted the tar ball but 022 when I performed the install but inside the install there may be a 'cp -p'. When using the install command permissions are usually explicit and the end result is not impacted by the environment.

@rtmclay
Copy link
Member

rtmclay commented Jul 31, 2022

Lmod 8.7.10 now has the following feature. It uses the user's umask as long as the id -u is greater or equal to 500. For user id's less than 500 it uses a umask of 022. Sites can override this default value by configuring with: --with-mode=MODE where MODE is the permissions with the execute bit set. So setting MODE to 755, or 750 or 700 would be appropriate. Lmod strips the execute bit off to set permissions on non-executable files.

This change should allow regular users to know what they are getting when doing personal installed and system installs should work like many sysadmin's expect.

Please test Lmod 8.7.10 to see if this change works for you.

@rtmclay
Copy link
Member

rtmclay commented Jul 31, 2022

There were some issues with Lmod 8.7.10 that I fixed. Please test Lmod 8.7.11 instead.

@opoplawski
Copy link
Contributor

Note that adds a build requirement on bc which I guess I'll need to add to the Fedora package.

@dirtyharrycallahan
Copy link
Contributor Author

While this goes above and beyond my original observation it appears to install files with appropriate permissions by default. I did not test the --with-mode option.

rtmclay pushed a commit that referenced this issue Aug 18, 2022
rtmclay pushed a commit that referenced this issue Aug 18, 2022
@rtmclay
Copy link
Member

rtmclay commented Aug 18, 2022

I am closing this issue. Feel free to re-open if there is a problem.

@rtmclay rtmclay closed this as completed Aug 18, 2022
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

4 participants