From a4f38890aff2cee206d72b26e0ed345f54fe488d Mon Sep 17 00:00:00 2001 From: Peter Sevens Date: Thu, 21 Nov 2024 11:33:08 +0100 Subject: [PATCH] fix: Copy symlink as symlink in snapshot compare When comparing snapshots, copy symlinks in the snapshots as symlinks, not as their target. The old behavior made the comparison not fully compare the actual snapshot data and, even worse, could fill up your entire disk (when having circular symlinks, e.g. a symlink to `/`, which copies `/` and eventually copies the original symlink which points to `/` which ...). Additionally fixes a crash when the compared snapshot(s) contain a symlink pointing to a nonexistent target. Fixes #1902. --- CHANGES | 2 ++ qt/app.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e1a7d3c66..79ce25cdc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Back In Time Version 1.6.0-dev (development of upcoming release) +* Fix: Copy symlink as symlink in snapshot compare (#1902) (Peter Sevens @sevens) + Additionally fixes a crash when comparing a snapshot with a symlink pointing to a nonexistent target. * ... Version 1.5.3 (2024-11-13) diff --git a/qt/app.py b/qt/app.py index b8221fcfa..f71a658f3 100644 --- a/qt/app.py +++ b/qt/app.py @@ -1722,7 +1722,7 @@ def tmpCopy(self, full_path, sid = None): tmp_file = os.path.join(d.name, os.path.basename(full_path)) if os.path.isdir(full_path): - shutil.copytree(full_path, tmp_file) + shutil.copytree(full_path, tmp_file, symlinks=True) else: shutil.copy(full_path, d.name)