]> git.proxmox.com Git - pxar.git/commitdiff
encoder: forbid slashes in file names
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 8 Jun 2020 08:25:33 +0000 (10:25 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 8 Jun 2020 08:25:33 +0000 (10:25 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/encoder/mod.rs

index b779b8d995a90e2cadcf6cee9abe81c9b04d744f..7239d3e1b4efef85066d55e48878b95a1157cc99 100644 (file)
@@ -600,6 +600,9 @@ impl<'a, T: SeqWrite + 'a> EncoderImpl<'a, T> {
     }
 
     async fn encode_filename(&mut self, file_name: &[u8]) -> io::Result<()> {
+        if file_name.contains(&b'/') {
+            io_bail!("slash in file name not permitted");
+        }
         seq_write_pxar_entry_zero(&mut self.output, format::PXAR_FILENAME, file_name).await
     }