fix #3026: pxar: metadata: apply flags _after_ updating mtime

otherwise we'll fail to update the mtime of immutable files

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-02-09 12:58:47 +01:00
parent 41c0333814
commit 9213744ecb

View File

@ -133,10 +133,6 @@ pub fn apply(
.or_else(&mut *on_error)?;
}
if metadata.stat.flags != 0 {
apply_flags(flags, fd, metadata.stat.flags).or_else(&mut *on_error)?;
}
let res = c_result!(unsafe {
libc::utimensat(
libc::AT_FDCWD,
@ -157,6 +153,10 @@ pub fn apply(
}
}
if metadata.stat.flags != 0 {
apply_flags(flags, fd, metadata.stat.flags).or_else(&mut *on_error)?;
}
Ok(())
}