mount: warn about symlinks pointing outside of the mountpoint, see #9254
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled

This commit is contained in:
MartinKurtz 2026-01-20 03:21:34 +01:00 committed by GitHub
parent 5112caba32
commit 4827521f9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -79,6 +79,11 @@ class MountMixIn:
archives and the directory structure below these will be loaded on-demand from
the repository when entering these directories, so expect some delay.
Care should be taken, as Borg backs up symlinks as-is. When an archive
or repository is mounted, it is possible to jump outside the mount point
by following a symlink. If this happens, files or directories (or versions of them)
that are not part of the archive or repository may appear to be within the mount point.
Unless the ``--foreground`` option is given, the command will run in the
background until the filesystem is ``unmounted``.

View file

@ -565,6 +565,11 @@ class FuseOperations(llfuse.Operations, FuseBackend):
)
self._create_filesystem()
llfuse.init(self, mountpoint, options)
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."
)
if not foreground:
if isinstance(self.repository_uncached, RemoteRepository):
daemonize()