Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package geoclue2 for openSUSE:Factory checked in at 2021-09-07 21:13:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/geoclue2 (Old) and /work/SRC/openSUSE:Factory/.geoclue2.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "geoclue2" Tue Sep 7 21:13:36 2021 rev:38 rq:916132 version:2.5.7 Changes: -------- --- /work/SRC/openSUSE:Factory/geoclue2/geoclue2.changes 2020-12-15 12:32:40.492111037 +0100 +++ /work/SRC/openSUSE:Factory/.geoclue2.new.1899/geoclue2.changes 2021-09-07 21:13:39.772740309 +0200 @@ -1,0 +2,8 @@ +Thu Dec 31 13:10:06 UTC 2020 - Bj??rn Lie <bjorn....@gmail.com> + +- Update to version 2.5.7: + + A bug fix release, mainly fixing a bunch of memory leaks. +- Add geoclue2-revert-2-faulty.patch: Revert two broken commits. + https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/142 + +------------------------------------------------------------------- Old: ---- geoclue-2.5.6.tar.bz2 New: ---- geoclue-2.5.7.tar.bz2 geoclue2-revert-2-faulty.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ geoclue2.spec ++++++ --- /var/tmp/diff_new_pack.PJpUH2/_old 2021-09-07 21:13:40.432741107 +0200 +++ /var/tmp/diff_new_pack.PJpUH2/_new 2021-09-07 21:13:40.436741112 +0200 @@ -19,7 +19,7 @@ %define _name geoclue Name: geoclue2 -Version: 2.5.6 +Version: 2.5.7 Release: 0 Summary: GeoLocation Framework License: GPL-2.0-or-later @@ -29,6 +29,9 @@ Source1: srvGeoClue.conf Source99: geoclue2-rpmlintrc +# PATCH-FIX-UPSTREAM geoclue2-revert-2-faulty.patch -- Revert two broken commits +Patch0: geoclue2-revert-2-faulty.patch + BuildRequires: intltool >= 0.40.0 BuildRequires: meson >= 0.47.2 BuildRequires: pkgconfig @@ -89,7 +92,8 @@ communication mechanism to provide location information %prep -%autosetup -n %{_name}-%{version} -p1 +%autosetup -n %{_name}-%{version} -N +%patch0 -p1 -R %build %meson \ ++++++ geoclue-2.5.6.tar.bz2 -> geoclue-2.5.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/.gitlab-ci.yml new/geoclue-2.5.7/.gitlab-ci.yml --- old/geoclue-2.5.6/.gitlab-ci.yml 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/.gitlab-ci.yml 2020-12-23 12:44:45.000000000 +0100 @@ -1,10 +1,10 @@ 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 # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/NEWS new/geoclue-2.5.7/NEWS --- old/geoclue-2.5.6/NEWS 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/NEWS 2020-12-23 12:44:45.000000000 +0100 @@ -1,3 +1,9 @@ +2.5.7 +===== + +Many fixes. Can't bother to list them. You can get the list of changes from git. + + 2.5.6 ===== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/meson.build new/geoclue-2.5.7/meson.build --- old/geoclue-2.5.6/meson.build 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/meson.build 2020-12-23 12:44:45.000000000 +0100 @@ -1,4 +1,4 @@ -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('.') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/src/gclue-client-info.c new/geoclue-2.5.7/src/gclue-client-info.c --- old/geoclue-2.5.6/src/gclue-client-info.c 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/src/gclue-client-info.c 2020-12-23 12:44:45.000000000 +0100 @@ -74,6 +74,7 @@ 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); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/src/gclue-location-source.c new/geoclue-2.5.7/src/gclue-location-source.c --- old/geoclue-2.5.6/src/gclue-location-source.c 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/src/gclue-location-source.c 2020-12-23 12:44:45.000000000 +0100 @@ -192,6 +192,7 @@ 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); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/src/gclue-locator.c new/geoclue-2.5.7/src/gclue-locator.c --- old/geoclue-2.5.6/src/gclue-locator.c 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/src/gclue-locator.c 2020-12-23 12:44:45.000000000 +0100 @@ -301,8 +301,6 @@ 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 @@ } 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/src/gclue-modem-manager.c new/geoclue-2.5.7/src/gclue-modem-manager.c --- old/geoclue-2.5.6/src/gclue-modem-manager.c 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/src/gclue-modem-manager.c 2020-12-23 12:44:45.000000000 +0100 @@ -523,7 +523,7 @@ return mm_modem_location_setup_sync (priv->modem_location, priv->caps, - FALSE, + TRUE, cancellable, error); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/src/gclue-mozilla.c new/geoclue-2.5.7/src/gclue-mozilla.c --- old/geoclue-2.5.6/src/gclue-mozilla.c 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/src/gclue-mozilla.c 2020-12-23 12:44:45.000000000 +0100 @@ -124,13 +124,28 @@ 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 @@ 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); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/src/gclue-service-client.c new/geoclue-2.5.7/src/gclue-service-client.c --- old/geoclue-2.5.6/src/gclue-service-client.c 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/src/gclue-service-client.c 2020-12-23 12:44:45.000000000 +0100 @@ -447,6 +447,7 @@ 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 @@ 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 @@ const char *desktop_id; GClueAppPerm app_perm; guint32 uid; - gboolean system_app = FALSE; if (priv->locator != NULL) { /* Already started */ @@ -569,7 +572,6 @@ 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 @@ 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! */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoclue-2.5.6/src/gclue-wifi.c new/geoclue-2.5.7/src/gclue-wifi.c --- old/geoclue-2.5.6/src/gclue-wifi.c 2020-02-26 14:19:24.000000000 +0100 +++ new/geoclue-2.5.7/src/gclue-wifi.c 2020-12-23 12:44:45.000000000 +0100 @@ -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 @@ 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 @@ 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), @@ -394,6 +394,35 @@ } 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) { GClueWifiPrivate *priv = wifi->priv; @@ -415,33 +444,14 @@ { 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 @@ 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 @@ 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 @@ 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 @@ { 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 @@ { 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, ++++++ geoclue2-revert-2-faulty.patch ++++++ >From 194529c7e7123b06d41eb8025cd4375aba271068 Mon Sep 17 00:00:00 2001 From: Philip Withnall <pwithn...@endlessos.org> Date: Mon, 30 Nov 2020 15:20:01 +0000 Subject: [PATCH] gclue-wifi: Fix returning NULL error if BSS list is empty This fixes a critical warning (and accompanying leak of the `GTask`) if the BSS list is empty, which causes `create_query()` to return NULL with no error set. Signed-off-by: Philip Withnall <pwithn...@endlessos.org> --- src/gclue-wifi.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/gclue-wifi.c b/src/gclue-wifi.c index 0bb166c..b06737d 100644 --- a/src/gclue-wifi.c +++ b/src/gclue-wifi.c @@ -837,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) @@ -858,10 +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), 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_query (bss_list, NULL, error); g_list_free (bss_list); @@ -883,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, -- GitLab >From 715cfbf5bec8002fb1e9759b6c34bc070f977807 Mon Sep 17 00:00:00 2001 From: Philip Withnall <pwithn...@endlessos.org> Date: Mon, 9 Nov 2020 17:47:44 +0000 Subject: [PATCH] gclue-wifi: Handle errors getting the BSS list Without this, we can submit empty requests to the Mozilla geolocation service. Signed-off-by: Philip Withnall <pwithn...@endlessos.org> --- src/gclue-wifi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gclue-wifi.c b/src/gclue-wifi.c index fecfd08..5ab4501 100644 --- a/src/gclue-wifi.c +++ b/src/gclue-wifi.c @@ -840,7 +840,9 @@ gclue_wifi_create_query (GClueWebSource *source, GList *bss_list; /* As in Access Points */ SoupMessage *msg; - bss_list = get_bss_list (GCLUE_WIFI (source), NULL); + bss_list = get_bss_list (GCLUE_WIFI (source), error); + if (bss_list == NULL) + return NULL; msg = gclue_mozilla_create_query (bss_list, NULL, error); g_list_free (bss_list); -- GitLab