Skip to content

Commit f379420

Browse files
authored
mount: warn about symlinks pointing outside of the mountpoint, see borgbackup#9254
1 parent 70c87b6 commit f379420

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/borg/archiver.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,6 +3227,11 @@ def define_borg_mount(parser):
32273227
archives and the directory structure below these will be loaded on-demand from
32283228
the repository when entering these directories, so expect some delay.
32293229
3230+
Care should be taken, as Borg backs up symlinks as-is. When an archive
3231+
or repository is mounted, it is possible to “jump” outside the mount point
3232+
by following a symlink. If this happens, files or directories (or versions of them)
3233+
that are not part of the archive or repository may appear to be within the mount point.
3234+
32303235
Unless the ``--foreground`` option is given the command will run in the
32313236
background until the filesystem is ``unmounted``.
32323237

src/borg/fuse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ def pop_option(options, key, present, not_present, wanted_type, int_base=0):
567567
user=dir_user, group=dir_group, uid=dir_uid, gid=dir_gid)
568568
self._create_filesystem()
569569
llfuse.init(self, mountpoint, options)
570+
logger.warning('Warning: The mounted archive is capable of containing symlinks that point outside the archive tree. When following such symlinks you may see files and directories within the mountpoint that do not reflect the archive content.')
570571
if not foreground:
571572
if isinstance(self.repository_uncached, RemoteRepository):
572573
daemonize()

0 commit comments

Comments
 (0)