From 0407d687bfbb27c06ba0666df5dc944b3dc6b64b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 20 Feb 2021 21:50:33 +0100 Subject: portal: Expand allowed graphs to full URIs for notifier filtering We get fully expanded graph names from TrackerNotifier events, but we allow prefixed names in flatpak rules. Expand the latter so we match both, as a last resort. This fixes propagation of changes from these graphs to the sandboxed applications. --- src/portal/tracker-portal-endpoint.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/portal') diff --git a/src/portal/tracker-portal-endpoint.c b/src/portal/tracker-portal-endpoint.c index c1d26bb83..79028a1b6 100644 --- a/src/portal/tracker-portal-endpoint.c +++ b/src/portal/tracker-portal-endpoint.c @@ -92,6 +92,26 @@ tracker_portal_endpoint_filter_graph (TrackerEndpointDBus *endpoint_dbus, return FALSE; } else if (g_strcmp0 (graph_name, endpoint->graphs[i]) == 0) { return FALSE; + } else { + TrackerNamespaceManager *namespaces; + gchar *expanded; + + /* We may have been given a prefixed name instead of an + * URI, expand it in order to check with the given graph. + * + * FIXME: This is not going to work for prefixes outside + * the well-known namespaces. + */ + namespaces = tracker_namespace_manager_get_default (); + expanded = tracker_namespace_manager_expand_uri (namespaces, + endpoint->graphs[i]); + + if (g_strcmp0 (graph_name, expanded) == 0) { + g_free (expanded); + return FALSE; + } + + g_free (expanded); } } -- cgit v1.2.1