tools: fs: default to 644 for mode in replace_file
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
c27369e136
commit
f90cbb7edd
@ -97,11 +97,9 @@ pub fn replace_file<P: AsRef<Path>>(
|
||||
.perm
|
||||
.unwrap_or(stat::Mode::from_bits_truncate(0o644));
|
||||
|
||||
if options.perm.is_some() {
|
||||
if let Err(err) = stat::fchmod(fd, mode) {
|
||||
let _ = unistd::unlink(tmp_path);
|
||||
bail!("fchmod {:?} failed: {}", tmp_path, err);
|
||||
}
|
||||
if let Err(err) = stat::fchmod(fd, mode) {
|
||||
let _ = unistd::unlink(tmp_path);
|
||||
bail!("fchmod {:?} failed: {}", tmp_path, err);
|
||||
}
|
||||
|
||||
if options.owner.is_some() || options.group.is_some() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user