[pbs-devel] [PATCH proxmox-backup v5 5/5] fix #4995: pxar: Include symlinks in zip file creation

Filip Schauer f.schauer at proxmox.com
Mon Oct 27 14:24:47 CET 2025


Include symlinks when restoring a backup as a zip file.

Signed-off-by: Filip Schauer <f.schauer at proxmox.com>
---
 pbs-client/src/pxar/extract.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pbs-client/src/pxar/extract.rs b/pbs-client/src/pxar/extract.rs
index f8775aaf..371f0235 100644
--- a/pbs-client/src/pxar/extract.rs
+++ b/pbs-client/src/pxar/extract.rs
@@ -1089,6 +1089,17 @@ where
                     );
                     zip.add_entry::<FileContents<T>>(entry, None).await?;
                 }
+                EntryKind::Symlink(target) => {
+                    debug!("adding '{}' to zip", path.display());
+                    let entry = ZipEntry::new(
+                        path,
+                        metadata.stat.mtime.secs,
+                        metadata.stat.mode as u16,
+                        FileType::Symlink,
+                    );
+                    let target = io::Cursor::<&[u8]>::new(target.as_ref());
+                    zip.add_entry(entry, Some(target)).await?;
+                }
                 _ => {} // ignore all else
             };
         }
-- 
2.47.3





More information about the pbs-devel mailing list