5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2025-01-08 01:17:40 +03:00

fix fifo and socket entry kinds in accessor

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-10-27 15:17:39 +02:00
parent 85f5a177ef
commit a6e6873f70

View File

@ -397,7 +397,18 @@ impl<I: SeqRead> DecoderImpl<I> {
match self.read_next_item_or_eof().await? {
Some(ItemResult::Entry) => break,
Some(ItemResult::Attribute) => continue,
None if self.eof_after_entry => break,
None if self.eof_after_entry => {
// Single FIFOs and sockets (as received from the Accessor) won't reach a
// FILENAME/GOODBYE entry:
if self.entry.metadata.is_fifo() {
self.entry.kind = EntryKind::Fifo;
} else if self.entry.metadata.is_socket() {
self.entry.kind = EntryKind::Socket;
} else {
self.entry.kind = EntryKind::Directory;
}
break;
}
None => io_bail!("unexpected EOF in entry"),
}
}