]> git.proxmox.com Git - pxar.git/commitdiff
fix fifo and socket entry kinds in accessor
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 27 Oct 2022 13:17:39 +0000 (15:17 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 27 Oct 2022 13:18:20 +0000 (15:18 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/decoder/mod.rs

index b848f52e56b45cca028f798e66a3376e4d39f53a..754fca4de38c5e8e4d073e25f06bd2ce51d2ab80 100644 (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"),
                 }
             }