pxar: decoder: return original name in attributes()
The returned filename should be the one of the file given at the offset, not of the one the hardlink points to. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
a129fdd9cc
commit
b7e18004a2
|
@ -339,7 +339,10 @@ impl Decoder {
|
||||||
if marker == PXAR_FORMAT_HARDLINK {
|
if marker == PXAR_FORMAT_HARDLINK {
|
||||||
let size: u64 = self.inner.read_item()?;
|
let size: u64 = self.inner.read_item()?;
|
||||||
let (_, diff) = self.inner.read_hardlink(size)?;
|
let (_, diff) = self.inner.read_hardlink(size)?;
|
||||||
return self.attributes(offset - diff);
|
// Make sure to return the original filename,
|
||||||
|
// not the one read from the hardlink.
|
||||||
|
let (_, entry, xattr, file_size) = self.attributes(offset - diff)?;
|
||||||
|
return Ok((filename, entry, xattr, file_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
if marker != PXAR_ENTRY {
|
if marker != PXAR_ENTRY {
|
||||||
|
|
Loading…
Reference in New Issue