Skip to content

Factor out and improve path_to_handle() - #38

Merged
alexlarsson merged 3 commits into
flatpak:masterfrom
smcv:path-to-handle
Aug 2, 2021
Merged

alexlarsson merged 3 commits into
flatpak:masterfrom
smcv:path-to-handle

Conversation

@smcv

@smcv smcv commented Dec 8, 2020

Copy link
Copy Markdown
Contributor

Preparatory work for supporting flatpak/flatpak#4018


  • flatpak-spawn: Factor out path_to_handle()

    This will let us deal with arguments that are a single path, instead
    of a GStrv of paths.

  • flatpak-spawn: Try to normalize exposed paths to be in ~/.var/app

    The Flatpak portal will reject paths that do not resolve to the same
    thing in the container and on the host system. For example,

      --sandbox-expose-path="$HOME/.config/my/file"
    

    will not work, even if

      --sandbox-expose-path="$HOME/.var/app/com.example.App/config/my/file"
    

    would.

    Existing apps like GNOME Web (Epiphany) get away with this because the
    files they are exposing are below $XDG_CONFIG_HOME, $XDG_DATA_HOME or
    $XDG_CACHE_HOME, which take values below ~/.var/app, but the same is
    not necessarily going to be true for apps like Steam that use --persist.

@smcv
smcv marked this pull request as ready for review January 8, 2021 12:35
@smcv smcv changed the title Draft: Factor out and improve path_to_handle() Factor out and improve path_to_handle() Jan 8, 2021
@smcv
smcv force-pushed the path-to-handle branch 2 times, most recently from 208547e to 9e910bd Compare January 19, 2021 18:58
@smcv
smcv force-pushed the path-to-handle branch from 9e910bd to f868eda Compare June 11, 2021 11:23
@smcv
smcv requested review from TingPing and alexlarsson June 11, 2021 12:15
Comment thread src/flatpak-spawn.c Resolved
Comment thread src/flatpak-spawn.c Resolved
smcv added 3 commits July 23, 2021 22:02
This will let us deal with arguments that are a single path, instead
of a GStrv of paths.

Signed-off-by: Simon McVittie <[email protected]>
The Flatpak portal will reject paths that do not resolve to the same
thing in the container and on the host system. For example,

    --sandbox-expose-path="$HOME/.config/my/file"

will not work, even if

    --sandbox-expose-path="$HOME/.var/app/com.example.App/config/my/file"

would.

Existing apps like GNOME Web (Epiphany) get away with this because the
files they are exposing are below $XDG_CONFIG_HOME, $XDG_DATA_HOME or
$XDG_CACHE_HOME, which take values below ~/.var/app, but the same is
not necessarily going to be true for apps like Steam that use --persist.

Signed-off-by: Simon McVittie <[email protected]>
@smcv
smcv force-pushed the path-to-handle branch from f868eda to 716ed74 Compare July 23, 2021 21:06
@smcv
smcv marked this pull request as draft July 23, 2021 21:14
@smcv
smcv force-pushed the path-to-handle branch from 716ed74 to 36aab81 Compare July 23, 2021 21:15
@smcv
smcv marked this pull request as ready for review July 23, 2021 21:16
@alexlarsson

Copy link
Copy Markdown
Member

LGTM

@alexlarsson
alexlarsson merged commit 8ab413d into flatpak:master Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants