Commit Graph

14 Commits

Author SHA1 Message Date
Alexander Larsson
94ce9da571 dir: Fix saving of features in metadata
This fixes https://github.com/flatpak/flatpak/issues/1617
2018-04-30 14:33:38 +02:00
Sam Spilsbury
b0b8f55ecb run: Export flatpak_context_get_session_bus_policy_allowed_own_names
We will use this later to work out which .service files we can export
based on names that we are allowed to own.

Closes: #1589
Approved by: alexlarsson
2018-04-19 07:31:25 +00:00
Alexander Larsson
a6ec434aed run: Escape : as \: in --filesystem= paths
This way we never get confused about which part of the argument
is the permission suffix, which could be exploitable if you can
control the --filesystem calls such as with sandboxed Spawns.
2018-04-04 17:25:59 +02:00
Alexander Larsson
74c4006dbe run: Add --sandbox
This runs the app in a very tight sandbox, with no access to anything
except /app and /run and some read-only host things like fonts and icons.

You can additionally add explicit permissions on the commandline,
like --share=network to actually grant some access.

This also sets $FLATPAK_SANDBOX_DIR to ~/.var/app/$appid/sandbox in the
environment.
2018-04-04 17:25:59 +02:00
Alexander Larsson
b66243e26d Fix --file-forwarding
flatpak_context_append_bwrap_filesystem() didn't actually return the
exports so callers crashed dereferencing NULL.

This fixes https://github.com/flatpak/flatpak/issues/1428
2018-02-19 14:18:12 +01:00
Alexander Larsson
195976a1b8 Fix persisted directories on atomic
On atomic /home is a symlink to /var/home, so when we bind-mount
the persistent directories we need to early-resolve the symlinks
to avoid running into issues with /newroot.

In most cases we do this already by calling flatpak_bwrap_add_bind_arg,
but the persistent dir case did not, because that function required
the target to exist, and the persistent directoried might not.
However, these days flatpak_bwrap_add_bind_arg is fine if the base
dir doesn't exists but the target does, which is the case here,
so we can use it now.

This fixes e.g. steam: https://github.com/flatpak/flatpak/issues/1278

Closes: #1422
Approved by: cgwalters
2018-02-15 13:02:02 +00:00
Alexander Larsson
f33fac310c Add fallback-x11 socket permission
This means use x11 if no alternative is present, and should be used
for applications that support both X11 and wayland, but want to be
sandboxed when running under a wayland compositor (but still want to
run under an X server).

Closes: #1416
Approved by: alexlarsson
2018-02-14 09:19:56 +00:00
Alexander Larsson
f2a6c1db8d Remove document portal
This is now in xdg-desktop-portal. We keep a version of the document
portal dbus XML so that we avoid weird build dependencies.

Flatpak itself is technically not dependent on the document portal,
but it is very much recommended that you use it.

Closes: #1398
Approved by: alexlarsson
2018-02-09 09:23:26 +00:00
Alexander Larsson
3b1b9c65cd Move chunk of filesystem setup from flatpak-run.c to FlatpakContext
This way the filesystem setup is centralized in one place.

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
38e2a5decc Rename some FlatpakContext functions
Since flatpak_export_paths_export_context and flatpak_exports_from_context
are now in flatpak-context.c we make them begin with flatpak_context_

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
01156880dc Move flatpak_export_paths_export_context & flatpak_exports_from_context
These make more sense in flatpak-context.c, as they touch its FlatpakContext

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
58b25843b5 Add and use flatpak_context_allows_features
This lets us avoid directly dereferencing FlatpakContext

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
6296987a45 Move dbus filter argument generation to flatpak-context
Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
447a8d0537 Extract FlatpakContext to a separate file
This is basically a code motion only, no changes to behaviour.

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00