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

Implement chmod and fchmod for Unix targets #4214

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

el-ev
Copy link

@el-ev el-ev commented Feb 26, 2025

Closes #4202

I was unable to write a test because FileMetadata only returns mode 0o100000 for the files, no permission information is provided.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add tests for the new functions

@el-ev
Copy link
Author

el-ev commented Feb 26, 2025

Please also add tests for the new functions

I've tried. Those tests would rely on file.metadata().unwrap().permissions() to check if the permissions are updated successfully. Which however doesn't return the correct permissions (only 0o100000 instead) under miri. Could you please provide some suggestions on this?

@oli-obk
Copy link
Contributor

oli-obk commented Feb 26, 2025

Maybe the shim we use to read permission is unfinished and doesn't work at all even though it could work on Unix?

@el-ev
Copy link
Author

el-ev commented Feb 27, 2025

Yes, according to miri::shims::unix::fs::FileMetadata::from_meta, the perm field contains nothing more than the type of the file.

@el-ev el-ev force-pushed the unix_chmod branch 3 times, most recently from 9b65328 to b9a6736 Compare February 27, 2025 04:24
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

Successfully merging this pull request may close these issues.

fs::set_permissions/chmod unsupported on Linux
2 participants