Skip to content

fs::set_permissions/chmod unsupported on Linux #4202

Open
@barely-a-dev

Description

@barely-a-dev

Hello, calling fs::set_permissions(path, Permissions::from_mode(0o700))?; fails with the below message.

--> ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs:1815:50
     |
1815 |     run_path_with_cstr(p, &|p| cvt_r(|| unsafe { libc::chmod(p.as_ptr(), perm.mode) }).map(|_| ()))
     |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `chmod` on OS `linux`
...
 help: if this is a basic API commonly used on this target, please report an issue with Miri

Since I'm thinking that chmod is probably a pretty basic API commonly used on Linux, I made this issue.

Metadata

Metadata

Assignees

Labels

A-filesArea: related to files, paths, sockets, file descriptors, or handlesA-shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is available

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions