pxar: decoder: fix incorrect read for hardlinks.
Decoders read must check if the file is a hardlink and read data from the corresponding offset if so. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
b7e18004a2
commit
de0aa53174
@ -381,6 +381,10 @@ impl Decoder {
|
||||
let _filename = self.inner.read_filename(head.size)?;
|
||||
|
||||
let head: PxarHeader = self.inner.read_item()?;
|
||||
if head.htype == PXAR_FORMAT_HARDLINK {
|
||||
let (_, diff) = self.inner.read_hardlink(head.size)?;
|
||||
return self.read(offset - diff, size, data_offset);
|
||||
}
|
||||
check_ca_header::<PxarEntry>(&head, PXAR_ENTRY)?;
|
||||
let _: PxarEntry = self.inner.read_item()?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user