Skip to content

Commit

Permalink
fix: Copy symlink as symlink in snapshot compare
Browse files Browse the repository at this point in the history
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 bit-team#1902.
  • Loading branch information
sevens committed Nov 21, 2024
1 parent a5c4445 commit a4f3889
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a4f3889

Please sign in to comment.