Commit fb9edbf9 authored by Laurent Bigonville's avatar Laurent Bigonville
Browse files

New upstream version 2.5.7

parent d2643a89
before_script:
- sed -i '/^#\sdeb-src /s/^#//' '/etc/apt/sources.list'
- apt-get update && apt-get build-dep --yes geoclue-2.0
- apt-get --allow-unauthenticated update && apt-get build-dep --yes geoclue-2.0
- apt-get install --yes git gobject-introspection libmm-glib-dev wget
- apt-get install --yes libnotify-dev xsltproc gtk-doc-tools python3-pip
- apt-get install --yes ninja-build gettext modemmanager-dev
- pip3 install meson
- pip3 install meson==0.53.2
# Ubuntu 14.04 is not supported, see README for details
#
......
2.5.7
=====
Many fixes. Can't bother to list them. You can get the list of changes from git.
2.5.6
=====
......
project('geoclue', 'c', version: '2.5.6', meson_version : '>= 0.47.2')
project('geoclue', 'c', version: '2.5.7', meson_version : '>= 0.47.2')
gclue_version = meson.project_version()
ver_arr = gclue_version.split('.')
......
......@@ -74,6 +74,7 @@ gclue_client_info_finalize (GObject *object)
priv->watch_id = 0;
}
g_clear_object (&priv->dbus_proxy);
g_clear_pointer (&priv->bus_name, g_free);
g_clear_pointer (&priv->xdg_id, g_free);
g_clear_object (&priv->connection);
......
......@@ -192,6 +192,7 @@ gclue_location_source_finalize (GObject *object)
gclue_location_source_stop (GCLUE_LOCATION_SOURCE (object));
g_clear_object (&priv->location);
g_clear_object (&priv->time_threshold);
G_OBJECT_CLASS (gclue_location_source_parent_class)->finalize (object);
}
......
......@@ -301,8 +301,6 @@ gclue_locator_finalize (GObject *gsource)
GList *node;
GClueMinUINT *threshold;
G_OBJECT_CLASS (gclue_locator_parent_class)->finalize (gsource);
threshold = gclue_location_source_get_time_threshold
(GCLUE_LOCATION_SOURCE (locator));
g_signal_handlers_disconnect_by_func
......@@ -325,7 +323,10 @@ gclue_locator_finalize (GObject *gsource)
}
g_list_free_full (priv->sources, g_object_unref);
priv->sources = NULL;
g_list_free (priv->active_sources);
priv->active_sources = NULL;
G_OBJECT_CLASS (gclue_locator_parent_class)->finalize (gsource);
}
static void
......
......@@ -523,7 +523,7 @@ clear_caps (GClueModemManager *manager,
return mm_modem_location_setup_sync (priv->modem_location,
priv->caps,
FALSE,
TRUE,
cancellable,
error);
}
......
......@@ -124,13 +124,28 @@ gclue_mozilla_create_query (GList *bss_list, /* As in Access Points */
char *data;
gsize data_len;
const char *uri;
guint n_non_ignored_bsss;
GList *iter;
builder = json_builder_new ();
json_builder_begin_object (builder);
/* We send pure geoip query using empty object if both bss_list and
* tower are NULL.
*
* If the list of non-ignored BSSs is <2, don’t bother submitting the
* BSS list as MLS will only do a geoip lookup anyway.
* See https://ichnaea.readthedocs.io/en/latest/api/geolocate.html#field-definition
*/
n_non_ignored_bsss = 0;
for (iter = bss_list; iter != NULL; iter = iter->next) {
WPABSS *bss = WPA_BSS (iter->data);
if (gclue_mozilla_should_ignore_bss (bss))
continue;
n_non_ignored_bsss++;
}
if (tower != NULL) {
json_builder_set_member_name (builder, "radioType");
......@@ -155,9 +170,7 @@ gclue_mozilla_create_query (GList *bss_list, /* As in Access Points */
json_builder_end_array (builder);
}
if (bss_list != NULL) {
GList *iter;
if (n_non_ignored_bsss >= 2) {
json_builder_set_member_name (builder, "wifiAccessPoints");
json_builder_begin_array (builder);
......
......@@ -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! */
......
......@@ -29,7 +29,7 @@
#include "gclue-mozilla.h"
#define WIFI_SCAN_TIMEOUT_HIGH_ACCURACY 10
/* Since this is only used for city-level accuracy, 5 minutes betweeen each
/* Since this is only used for city-level accuracy, 5 minutes between each
* scan is more than enough.
*/
#define WIFI_SCAN_TIMEOUT_LOW_ACCURACY 300
......@@ -284,7 +284,7 @@ on_bss_signal_notify (GObject *gobject,
get_bssid_from_bss (bss, bssid);
g_debug ("WiFi AP '%s' still has very low strength (%u dBm)"
", ignoring again..",
", ignoring again",
bssid,
wpa_bss_get_signal (bss));
return;
......@@ -331,7 +331,7 @@ on_bss_proxy_ready (GObject *source_object,
get_bssid_from_bss (bss, bssid);
g_debug ("WiFi AP '%s' has very low strength (%u dBm)"
", ignoring for now..",
", ignoring for now",
bssid,
wpa_bss_get_signal (bss));
g_signal_connect (G_OBJECT (bss),
......@@ -393,6 +393,35 @@ on_bss_removed (WPAInterface *object,
remove_bss_from_hashtable (path, priv->ignored_bss_proxies);
}
static void
start_wifi_scan (GClueWifi *wifi)
{
GClueWifiPrivate *priv = wifi->priv;
GVariantBuilder builder;
GVariant *args;
g_debug ("Starting WiFi scan…");
if (priv->scan_done_id == 0)
priv->scan_done_id = g_signal_connect
(priv->interface,
"scan-done",
G_CALLBACK (on_scan_done),
wifi);
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
g_variant_builder_add (&builder,
"{sv}",
"Type", g_variant_new ("s", "passive"));
args = g_variant_builder_end (&builder);
wpa_interface_call_scan (WPA_INTERFACE (priv->interface),
args,
NULL,
on_scan_call_done,
wifi);
}
static void
cancel_wifi_scan (GClueWifi *wifi)
{
......@@ -415,33 +444,14 @@ on_scan_timeout (gpointer user_data)
{
GClueWifi *wifi = GCLUE_WIFI (user_data);
GClueWifiPrivate *priv = wifi->priv;
GVariantBuilder builder;
GVariant *args;
if (priv->interface == NULL)
return FALSE;
g_debug ("WiFi scan timeout. Restarting-scan..");
g_debug ("WiFi scan timeout.");
priv->scan_timeout = 0;
if (priv->scan_done_id == 0)
priv->scan_done_id = g_signal_connect
(priv->interface,
"scan-done",
G_CALLBACK (on_scan_done),
wifi);
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
g_variant_builder_add (&builder,
"{sv}",
"Type", g_variant_new ("s", "passive"));
args = g_variant_builder_end (&builder);
if (priv->interface == NULL)
return G_SOURCE_REMOVE;
wpa_interface_call_scan (WPA_INTERFACE (priv->interface),
args,
NULL,
on_scan_call_done,
wifi);
start_wifi_scan (wifi);
return FALSE;
}
......@@ -467,10 +477,19 @@ on_scan_done (WPAInterface *object,
if (priv->bss_list_changed) {
priv->bss_list_changed = FALSE;
g_debug ("Refreshing location..");
g_debug ("Refreshing location");
gclue_web_source_refresh (GCLUE_WEB_SOURCE (wifi));
}
/* If there was another scan already scheduled, cancel that and
* re-schedule. Regardless of our internal book-keeping, this can happen
* if wpa_supplicant emits the `ScanDone` signal due to a scan being
* initiated by another client. */
if (priv->scan_timeout != 0) {
g_source_remove (priv->scan_timeout);
priv->scan_timeout = 0;
}
/* With high-enough accuracy requests, we need to scan more often since
* user's location can change quickly. With low accuracy, we don't since
* we wouldn't want to drain power unnecessarily.
......@@ -522,7 +541,7 @@ connect_bss_signals (GClueWifi *wifi)
return;
}
on_scan_timeout (wifi);
start_wifi_scan (wifi);
priv->bss_list_changed = TRUE;
priv->bss_added_id = g_signal_connect (priv->interface,
......@@ -818,6 +837,7 @@ gclue_wifi_get_accuracy_level (GClueWifi *wifi)
return wifi->priv->accuracy_level;
}
/* Can return NULL without setting @error, signifying an empty BSS list. */
static GList *
get_bss_list (GClueWifi *wifi,
GError **error)
......@@ -839,8 +859,22 @@ gclue_wifi_create_query (GClueWebSource *source,
{
GList *bss_list; /* As in Access Points */
SoupMessage *msg;
g_autoptr(GError) local_error = NULL;
bss_list = get_bss_list (GCLUE_WIFI (source), NULL);
bss_list = get_bss_list (GCLUE_WIFI (source), &local_error);
if (local_error != NULL) {
g_propagate_error (error, g_steal_pointer (&local_error));
return NULL;
}
/* Empty list? */
if (bss_list == NULL) {
g_set_error_literal (error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
"No WiFi networks found");
return NULL;
}
msg = gclue_mozilla_create_query (bss_list, NULL, error);
g_list_free (bss_list);
......@@ -862,10 +896,22 @@ gclue_wifi_create_submit_query (GClueWebSource *source,
{
GList *bss_list; /* As in Access Points */
SoupMessage * msg;
g_autoptr(GError) local_error = NULL;
bss_list = get_bss_list (GCLUE_WIFI (source), error);
if (bss_list == NULL)
bss_list = get_bss_list (GCLUE_WIFI (source), &local_error);
if (local_error != NULL) {
g_propagate_error (error, g_steal_pointer (&local_error));
return NULL;
}
/* Empty list? */
if (bss_list == NULL) {
g_set_error_literal (error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
"No WiFi networks found");
return NULL;
}
msg = gclue_mozilla_create_submit_query (location,
bss_list,
......
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