We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a21071 commit 6087ffbCopy full SHA for 6087ffb
Cargo.toml
@@ -15,7 +15,7 @@ categories = ["filesystem"]
15
rand = { version = "0.8" }
16
17
[target.'cfg(unix)'.dependencies]
18
-nix = { version = "0.26" }
+nix = { version = "0.27", features = ["fs", "user"] }
19
20
[features]
21
default = ["unnamed-tmpfile"]
src/imp/unix/mod.rs
@@ -175,7 +175,7 @@ fn copy_file_perms<P: AsRef<Path>>(
175
Err(err) => return Err(err.into()),
176
};
177
if opts.preserve_mode {
178
- let mode = unsafe { Mode::from_bits_unchecked(stat.st_mode) };
+ let mode = Mode::from_bits_retain(stat.st_mode);
179
fchmod(copy_to.as_raw_fd(), mode)?;
180
}
181
if opts.preserve_owner.is_yes() {
0 commit comments