Commit 3638bd75 authored by Laurent Bigonville's avatar Laurent Bigonville
Browse files

Check the maximum allowed accuracy level even for system applications

Respect the value of the user preference concerning the usage of their
geolocation. This should fix the privacy and GDPR conformity concerns as
the user explicitly needs to enable the option.

Note that there is no distinction between the system applications
anymore, turning on the option is allowing them all to get the location.

Closes: #924516 #958497
Gbp-Dch: Full
parent aed31082
From: Laurent Bigonville <bigon@bigon.be>
Date: Fri, 23 Oct 2020 21:37:12 +0200
Subject: service: Check the maximum allowed accuracy level even for system
apps
We need to check the maximum allowed accuracy even for system apps
otherwise the user cannot disable the geolocalization for these
(max_accuracy set to 0)
Fix: https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/111
---
src/gclue-service-client.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/gclue-service-client.c b/src/gclue-service-client.c
index 247fdb6..62ea932 100644
--- a/src/gclue-service-client.c
+++ b/src/gclue-service-client.c
@@ -447,6 +447,7 @@ handle_post_agent_check_auth (StartData *data)
GClueConfig *config;
GClueAppPerm app_perm;
guint32 uid;
+ gboolean system_app;
uid = gclue_client_info_get_user_id (priv->client_info);
max_accuracy = gclue_agent_get_max_accuracy_level (priv->agent_proxy);
@@ -471,8 +472,11 @@ handle_post_agent_check_auth (StartData *data)
app_perm = gclue_config_get_app_perm (config,
data->desktop_id,
priv->client_info);
+ system_app = (gclue_client_info_get_xdg_id (priv->client_info) == NULL);
- if (app_perm == GCLUE_APP_PERM_ALLOWED) {
+ if (app_perm == GCLUE_APP_PERM_ALLOWED || system_app) {
+ /* Since we have no reliable way to identify system apps, no
+ * need for auth for them. */
complete_start (data);
return;
}
@@ -556,7 +560,6 @@ gclue_service_client_handle_start (GClueDBusClient *client,
const char *desktop_id;
GClueAppPerm app_perm;
guint32 uid;
- gboolean system_app = FALSE;
if (priv->locator != NULL) {
/* Already started */
@@ -569,7 +572,6 @@ gclue_service_client_handle_start (GClueDBusClient *client,
if (desktop_id == NULL) {
/* Non-xdg app */
desktop_id = gclue_dbus_client_get_desktop_id (client);
- system_app = TRUE;
}
if (desktop_id == NULL) {
@@ -605,14 +607,6 @@ gclue_service_client_handle_start (GClueDBusClient *client,
data->accuracy_level = ensure_valid_accuracy_level
(data->accuracy_level, GCLUE_ACCURACY_LEVEL_EXACT);
- if (system_app) {
- /* Since we have no reliable way to identify system apps, no
- * need for auth for them. */
- complete_start (data);
-
- return TRUE;
- }
-
/* No agent == No authorization */
if (priv->agent_proxy == NULL) {
/* Already a pending Start()? Denied! */
0001-service-Check-the-maximum-allowed-accuracy-level-eve.patch
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment