diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2021-02-20 21:50:33 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2021-02-20 23:29:57 +0100 |
commit | 0407d687bfbb27c06ba0666df5dc944b3dc6b64b (patch) | |
tree | 8ae3990b5ddcc9d967efa60941b8886d5ca308e1 /src/portal | |
parent | 9802504b16ee1a8bb94ba9ecc6e95fca54b0db6d (diff) | |
download | tracker-0407d687bfbb27c06ba0666df5dc944b3dc6b64b.tar.gz |
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.
Diffstat (limited to 'src/portal')
-rw-r--r-- | src/portal/tracker-portal-endpoint.c | 20 |
1 files changed, 20 insertions, 0 deletions
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); } } |