Repository navigation
Fix false Flatpak sandbox warning for /var/mnt paths - #529
Merged
Merged
Conversation
On Fedora Atomic / Bazzite, /mnt is a symlink to /var/mnt, so the --filesystem=/mnt grant already exposes /var/mnt, and Path.resolve() rewrites any /mnt/... path the user picks to its /var/mnt/... target. The sandbox reachability check only listed /mnt in _GRANTED_ROOTS, so a resolved /var/mnt/... staging or game path was flagged as "not visible inside the Flatpak sandbox" even though it is fully accessible, blocking game setup. Add /var/mnt to _GRANTED_ROOTS and grant it explicitly in the manifest, with a dependency-free selftest guarding the hint (granted trees stay silent; genuinely ungranted trees still warn). Fixes ChrisDKN#510 Assisted-by: Claude (claude-opus-4-8)
Sarthak-Awasthi
force-pushed
the
fix-flatpak-var-mnt-main
branch
from
September 10, 2026 18:35
13531b1 to
be7a773
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: On Fedora Atomic / Bazzite (and similar immutable distros)
/mntis a symlink to/var/mnt. The Flatpak manifest grants--filesystem=/mnt, which therefore already exposes/var/mnt, andPath.resolve()rewrites any/mnt/...path the user picks to its/var/mnt/...target. Butsandbox.flatpak_blocked_path_hint()only listed/mntin_GRANTED_ROOTS, so a resolved/var/mnt/...staging or game path was flagged as "This path is not visible inside the Flatpak sandbox" and game setup was blocked — even though the folder is fully accessible. Picking/mnt/...hit the same wall because it resolves to/var/mnt/....Why it's a bug: The path is genuinely reachable (the reporter confirmed the sandbox can
mkdir/rmdirthere), so the reachability check produces a false positive that stops the user from adding a game. Reported and root-caused in #510.Fix:
/var/mntto_GRANTED_ROOTSinsrc/Utils/environment/sandbox.py./var/mntexplicitly in the Flatpak manifest, so it also works where/var/mntis a real mount independent of the/mntsymlink.Test: Adds
src/Utils/environment/_sandbox_selftest.py, a dependency-free regression test following the repo's_selftest.pyconvention. It forcesin_flatpakon and drivesflatpak_blocked_path_hintwith non-existent paths so the granted-root logic (not the early "path exists" return) is what decides:/var/mnt/.../staging/SkyrimSE/mnt/...,/run/media/...,/media/.../opt/...,/data/...,/srv/...(genuinely ungranted)Run:
Verified: passes with the fix; the granted-root assertions fail if
/var/mntis reverted out of_GRANTED_ROOTS.Fixes #510
Assisted-by: Claude (claude-opus-4-8)