Merge pull request #9859 from PhrozenByte/drop-symlink-mount-warning
Some checks are pending
CI / lint (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run
Windows CI / msys2-ucrt64 (push) Waiting to run

Drop borgfs runtime warning about symlinks and improve corresponding docs
This commit is contained in:
TW 2026-07-05 00:28:05 +02:00 committed by GitHub
commit c908d2485e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 5 deletions

View file

@ -3283,10 +3283,26 @@ class Archiver:
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.
.. note::
Borg stores symbolic links as-is. Consequently, when an archive or
repository is mounted, symbolic links may resolve to locations outside of
the mountpoint, either because they are absolute or because relative links
traverse outside of the mounted tree.
Normal UNIX pathname resolution applies: most tools follow symbolic links
by default and may therefore access files or directories that are not part
of the mounted archive. Consequently, operations intended to inspect
archived data may instead access "live" data from the host filesystem.
On Linux, this can be prevented by remounting the mountpoint with the
``nosymfollow`` VFS mount option, for example:
borg mount <repo path> <mountpoint>
mount -o remount,nosymfollow <repo path> <mountpoint>
Alternatively, access the mounted archive from an appropriately isolated
environment (for example, a container or ``chroot``).
Unless the ``--foreground`` option is given the command will run in the
background until the filesystem is ``unmounted``.

View file

@ -569,7 +569,6 @@ class FuseOperations(llfuse.Operations, FuseBackend):
user=dir_user, group=dir_group, uid=dir_uid, gid=dir_gid)
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()