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

install: fix absolute symbolic permissions #841

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Nov 27, 2024

  • When using symbolic permissions with '=', the resulting file permissions weren't right; here's what I found...
  • mod() should be passed the original file to stat(), but it was being passed the new target file after File::Copy::copy() created it
  • Base permissions for "absolute" symbolic permissions (i.e. those set with '=') are zero, so it is not correct to stat() the original file in this case
  • The statement clearing bits in %perms for operator '=' in loop should only clear bits for $who the current iteration looks at
%perl install -m u=rwx,g=rx,o=x comm a/comm # -m 751
%perl install -m u=rwx,g=r comm a/comm # -m 740
%perl install -m 'a=' comm a/comm # -m 0

* When using '=' with 'install -m", the resulting file permissions weren't right; here's what I found...
* mod() should be passed the original file to stat(), but it was being passed the target file after File::Copy::copy() created it
* Base permissions for "absolute" symbolic permissions (i.e. those set with '=') are zero, so it is not correct to stat() the original file in this case
* The statement clearing bits in perms-hash for operator '=' in loop should only clear bits for $who the current iteration looks at

%perl install -m u=rwx,g=rx,o=x comm a/comm # -m 751
%perl install -m u=rwx,g=r comm a/comm # -m 740
%perl perl install -m 'a=' comm a/comm # -m 0
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: install The install program labels Nov 27, 2024
@coveralls
Copy link

coveralls commented Nov 27, 2024

Pull Request Test Coverage Report for Build 12041873260

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.7%) to 73.805%

Totals Coverage Status
Change from base Build 12040230006: 0.7%
Covered Lines: 355
Relevant Lines: 481

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: low get to this whenever Program: install The install program Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants