Skip to content

Commit

Permalink
remove workaround, which fix wrong file flags
Browse files Browse the repository at this point in the history
- since rust-lang/rust#109368 the workaround isn't longer required
  • Loading branch information
stlankes committed Apr 15, 2023
1 parent 0e4a69d commit dc46c98
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/fd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,6 @@ fn uhyve_send<T>(port: u16, data: &mut T) {
}

fn open_flags_to_perm(flags: i32, mode: u32) -> FilePerms {
// mode is passed in as hex (0x777). Linux/Fuse expects octal (0o777).
// just passing mode as is to FUSE create, leads to very weird permissions: 0b0111_0111_0111 -> 'r-x rwS rwt'
// TODO: change in stdlib
#[cfg(not(feature = "newlib"))]
let mode = match mode {
0x777 => 0o777,
0o777 => 0o777,
0 => 0,
_ => {
info!(
"Mode {:#X} should never happen with current hermit stdlib! Using 0o777",
mode
);
0o777
}
};

let mut perms = FilePerms {
raw: flags as u32,
mode,
Expand Down

0 comments on commit dc46c98

Please sign in to comment.