summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2018-05-02 15:31:20 +0200
committerBastien Nocera <hadess@hadess.net>2018-05-02 17:43:33 +0200
commitc8dc5bc0318293dbc9007946e92a10dba3a57d54 (patch)
treedc3e40224e5be0284d804990168e34063144be39
parenta5afe7a0ee971371423edaca4fdd43b9b7b05a1e (diff)
service-client: Verify 'DesktopId' against Flatpak ID
And refuse to serve applications that have different values for both. This makes it easier to detect applications which would lie about their IDs when run outside Flatpak, as well as making sure that settings are shared for Flatpak'ed and non-Flatpak'ed versions of the application. https://bugs.freedesktop.org/show_bug.cgi?id=97776
-rw-r--r--src/gclue-service-client.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gclue-service-client.c b/src/gclue-service-client.c
index 71e0dae..03219ad 100644
--- a/src/gclue-service-client.c
+++ b/src/gclue-service-client.c
@@ -486,6 +486,17 @@ gclue_service_client_handle_start (GClueDBusClient *client,
"'DesktopId' property must be set");
return TRUE;
}
+ } else {
+ const char *property;
+
+ property = gclue_dbus_client_get_desktop_id (client);
+ if (property != NULL && g_strcmp0 (property, desktop_id) != 0) {
+ g_dbus_method_invocation_return_error_literal (invocation,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_ACCESS_DENIED,
+ "'DesktopId' property does not match Flatpak information");
+ return TRUE;
+ }
}
config = gclue_config_get_singleton ();