src/pxar/decoder.rs: correctly handle hardlinks in Decoder
s attribute function
If the attributes are then returned by seeking to the new offset. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
d00097a0e6
commit
1443927c02
@ -306,6 +306,13 @@ impl<R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<R, F> {
|
||||
let _filename = self.inner.read_filename(size)?;
|
||||
marker = self.inner.read_item()?;
|
||||
}
|
||||
|
||||
if marker == PXAR_FORMAT_HARDLINK {
|
||||
let size: u64 = self.inner.read_item()?;
|
||||
let (_, diff) = self.inner.read_hardlink(size)?;
|
||||
return self.attributes(offset - diff);
|
||||
}
|
||||
|
||||
if marker != PXAR_ENTRY {
|
||||
bail!("Expected PXAR_ENTRY, found 0x{:x?}", marker);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user