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
@oli-obk
Copy link
Contributor

oli-obk commented Mar 3, 2025

I think should fix the read functions before making the write functions do anything

@tiif
Copy link
Contributor

tiif commented Mar 25, 2025

Hi @el-ev, this PR appears to be inactive for quite a while, just checking if you're able to continue, or if you'd like any help to move it forward?

@tiif
Copy link
Contributor

tiif commented Mar 29, 2025

I will just mark this as waiting on author for now.

Feel free to ask more questions or mark this as ready (after resolving feedback) by writing @rustbot ready in the comment. ^^

@rustbot author

@rustbot rustbot added the S-waiting-on-author Status: Waiting for the PR author to address review comments label Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: Waiting for the PR author to address review comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fs::set_permissions/chmod unsupported on Linux
4 participants