Hello community, here is the log from the commit of package xdg-app for openSUSE:Factory checked in at 2015-03-30 19:13:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xdg-app (Old) and /work/SRC/openSUSE:Factory/.xdg-app.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xdg-app" Changes: -------- --- /work/SRC/openSUSE:Factory/xdg-app/xdg-app.changes 2015-03-11 09:56:50.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.xdg-app.new/xdg-app.changes 2015-03-30 19:13:18.000000000 +0200 @@ -1,0 +2,16 @@ +Fri Mar 06 11:53:38 UTC 2015 - [email protected] + +- Update to version 0.0.1~20150305: + + Fix warning in add-remote if no summary. + + Look for libcap pkg-config file for cflags to ensure we have + the headers. + + Revert "Look for libcap pkg-config file for cflags to ensure we + have the headers". + + Check for sys/capability.h via AC_CHECK_HEADER instead. + + Run each app in a custom systemd user scope (if available). + + xdg-app-helper: Flesh out usage output. + + xdg-app-helper: Sort the command line parsing. + + Mount /run/media if mount-host-fs. + + Add metadata option to limit DRI access. + +------------------------------------------------------------------- Old: ---- xdg-app-0.0.1~20150219.tar.xz New: ---- xdg-app-0.0.1~20150305.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xdg-app.spec ++++++ --- /var/tmp/diff_new_pack.d6DGSa/_old 2015-03-30 19:13:19.000000000 +0200 +++ /var/tmp/diff_new_pack.d6DGSa/_new 2015-03-30 19:13:19.000000000 +0200 @@ -1,7 +1,6 @@ # # spec file for package xdg-app # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties @@ -18,7 +17,7 @@ Name: xdg-app -Version: 0.0.1~20150219 +Version: 0.0.1~20150305 Release: 0 Summary: Manage OSTree based application bundles License: LGPL-2.1+ @@ -61,3 +60,4 @@ %{_mandir}/man1/xdg-app* %{_datadir}/%{name}/ +%changelog ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.d6DGSa/_old 2015-03-30 19:13:19.000000000 +0200 +++ /var/tmp/diff_new_pack.d6DGSa/_new 2015-03-30 19:13:19.000000000 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/alexlarsson/xdg-app.git</param> - <param name="changesrevision">471cdba23e0d11320282b4112a62dc6e948726b3</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">5bfee405b17d9b5cc7133d17b44a7a27e1b5b69c</param></service></servicedata> \ No newline at end of file ++++++ xdg-app-0.0.1~20150219.tar.xz -> xdg-app-0.0.1~20150305.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/Makefile.am new/xdg-app-0.0.1~20150305/Makefile.am --- old/xdg-app-0.0.1~20150219/Makefile.am 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/Makefile.am 2015-03-06 12:53:37.000000000 +0100 @@ -31,7 +31,8 @@ xdg_app_helper_SOURCES = xdg-app-helper.c dbus_built_sources = xdg-app-dbus.c xdg-app-dbus.h -BUILT_SOURCES = $(dbus_built_sources) +systemd_dbus_built_sources = xdg-app-systemd-dbus.c xdg-app-systemd-dbus.h +BUILT_SOURCES = $(dbus_built_sources) $(systemd_dbus_built_sources) $(dbus_built_sources) : Makefile.am xdg-app-dbus-interfaces.xml $(AM_V_GEN) $(GDBUS_CODEGEN) \ @@ -41,6 +42,14 @@ $(srcdir)/xdg-app-dbus-interfaces.xml \ $(NULL) +$(systemd_dbus_built_sources) : Makefile.am org.freedesktop.systemd1.xml + $(AM_V_GEN) $(GDBUS_CODEGEN) \ + --interface-prefix org.freedesktop.systemd1. \ + --c-namespace Systemd \ + --generate-c-code xdg-app-systemd-dbus \ + $(srcdir)/org.freedesktop.systemd1.xml \ + $(NULL) + resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/xdg-app.gresource.xml) xdg-app-resources.h: xdg-app.gresource.xml @@ -92,6 +101,7 @@ xdg-app-run.h \ xdg-app-utils.h \ xdg-app-utils.c \ + $(systemd_dbus_built_sources) \ $(dbus_built_sources) \ $(NULL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/completion/xdg-app new/xdg-app-0.0.1~20150305/completion/xdg-app --- old/xdg-app-0.0.1~20150219/completion/xdg-app 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/completion/xdg-app 2015-03-06 12:53:37.000000000 +0100 @@ -56,7 +56,7 @@ comps=$(xdg-app $mode list-runtimes) ;; --allow|--forbid) - comps='x11 wayland ipc pulseaudio system-dbus session-dbus network host-fs homedir' + comps='x11 wayland ipc pulseaudio system-dbus session-dbus network host-fs homedir dri' ;; --branch|--subject|--body|--title) comps='' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/configure.ac new/xdg-app-0.0.1~20150305/configure.ac --- old/xdg-app-0.0.1~20150219/configure.ac 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/configure.ac 2015-03-06 12:53:37.000000000 +0100 @@ -34,6 +34,7 @@ DBUS_SERVICE_DIR=$with_dbus_service_dir AC_SUBST(DBUS_SERVICE_DIR) +AC_CHECK_HEADER([sys/capability.h], have_caps=yes, AC_MSG_ERROR([sys/capability.h header not found])) AC_SUBST([GLIB_COMPILE_RESOURCES], [`$PKG_CONFIG --variable glib_compile_resources gio-2.0`]) AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/doc/xdg-app-build-finish.xml new/xdg-app-0.0.1~20150305/doc/xdg-app-build-finish.xml --- old/xdg-app-0.0.1~20150219/doc/xdg-app-build-finish.xml 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/doc/xdg-app-build-finish.xml 2015-03-06 12:53:37.000000000 +0100 @@ -92,7 +92,7 @@ <listitem><para> Set the KEY in the [Environment] group to true. KEY must be one of: x11, wayland, ipc, pulseaudio, system-dbus, - session-dbus, network, host-fs, homedir. + session-dbus, network, host-fs, homedir, dri. This option can be used multiple times. </para></listitem> </varlistentry> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/doc/xdg-app-build.xml new/xdg-app-0.0.1~20150305/doc/xdg-app-build.xml --- old/xdg-app-0.0.1~20150219/doc/xdg-app-build.xml 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/doc/xdg-app-build.xml 2015-03-06 12:53:37.000000000 +0100 @@ -85,7 +85,7 @@ Allow access to the named facility. This overrides the Environment section from the application metadata. KEY must be one of: x11, wayland, ipc, pulseaudio, system-dbus, - session-dbus, network, host-fs, homedir. + session-dbus, network, host-fs, homedir, dri. This option can be used multiple times. </para></listitem> </varlistentry> @@ -98,7 +98,7 @@ Environment section from the application metadata and --allow options to this command. KEY must be one of: x11, wayland, ipc, pulseaudio, system-dbus, - session-dbus, network, host-fs, homedir. + session-dbus, network, host-fs, homedir, dri. This option can be used multiple times. </para></listitem> </varlistentry> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/doc/xdg-app-run.xml new/xdg-app-0.0.1~20150305/doc/xdg-app-run.xml --- old/xdg-app-0.0.1~20150219/doc/xdg-app-run.xml 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/doc/xdg-app-run.xml 2015-03-06 12:53:37.000000000 +0100 @@ -123,7 +123,7 @@ Allow access to the named facility. This overrides the Environment section from the application metadata. KEY must be one of: x11, wayland, ipc, pulseaudio, system-dbus, - session-dbus, network, host-fs, homedir. + session-dbus, network, host-fs, homedir, dri. This option can be used multiple times. </para></listitem> </varlistentry> @@ -136,7 +136,7 @@ Environment section from the application metadata and --allow options to this command. KEY must be one of: x11, wayland, ipc, pulseaudio, system-dbus, - session-dbus, network, host-fs, homedir. + session-dbus, network, host-fs, homedir, dri. This option can be used multiple times. </para></listitem> </varlistentry> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/org.freedesktop.systemd1.xml new/xdg-app-0.0.1~20150305/org.freedesktop.systemd1.xml --- old/xdg-app-0.0.1~20150219/org.freedesktop.systemd1.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/org.freedesktop.systemd1.xml 2015-03-06 12:53:37.000000000 +0100 @@ -0,0 +1,19 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" +"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.freedesktop.systemd1.Manager"> + <method name="StartTransientUnit"> + <arg type="s" direction="in" name="name"/> + <arg type="s" direction="in" name="mode"/> + <arg type="a(sv)" direction="in" name="properties"/> + <arg type="a(sa(sv))" direction="in" name="aux"/> + <arg type="o" direction="out" name="job"/> + </method> + <signal name="JobRemoved"> + <arg type="u" name="id"/> + <arg type="o" name="job"/> + <arg type="s" name="unit"/> + <arg type="s" name="result"/> + </signal> + </interface> +</node> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/xdg-app-builtins-build-finish.c new/xdg-app-0.0.1~20150305/xdg-app-builtins-build-finish.c --- old/xdg-app-0.0.1~20150219/xdg-app-builtins-build-finish.c 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/xdg-app-builtins-build-finish.c 2015-03-06 12:53:37.000000000 +0100 @@ -101,7 +101,7 @@ GError *temp_error = NULL; const char *environment_keys[] = { "x11", "wayland", "ipc", "pulseaudio", "system-dbus", "session-dbus", - "network", "host-fs", "homedir", NULL + "network", "host-fs", "homedir", "dri", NULL }; const char *key; int i; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/xdg-app-builtins-run.c new/xdg-app-0.0.1~20150305/xdg-app-builtins-run.c --- old/xdg-app-0.0.1~20150219/xdg-app-builtins-run.c 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/xdg-app-builtins-run.c 2015-03-06 12:53:37.000000000 +0100 @@ -117,7 +117,6 @@ return ret; } - gboolean xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **error) { @@ -315,6 +314,8 @@ g_setenv ("XDG_CONFIG_HOME", gs_file_get_path_cached (app_id_dir_config), TRUE); g_setenv ("XDG_CACHE_HOME", gs_file_get_path_cached (app_id_dir_cache), TRUE); + xdg_app_run_in_transient_unit (app); + if (execv (HELPER, (char **)argv_array->pdata) == -1) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Unable to start app"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/xdg-app-helper.c new/xdg-app-0.0.1~20150305/xdg-app-helper.c --- old/xdg-app-0.0.1~20150219/xdg-app-helper.c 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/xdg-app-helper.c 2015-03-06 12:53:37.000000000 +0100 @@ -232,7 +232,32 @@ void usage (char **argv) { - fprintf (stderr, "usage: %s [-n] [-i] [-p <pulsaudio socket>] [-x X11 socket] [-y Wayland socket] [-w] [-W] [-E] [-l] [-m <path to monitor dir>] [-a <path to app>] [-v <path to var>] [-I <app id>] [-b <target-dir>=<src-dir>] <path to runtime> <command..>\n", argv[0]); + fprintf (stderr, "usage: %s [OPTIONS...] RUNTIMEPATH COMMAND [ARGS...]\n\n", argv[0]); + + fprintf (stderr, + " -a Specify path for application (mounted at /self)\n" + " -b SOURCE=DEST Bind extra source directory into DEST (must be in /usr or /self)\n" + " -d SOCKETPATH Use SOCKETPATH as dbus session bus\n" + " -D SOCKETPATH Use SOCKETPATH as dbus system bus\n" + " -e Make /self/exports writable\n" + " -E Make /etc a pure symlink to /usr/etc\n" + " -f Mount the host filesystems\n" + " -g Allow use of direct rendering graphics\n" + " -F Mount the host filesystems read-only\n" + " -H Mount the users home directory (implied by -f)\n" + " -i Share IPC namespace with session\n" + " -I APPID Set app id (used to find app data)\n" + " -l Lock .ref files in all mounts\n" + " -m PATH Set path to xdg-app-session-helper output\n" + " -n Share network namespace with session\n" + " -p SOCKETPATH Use SOCKETPATH as pulseaudio connection\n" + " -s Share Shm namespace with session\n" + " -v PATH Mount PATH as /var\n" + " -w Make /self writable\n" + " -W Make /usr writable\n" + " -x SOCKETPATH Use SOCKETPATH as X display\n" + " -y SOCKETPATH Use SOCKETPATH as Wayland display\n" + ); exit (1); } @@ -293,6 +318,7 @@ static bool create_etc_symlink = FALSE; static bool create_etc_dir = TRUE; static bool create_monitor_links = FALSE; +static bool allow_dri = FALSE; static const create_table_t create[] = { { FILE_TYPE_DIR, ".oldroot", 0755 }, @@ -301,6 +327,7 @@ { FILE_TYPE_DIR, "self", 0755}, { FILE_TYPE_DIR, "run", 0755}, { FILE_TYPE_DIR, "run/dbus", 0755}, + { FILE_TYPE_DIR, "run/media", 0755}, { FILE_TYPE_DIR, "run/user", 0755}, { FILE_TYPE_DIR, "run/user/%1$d", 0700, NULL}, { FILE_TYPE_DIR, "run/user/%1$d/pulse", 0700, NULL}, @@ -344,7 +371,7 @@ { FILE_TYPE_DEVICE, "dev/urandom", 0666}, { FILE_TYPE_DEVICE, "dev/tty", 0666}, { FILE_TYPE_DIR, "dev/dri", 0755}, - { FILE_TYPE_BIND_RO, "dev/dri", 0755, "/dev/dri", FILE_FLAGS_NON_FATAL|FILE_FLAGS_DEVICES}, + { FILE_TYPE_BIND_RO, "dev/dri", 0755, "/dev/dri", FILE_FLAGS_NON_FATAL|FILE_FLAGS_DEVICES, &allow_dri}, { FILE_TYPE_REMOUNT, "dev", MS_RDONLY|MS_NOSUID|MS_NOEXEC}, }; @@ -1194,24 +1221,40 @@ if (prctl (PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0) die_with_error ("prctl(PR_SET_NO_NEW_CAPS) failed"); - while ((c = getopt (argc, argv, "+inWweEsfFHa:m:b:p:x:ly:d:D:v:I:")) >= 0) + while ((c = getopt (argc, argv, "+inWweEsfFHa:m:b:p:x:ly:d:D:v:I:g")) >= 0) { switch (c) { - case 'i': - ipc = TRUE; + case 'a': + app_path = optarg; break; - case 'n': - network = TRUE; + case 'b': + tmp = strchr (optarg, '='); + if (tmp == NULL || tmp[1] == 0) + usage (argv); + *tmp = 0; + tmp = tmp + 1; + + if (n_extra_dirs == MAX_EXTRA_DIRS) + die ("Too many extra directories"); + + if (strncmp (optarg, "/usr/", strlen ("/usr/")) != 0 && + strncmp (optarg, "/self/", strlen ("/self/")) != 0) + die ("Extra directories must be in /usr or /self"); + + extra_dirs_dest[n_extra_dirs] = optarg + 1; + extra_dirs_src[n_extra_dirs] = tmp; + + n_extra_dirs++; break; - case 'W': - writable = TRUE; + case 'd': + session_dbus_socket = optarg; break; - case 'w': - writable_app = TRUE; + case 'D': + system_dbus_socket = optarg; break; case 'e': @@ -1223,10 +1266,6 @@ create_etc_dir = FALSE; break; - case 's': - share_shm = TRUE; - break; - case 'f': mount_host_fs = TRUE; break; @@ -1236,72 +1275,64 @@ mount_host_fs_ro = TRUE; break; + case 'g': + allow_dri = TRUE; + break; + case 'H': mount_home = TRUE; break; - case 'a': - app_path = optarg; + case 'i': + ipc = TRUE; break; - case 'm': - monitor_path = optarg; + case 'I': + app_id = optarg; break; - case 'b': - tmp = strchr (optarg, '='); - if (tmp == NULL || tmp[1] == 0) - usage (argv); - *tmp = 0; - tmp = tmp + 1; - - if (n_extra_dirs == MAX_EXTRA_DIRS) - die ("Too many extra directories"); - - if (strncmp (optarg, "/usr/", strlen ("/usr/")) != 0 && - strncmp (optarg, "/self/", strlen ("/self/")) != 0) - die ("Extra directories must be in /usr or /self"); + case 'l': + lock_files = TRUE; + break; - extra_dirs_dest[n_extra_dirs] = optarg + 1; - extra_dirs_src[n_extra_dirs] = tmp; + case 'm': + monitor_path = optarg; + break; - n_extra_dirs++; + case 'n': + network = TRUE; break; case 'p': pulseaudio_socket = optarg; break; - case 'x': - x11_socket = optarg; - break; - - case 'l': - lock_files = TRUE; + case 's': + share_shm = TRUE; break; - case 'y': - wayland_socket = optarg; + case 'v': + var_path = optarg; break; - case 'd': - session_dbus_socket = optarg; + case 'w': + writable_app = TRUE; break; - case 'D': - system_dbus_socket = optarg; + case 'W': + writable = TRUE; break; - case 'v': - var_path = optarg; + case 'x': + x11_socket = optarg; break; - case 'I': - app_id = optarg; + case 'y': + wayland_socket = optarg; break; - default: /* '?' */ - usage (argv); + default: /* '?' */ + usage (argv); } } @@ -1529,7 +1560,10 @@ } if (mount_host_fs) - mount_extra_root_dirs (mount_host_fs_ro); + { + mount_extra_root_dirs (mount_host_fs_ro); + bind_mount ("/run/media", "run/media", BIND_RECURSIVE | (mount_host_fs_ro ? BIND_READONLY : 0)); + } if (!mount_host_fs) create_homedir (mount_home, app_id); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/xdg-app-run.c new/xdg-app-0.0.1~20150305/xdg-app-run.c --- old/xdg-app-0.0.1~20150219/xdg-app-run.c 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/xdg-app-run.c 2015-03-06 12:53:37.000000000 +0100 @@ -3,12 +3,14 @@ #include <string.h> #include <fcntl.h> #include <stdio.h> +#include <unistd.h> #include <gio/gio.h> #include "libgsystem.h" #include "xdg-app-run.h" #include "xdg-app-utils.h" +#include "xdg-app-systemd-dbus.h" gboolean xdg_app_run_verify_environment_keys (const char **keys, @@ -17,7 +19,7 @@ const char *key; const char *environment_keys[] = { "x11", "wayland", "ipc", "pulseaudio", "system-dbus", "session-dbus", - "network", "host-fs", "homedir", NULL + "network", "host-fs", "homedir", "dri", NULL }; if (keys == NULL) @@ -163,6 +165,13 @@ opts[i++] = 'i'; } + if ((g_key_file_get_boolean (metakey, "Environment", "dri", NULL) || g_strv_contains (allow, "dri")) && + !g_strv_contains (forbid, "dri")) + { + g_debug ("Allowing dri access"); + opts[i++] = 'g'; + } + if ((g_key_file_get_boolean (metakey, "Environment", "host-fs", NULL) || g_strv_contains (allow, "nost-fs")) && !g_strv_contains (forbid, "host-fs")) { @@ -335,3 +344,126 @@ return g_object_ref (dir); } + +struct JobData { + char *job; + GMainLoop *main_loop; +}; + +static void +job_removed_cb (SystemdManager *manager, + guint32 id, + char *job, + char *unit, + char *result, + struct JobData *data) +{ + if (strcmp (job, data->job) == 0) + g_main_loop_quit (data->main_loop); +} + +void +xdg_app_run_in_transient_unit (const char *appid) +{ + GDBusConnection *conn = NULL; + GError *error = NULL; + char *path = NULL; + char *address = NULL; + char *name = NULL; + char *job = NULL; + SystemdManager *manager = NULL; + GVariantBuilder builder; + GVariant *properties = NULL; + GVariant *aux = NULL; + guint32 pid; + GMainContext *main_context = NULL; + GMainLoop *main_loop = NULL; + struct JobData data; + + path = g_strdup_printf ("/run/user/%d/systemd/private", getuid()); + + if (!g_file_test (path, G_FILE_TEST_EXISTS)) + goto out; + + main_context = g_main_context_new (); + main_loop = g_main_loop_new (main_context, FALSE); + + g_main_context_push_thread_default (main_context); + + + address = g_strconcat ("unix:path=", path, NULL); + + conn = g_dbus_connection_new_for_address_sync (address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, + NULL, &error); + if (!conn) + { + g_warning ("Can't connect to systemd: %s\n", error->message); + goto out; + } + + manager = systemd_manager_proxy_new_sync (conn, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, + NULL, + "/org/freedesktop/systemd1", + NULL, &error); + if (!manager) + { + g_warning ("Can't create manager proxy: %s\n", error->message); + goto out; + } + + name = g_strdup_printf ("xdg-app-%s-%d.scope", appid, getpid()); + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(sv)")); + + pid = getpid (); + g_variant_builder_add (&builder, "(sv)", + "PIDs", + g_variant_new_fixed_array (G_VARIANT_TYPE ("u"), + &pid, 1, sizeof (guint32)) + ); + + properties = g_variant_builder_end (&builder); + + aux = g_variant_new_array (G_VARIANT_TYPE ("(sa(sv))"), NULL, 0); + + if (!systemd_manager_call_start_transient_unit_sync (manager, + name, + "fail", + properties, + aux, + &job, + NULL, + &error)) + { + g_warning ("Can't start transient unit: %s\n", error->message); + goto out; + } + + data.job = job; + data.main_loop = main_loop; + g_signal_connect (manager,"job-removed", G_CALLBACK (job_removed_cb), &data); + + g_main_loop_run (main_loop); + + out: + if (main_context) + { + g_main_context_pop_thread_default (main_context); + g_main_context_unref (main_context); + } + if (main_loop) + g_main_loop_unref (main_loop); + if (error) + g_error_free (error); + if (manager) + g_object_unref (manager); + if (conn) + g_object_unref (conn); + g_free (path); + g_free (address); + g_free (job); + g_free (name); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/xdg-app-run.h new/xdg-app-0.0.1~20150305/xdg-app-run.h --- old/xdg-app-0.0.1~20150219/xdg-app-run.h 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/xdg-app-run.h 2015-03-06 12:53:37.000000000 +0100 @@ -1,6 +1,8 @@ #ifndef __XDG_APP_RUN_H__ #define __XDG_APP_RUN_H__ +void xdg_app_run_in_transient_unit (const char *app_id); + gboolean xdg_app_run_verify_environment_keys (const char **keys, GError **error); void xdg_app_run_add_environment_args (GPtrArray *argv_array, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-app-0.0.1~20150219/xdg-app-utils.c new/xdg-app-0.0.1~20150305/xdg-app-utils.c --- old/xdg-app-0.0.1~20150219/xdg-app-utils.c 2015-02-25 12:08:01.000000000 +0100 +++ new/xdg-app-0.0.1~20150305/xdg-app-utils.c 2015-03-06 12:53:37.000000000 +0100 @@ -582,6 +582,8 @@ gs_unref_hashtable GHashTable *local_refs = NULL; gs_free char *local_title = NULL; + local_refs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + summary_url = g_build_filename (repository_url, "summary", NULL); if (load_contents (summary_url, &bytes, cancellable, NULL)) { @@ -591,8 +593,6 @@ GVariantDict dict; int i, n; - local_refs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - summary = g_variant_new_from_bytes (OSTREE_SUMMARY_GVARIANT_FORMAT, bytes, FALSE); ref_list = g_variant_get_child_value (summary, 0); extensions = g_variant_get_child_value (summary, 1);
