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

User perms are not checked on file access #3

Open
toddr opened this issue Oct 23, 2018 · 2 comments
Open

User perms are not checked on file access #3

toddr opened this issue Oct 23, 2018 · 2 comments
Labels
Feature Request New feature or request Ready for work

Comments

@toddr
Copy link
Member

toddr commented Oct 23, 2018

Currently we don't check perms with file access. Given we're providing modes, we might as well check current UID/GID and do the right fail if necessary.

@toddr toddr added the Feature Request New feature or request label Oct 23, 2018
@FGasper
Copy link
Contributor

FGasper commented Jan 30, 2019

It might be cleaner yet to implement it as some sort of state variable in Test::MockFile. That way the process doesn’t need to change its credentials, and the test credentials are abstracted from the process’s.

@toddr toddr changed the title Perms are not checked on file access User perms are not checked on file access Dec 27, 2021
@toddr
Copy link
Member Author

toddr commented Dec 27, 2021

Example:

my $file = Test::MockFile->file( $file, $contents, { uid => 0, mode => 0600 } );
$> = 6;
open(my $fh, '<', $file) or die; # Should die because user doesn't have perms.

@cpanel cpanel deleted a comment Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request Ready for work
Development

No branches or pull requests

2 participants