Commit Graph

40 Commits (9989188a1ea7d49e218472cd2f64f0abb24b345e)

Author SHA1 Message Date
Matthias Clasen ed08538f92 Merge pull request #900 from pwithnall/lan-and-usb-preparation
LAN/USB preparation refactoring
2017-07-08 20:54:28 -04:00
Philip Withnall 81301f0ef4 general: Remove trailing \n from GLib log messages
The GLib logging framework automatically appends a \n to messages, so it
doesn’t need to be added by callers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-07 17:18:24 +01:00
Philip Withnall f47a696392 build: Add AM_* variables to all per-target special variables
For example, add $(AM_CFLAGS) to mumble_CFLAGS. Since $(WARN_CFLAGS) is
only added to $(AM_CFLAGS), this fixes the lack of inclusion of the
compiler warning flags in the compilation of half of flatpak.

Note that $(AM_*) variables are only used by automake if a more specific
(per-target) special variable is not defined instead. So if you define
mumble_CFLAGS, AM_CFLAGS will not be used for that target unless
explicitly included in mumble_CFLAGS.

See
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html.

Do the same for $(AM_LIBADD), $(AM_LDFLAGS), etc. These are not
currently defined, but it’s good practice to include them in
mumble_LIBADD (etc.) just in case they’re defined in future. Hopefully
their inclusions will be cargo-culted to any new targets which are
added, retaining full coverage of the code base.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Alexander Larsson bda7575e79 Add version property to all dbus interfaces 2017-05-19 14:38:22 +02:00
Alexander Larsson 4d2d07d033 Expose host /etc/hosts and /etc/host.conf
These are local network configuration, very much similar to
resolv.conf, so should also be exposed.

Fixes https://github.com/alexlarsson/spotify-app/issues/42
2017-05-04 13:08:25 +02:00
Owen W. Taylor 5f12c9e328 flatpak-session-helper.c: Make failure of TIOCSCTTY a g_debug()
Just because stdout/stderr happen to be going to a terminal doesn't
necessarily mean that we want the command launched by HostCommand
to take ownership of the terminal - in the case where 'flatpak run'
is launched from a terminal, stderr will typically be left pointing
to the terminal for any command. In that case the terminal already
has a controlling process, and TIOCSCTTY will fail; avoid scary
messages by making the failure only a g_debug()
2017-01-27 10:47:13 +01:00
Alexander Larsson b744cd2493 Add backport of g_autoptr support for json-glib 2016-11-29 10:14:33 +01:00
Alexander Larsson cecae8295c Fix build due to missing include 2016-11-11 11:15:00 +01:00
Christian Hergert b3489c3557 session-helper: use proper fd with ioctl() for tty setup
This was using the "from" fd from the fd_map, which will have already been
closed by time we reach this portion of the child setup.

Tracking the movement of FDs while resolving the remappings is rather
tedious and error prone, so just locate the final fd before calling
the ioctl() in child setup.
2016-09-15 21:38:06 -07:00
Alexander Larsson 8628ec938e HostCommand: Return actual PID
This is needed by e.g gnome-builder that want to pass this pid to
a profiler service. Its not really less secure/sandboxed this way,
because the app can launch whatever he wants in the host, which could
anyway talk back and report the real pid.
2016-09-14 10:03:15 +02:00
Christian Hergert bed5eb5863 session-helper: return after sending DBus error
Make sure we let the caller know we handled the message immediately after
sending our error reply.
2016-09-12 01:37:50 -07:00
Tobias Mueller 2422c386e2 flatpak-session-helper: Check for arg_argv being NULL
To prevent crashers like the following:

Starting program: /var/tmp/flatpak/libexec/flatpak-session-helper
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffed8a9700 (LWP 7893)]
[New Thread 0x7fffed0a8700 (LWP 7894)]
[New Thread 0x7fffec439700 (LWP 7895)]
session-helper/flatpak-session-helper.c:176:20: runtime error: load of null pointer of type 'const gchar'

Thread 1 "flatpak-session" received signal SIGSEGV, Segmentation fault.
0x000000000040d6ce in handle_host_command (object=0x62100001ab90,
    invocation=0x61d000014dc0, arg_cwd_path=0x0, arg_argv=0x602000003dd0,
    arg_fds=0x61900000b130, arg_envs=0x61900001d2a0, flags=1)
    at session-helper/flatpak-session-helper.c:176
176   if (*arg_argv[0] == 0)
(gdb)
2016-09-08 17:50:46 +02:00
Alexander Larsson 41443313ca session-helper: Move HostCommand to its own interface 2016-09-06 15:30:38 +02:00
Alexander Larsson c8df0e6208 SessionHelper: Add calls to spawn processes on the host
This lets any client, possibly in a sandbox if it has access to the
session helper, spawn a process on the host, outside any sandbox.

Clearly this is not something you typically want a sandboxed app to
do. However, it is sometimes very useful when using flatpak mainly
for distribution. For instance, an IDE needs to use this to launch a
flatpak build operation inside the sandbox. (Because otherwise recursive
calls to flatpak will not work.)
2016-09-05 21:41:14 +02:00
Alexander Larsson 0a20f28f89 session-helper: Add support for -r -v --help --version 2016-09-05 11:54:12 +02:00
Matthias Clasen 75218c4a65 Fix license headers
We were referring to the nonexisting "version 2" of the
Lesser GPL. It should be "version 2.1".
2016-07-29 14:27:49 -04:00
Alexander Larsson 28b549156a Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
2016-05-09 14:07:22 +02:00
Alexander Larsson 5e9b247d26 Migrate ~/.local/share/xdg-app to ~/.local/share/flatpak 2016-05-09 12:21:28 +02:00
Alexander Larsson 8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson ba37b22d78 Rename library to libflatpak 2016-05-09 09:46:26 +02:00
Alexander Larsson c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson 839e17abf0 session-helper: Forgot to remove some of the dead gresource code 2016-04-26 16:58:20 +02:00
Alexander Larsson 4f4b8c536b No need to put introspection xml in resources
This is already built in to the gdbus codegen code.
2016-04-26 11:54:59 +02:00
Simon McVittie 3d0a97099d session-helper: connect the D-Bus and systemd services
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-04-17 10:25:57 +01:00
Alexander Larsson 30a536f6dc Add change notification for the permissions store 2016-03-14 14:26:35 +01:00
Alexander Larsson 56872d1602 Never use gvfs in the session helper 2016-03-14 14:10:19 +01:00
Simon McVittie 9efe31e8d4 Add systemd user units corresponding to the D-Bus session services
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-28 23:45:47 +01:00
Simon McVittie 2f38ec6521 Rename xdg-app-session.service to the recommended name
Using the bus name as the name of the service file is mandatory
for system services, and recommended for session services.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-01-28 23:45:03 +01:00
Alexander Larsson 4177f358cb common: Make it explicit that XdgAppError are portal errors 2015-12-08 12:16:38 +01:00
Alexander Larsson 106a5b06ec Rename lib/ to common/ in preparation for public xdg-app library 2015-11-26 22:05:38 +01:00
Alexander Larsson 645c433960 Fix distcheck issues 2015-09-17 20:24:04 +02:00
Alexander Larsson 6775dc1002 Use g_auto(GStrv) instead of glnx_strfreev 2015-08-31 09:51:48 +02:00
Alexander Larsson 52525f46fd Remove ununsed variables reported by clang 2015-08-27 16:13:15 +02:00
Alexander Larsson a3f4342b5a Initial version of permission store
This is a generalized store for permissions, which also will
be used by the document portal.
2015-08-26 17:11:31 +02:00
Alexander Larsson ffa1acea75 Rename dbus file to org.freedesktop.XdgApp 2015-08-25 09:27:35 +02:00
Alexander Larsson 2238cc44c3 Change dbus name of session helper to org.freedesktop.XdgApp 2015-08-18 13:33:03 +02:00
Alexander Larsson 929071ad10 Import xdg-document-portal from github repo
This pulls in the daemon code from:
     https://github.com/alexlarsson/xdg-document-portal/

We need this in xdg-app because we need to set up the mounts correctly.
2015-07-10 16:56:39 +02:00
Alexander Larsson 302f88e69d Restructure directories and build
This moves a all source code into separate subdirs per binary. The
helper and the generic stuff goes into lib/ which is then used by all
the others. For now this is a completely internal library, but at
some point we will probably clean it up and expose some subset.

Also, we move the dbus proxy to libexecdir.
2015-07-10 12:15:45 +02:00