miri icon indicating copy to clipboard operation
miri copied to clipboard

Implement `chmod` and `fchmod` for Unix targets

Open el-ev opened this issue 9 months ago • 4 comments

Closes #4202

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

el-ev avatar Feb 26 '25 16:02 el-ev

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?

el-ev avatar Feb 26 '25 16:02 el-ev

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

oli-obk avatar Feb 26 '25 19:02 oli-obk

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

el-ev avatar Feb 27 '25 03:02 el-ev

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

oli-obk avatar Mar 03 '25 13:03 oli-obk

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 avatar Mar 25 '25 03:03 tiif

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

tiif avatar Mar 29 '25 02:03 tiif

I'm going to close this PR due to inactivity. Thanks for trying to contribute, and feel free to reopen or make a new PR if you want to get back it it again!

RalfJung avatar Nov 11 '25 21:11 RalfJung