363 Commits

Author SHA1 Message Date
Alexander Larsson
798f758969 Bump version to 0.2 0.2 2015-05-13 17:09:53 +02:00
Alexander Larsson
d4aeb5c10b Only warn if removing old commits fail 2015-05-13 17:07:24 +02:00
Alexander Larsson
c8d2df6ad1 xdg-app build: Bind mount host resolv.conf during builds
Its not totally unheard of to use network during builds, for
instance to download packages. This does so via a straight
(readonly) bind mount of the host version.

This is slightly different from what xdg-app run does, as
that relies on a full session and xdg-app-helper, but instead
that handles the config changing during runtime.
2015-05-13 16:36:59 +02:00
Alexander Larsson
d91f297362 build-init: Don't fail if /var/run already exists 2015-05-13 09:56:05 +02:00
Alexander Larsson
63cdb04cf6 metadata: Rename [Vars] to [Environment Vars]
This matches better the other full names used for the
metadata groups.
2015-05-12 14:49:15 +02:00
Alexander Larsson
5c3ea485c9 Support filtering of session bus
If the session bus is allowed we get unfiltered access to it, but if
it is not, then we install a filter with the policy specified by the
runtime and the app.

By default you can always own your app-id and wildcarded names below
it (i.e. org.gnome.gedit and org.gnome.gedit.*). On top of that we add
all the policies specified in the metadata for the runtime, and then
the metadata from the application.

The metadata policy config looks like this:

[Session Bus Policy]
ca.desrt.dconf=talk
org.gtk.*=see
org.my.name=own
2015-05-12 14:44:08 +02:00
Alexander Larsson
2e4d410bc6 More special casing of LD_LIBRARY_PATH
* Convert LD_LIBRARY_PATH in [Vars] to _LD_LIBRARY_PATH in the env
  so that its properly propagated.

* Always unset the regular LD_LIBRARY_PATH in the app if
  _LD_LIBRARY_PATH is unset.

* Always unset LD_LIBRARY_PATH as passed to the helper to
  avoid it getting some weird effect.
2015-05-12 12:06:07 +02:00
Alexander Larsson
6c99fcb832 builtin-run: Switch over to same env helpers 2015-05-12 11:39:43 +02:00
Alexander Larsson
4ef2ba28ff build: Apply runtime env vars 2015-05-12 11:39:43 +02:00
Alexander Larsson
80ea030fe5 Add xdg_app_run_apply_env_vars() helper 2015-05-12 11:39:43 +02:00
Alexander Larsson
11ec2f6895 build: Use an strv for envp instead of a GPtrArray 2015-05-12 11:39:43 +02:00
Alexander Larsson
6006f8d753 Move setting of env vars from helper to launcher
Some env vars (like LD_LIBRARY_PATH) was set by the helper, which
made it hard to override it. We instead set all these from the
launcher which gives us the same result but greater control.

For LD_LIBRARY_PATH in particular we pass it as _LD_LIBRARY_PATH
to avoid the env var affecting the helper.
2015-05-12 11:39:43 +02:00
Alexander Larsson
1eb08342d1 builtins-run: Use XdgAppDeploy 2015-05-12 11:39:43 +02:00
Alexander Larsson
a61ece1885 Add xdg_app_find_deploy_for_ref 2015-05-12 11:39:43 +02:00
Alexander Larsson
1a1f311d8a XdgAppDir: Add XdgAppDeploy helper object 2015-05-12 11:39:43 +02:00
Alexander Larsson
6939799fe2 proxy: Fix double-free of socket control messages 2015-05-12 10:56:53 +02:00
Alexander Larsson
042fee6a14 Add missing space 2015-05-11 13:07:20 +02:00
Alexander Larsson
48f5cf420d Merge pull request #71 from matthiasclasen/typo-fixes
Some typo fixes
2015-05-10 10:24:27 +02:00
Matthias Clasen
92c3de2320 Some typo fixes 2015-05-09 20:59:22 -04:00
Alexander Larsson
2eefff250b proxy: Update docs 2015-05-08 21:59:22 +02:00
Alexander Larsson
f7ac38066b proxy: Fully support policies for wildcarded names 2015-05-08 21:49:20 +02:00
Alexander Larsson
a68f74e1f5 Update docs wrt new ownership tracking code. 2015-05-08 16:32:43 +02:00
Alexander Larsson
7879cb3d8c proxy: Remove unneeded code for old name tracking
Now that we query name ownership up-front we don't need
the named destination or non-fake GetNameOwner reply tracking.
2015-05-08 16:31:48 +02:00
Alexander Larsson
766079a150 proxy: Send initial AddMatch and GetNameOwner to handle policy 2015-05-08 16:17:58 +02:00
Alexander Larsson
57a105b9a9 proxy: Free some members on finalize 2015-05-08 12:52:51 +02:00
Alexander Larsson
f412ac40a9 proxy: unlink socket on exit 2015-05-08 12:50:09 +02:00
Alexander Larsson
790fd7fefa proxy: Ensure that we SEE from peers we've gotten messages from 2015-05-08 12:35:47 +02:00
Alexander Larsson
15e5bc18b9 proxy: Don't forward method returns and errors with no reply_serial 2015-05-08 12:29:32 +02:00
Alexander Larsson
f672976462 xdg-app-proxy: Don't filter unicast signals
These are from the bus, so trusted, similar to method calls
but with no reply.
2015-05-08 12:25:42 +02:00
Alexander Larsson
4fbc1873e6 xdg-app-proxy: Large rewrite of docs comment 2015-05-08 11:52:24 +02:00
Alexander Larsson
fe2277526d xdg-app-proxy: Only allow pending replies from client 2015-05-07 22:04:31 +02:00
Alexander Larsson
b6e6b36cb4 xdg-app-proxy: Only allow replies from the bus that we requested 2015-05-07 22:04:31 +02:00
Alexander Larsson
43d44a4682 Clean up filtering and allow all messages from bus to client 2015-05-07 22:04:31 +02:00
Alexander Larsson
5c535342b9 xdg-app run: use a dbus proxy if needed
This runs a plain non-filtering dbus proxy if needed,
i.e. if the session or system bus are on a non-plain unix socket
address. This helps fix issues if the session socket is
an abstract unix socket, but mostly it sets the stage for
adding dbus filtering.
2015-05-07 22:04:31 +02:00
Alexander Larsson
3835a4d8ab xdg-app-helper: Add -S fd support
This just takes an fd and ensures it is passed down to the pid 1 of
the sandbox. This can be uses do sync something to the the lifetime of
the app.
2015-05-07 22:04:31 +02:00
Alexander Larsson
16251bbb63 Merge pull request #70 from danvratil/dev/fix-dir-export
Fix path generation when recursively exporting a directory
2015-05-07 14:48:39 +02:00
Dan Vrátil
0f53360959 Fix path generation when recursively exporting a directory
It is not guaranteed that source_relpath ends with '/', so g_strconcat()
would generate invalid path, like "share/icons/hicolor64x64/apps". Use
g_build_filename() instead to ensure we don't miss any separators.
2015-05-07 14:14:04 +02:00
Alexander Larsson
e2734654f8 xdg-dbus-proxy: Add support for syncing via fd
When we've listened to all sockets we write to the fd, and when
the other end of the fd is closed we exit. This can be used to
limit the lifetime of the proxy to the container.
2015-05-07 12:09:14 +02:00
Alexander Larsson
34d7c14394 Close any unexpectedly inherited fds in helper monitor and init. 2015-05-06 18:04:35 +02:00
Alexander Larsson
4e1856bed1 Merge pull request #69 from danvratil/dev/envvars
Don't leak environment variables into sandbox, except whitelisted ones
2015-05-06 17:54:22 +02:00
Dan Vrátil
0a76e872df Report error when --var option is missing '=' 2015-05-06 17:47:56 +02:00
Dan Vrátil
63e4e822f2 Actually unset the env variable when the value is empty 2015-05-06 17:47:56 +02:00
Dan Vrátil
23259c2582 Ignore errors in add_env_overrides() 2015-05-06 17:47:56 +02:00
Dan Vrátil
f035cbef48 Don't clear the [Vars] group in build-finish command and improve error reporting 2015-05-06 17:47:51 +02:00
Dan Vrátil
69d50fa9f9 Allow runtime and apps to override environment variables
Sometimes it's necessary to override environment variables coming from
outside the sandbox in order to point to the right places in the sandbox
(like QT_PLUGIN_PATH pointing to /self/lib/qt5/plugins).

To do so, runtimes and applications can add ENV=VALUE entries into [Vars]
section in their metadata files. Specifying an empty value is also possible,
which will effectively unset the variable.
2015-05-06 15:57:57 +02:00
Alexander Larsson
5f6ebafb75 Only print headers when logging 2015-05-06 15:04:47 +02:00
Alexander Larsson
01bd1a3dfd Make xdg-dbus-proxy talk command line args and install it 2015-05-06 15:01:55 +02:00
Alexander Larsson
7183917583 Break out dbus proxy implementation to separate file 2015-05-06 12:38:52 +02:00
Alexander Larsson
c0dca8dee4 dbus-proxy: Add some test policy 2015-05-05 17:23:58 +02:00
Alexander Larsson
564ba32250 Better handling of fd passing 2015-05-05 17:23:58 +02:00