summaryrefslogtreecommitdiff
path: root/src/portal
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-01-24 17:59:40 +0100
committerCarlos Garnacho <carlosg@gnome.org>2020-07-17 13:41:03 +0200
commit54f4281683c5a4ceaf307d9bc0e5a8583f7fc1ce (patch)
tree37945e75ee784d499a25f9c7053c2d58b6fbd8d2 /src/portal
parentaa3e994545c242a2d608c6ee0213bd456b85232b (diff)
downloadtracker-54f4281683c5a4ceaf307d9bc0e5a8583f7fc1ce.tar.gz
portal: Handle missing .flatpak-info file
The helper function may return NULL keyfile and no error if the .flatpak-info file does not exist. If that is the case, there is good chance we are talking with a client outside a sandbox. Still be overly restrictive and allow access to an empty set of graphs, the client shouldn't be talking to the portal in that case.
Diffstat (limited to 'src/portal')
-rw-r--r--src/portal/tracker-portal.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/portal/tracker-portal.c b/src/portal/tracker-portal.c
index 08a9234a7..02098756c 100644
--- a/src/portal/tracker-portal.c
+++ b/src/portal/tracker-portal.c
@@ -200,13 +200,23 @@ load_client_configuration (GDBusMethodInvocation *invocation,
GError **error)
{
g_autoptr (GKeyFile) flatpak_info = NULL;
+ GError *inner_error = NULL;
GStrv graphs;
flatpak_info = tracker_invocation_lookup_app_info_sync (invocation,
- NULL, error);
+ NULL, &inner_error);
if (!flatpak_info) {
- g_debug ("No .flatpak-info found, forbidden access.");
- return NULL;
+ GStrv default_graphs = { NULL };
+
+ if (inner_error) {
+ g_warning ("Error reading .flatpak-info.");
+ g_propagate_error (error, inner_error);
+ return NULL;
+ }
+
+ g_debug ("No .flatpak-info found, peer is not sandboxed");
+ /* Still, fishy. Allow access to no graphs */
+ return g_strdupv (default_graphs);
}
graphs = g_key_file_get_string_list (flatpak_info,