diff options
author | Laurent Bigonville <bigon@bigon.be> | 2020-10-23 21:37:12 +0200 |
---|---|---|
committer | Zeeshan Ali <zeeshanak@gnome.org> | 2020-12-23 12:35:24 +0100 |
commit | d223fe19a6662c53601907b8f076631515c511c9 (patch) | |
tree | 64cc078f86e3e5291d7316c110d6e09b39cc0531 | |
parent | 48f5529f7ff0110752c10675fc9274f9e6bc9906 (diff) | |
download | geoclue-d223fe19a6662c53601907b8f076631515c511c9.tar.gz |
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
-rw-r--r-- | src/gclue-service-client.c | 16 |
1 files 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! */ |