diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-03-18 10:58:04 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-03-18 10:58:04 +0100 |
commit | 5ce8a9c9c19e2aaec591b191d3c3efebd1957fa7 (patch) | |
tree | 7571351ffae32a2d1a0b66ae3afd8e2fc02806a3 /qutebrowser/utils | |
parent | fb0154ae26b09accc08c9ab7fa7cbcbe9fe2578c (diff) | |
download | qutebrowser-5ce8a9c9c19e2aaec591b191d3c3efebd1957fa7.tar.gz qutebrowser-5ce8a9c9c19e2aaec591b191d3c3efebd1957fa7.zip |
Rename version.is_sandboxed() to is_flatpak()
Diffstat (limited to 'qutebrowser/utils')
-rw-r--r-- | qutebrowser/utils/standarddir.py | 5 | ||||
-rw-r--r-- | qutebrowser/utils/utils.py | 2 | ||||
-rw-r--r-- | qutebrowser/utils/version.py | 8 |
3 files changed, 11 insertions, 4 deletions
diff --git a/qutebrowser/utils/standarddir.py b/qutebrowser/utils/standarddir.py index 4ea7e5dbf..7bb632b57 100644 --- a/qutebrowser/utils/standarddir.py +++ b/qutebrowser/utils/standarddir.py @@ -232,7 +232,10 @@ def _init_runtime(args: Optional[argparse.Namespace]) -> None: # Unfortunately this path could get too long for sockets (which have a # maximum length of 104 chars), so we don't add the username here... - if version.is_sandboxed(): + if version.is_flatpak(): + # We need a path like /run/user/1000/app/org.qutebrowser.qutebrowser rather than + # /run/user/1000/qutebrowser on Flatpak, since that's bind-mounted in a way that + # it is accessible by any other qutebrowser instances. *parts, app_name = os.path.split(path) assert app_name == APPNAME, app_name path = os.path.join(*parts, 'app', os.environ['FLATPAK_ID']) diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index afc4c4f8d..2a47d60aa 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -605,7 +605,7 @@ def open_file(filename: str, cmdline: str = None) -> None: # if we want to use the default override = config.val.downloads.open_dispatcher - if version.is_sandboxed(): + if version.is_flatpak(): if cmdline: message.error("Cannot spawn download dispatcher from sandbox") return diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 63097bb8b..89da353fc 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -183,8 +183,12 @@ def distribution() -> Optional[DistributionInfo]: parsed=parsed, version=dist_version, pretty=pretty, id=dist_id) -def is_sandboxed() -> bool: - """Whether the environment has restricted access to the host system.""" +def is_flatpak() -> bool: + """Whether qutebrowser is running via Flatpak. + + If packaged via Flatpak, the environment is has restricted access to the host + system. + """ current_distro = distribution() if current_distro is None: return False |