From ca31deb3e21705cf4a489e8650a49a24d41c61d5bd08e3285751d30fc50d7aef Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Mon, 4 Jan 2021 10:44:52 +0000 Subject: [PATCH] Accepting request 859610 from home:iznogood:branches:Application:Geo - 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 OBS-URL: https://build.opensuse.org/request/show/859610 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/geoclue2?expand=0&rev=88 --- geoclue-2.5.6.tar.bz2 | 3 - geoclue-2.5.7.tar.bz2 | 3 + geoclue2-revert-2-faulty.patch | 111 +++++++++++++++++++++++++++++++++ geoclue2.changes | 8 +++ geoclue2.spec | 8 ++- 5 files changed, 128 insertions(+), 5 deletions(-) delete mode 100644 geoclue-2.5.6.tar.bz2 create mode 100644 geoclue-2.5.7.tar.bz2 create mode 100644 geoclue2-revert-2-faulty.patch diff --git a/geoclue-2.5.6.tar.bz2 b/geoclue-2.5.6.tar.bz2 deleted file mode 100644 index 2a1c38b..0000000 --- a/geoclue-2.5.6.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b310e6ea86c695046e6069a728a2dd65989619827a730f90ec4bfdab4a1f0329 -size 85533 diff --git a/geoclue-2.5.7.tar.bz2 b/geoclue-2.5.7.tar.bz2 new file mode 100644 index 0000000..add0cb3 --- /dev/null +++ b/geoclue-2.5.7.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cc7dbe4177b4e7f3532f7fe42262049789a3cd6c55afe60a3564d7394119c27 +size 85764 diff --git a/geoclue2-revert-2-faulty.patch b/geoclue2-revert-2-faulty.patch new file mode 100644 index 0000000..b6003c0 --- /dev/null +++ b/geoclue2-revert-2-faulty.patch @@ -0,0 +1,111 @@ +From 194529c7e7123b06d41eb8025cd4375aba271068 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +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 +--- + 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 +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 +--- + 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 + diff --git a/geoclue2.changes b/geoclue2.changes index 15e295d..93a23e7 100644 --- a/geoclue2.changes +++ b/geoclue2.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Dec 31 13:10:06 UTC 2020 - Bjørn Lie + +- 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 + ------------------------------------------------------------------- Sun Dec 13 13:01:31 UTC 2020 - Bjørn Lie diff --git a/geoclue2.spec b/geoclue2.spec index 33897f5..42e449c 100644 --- a/geoclue2.spec +++ b/geoclue2.spec @@ -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 @@ Source0: %{url}/-/archive/%{version}/geoclue-%{version}.tar.bz2 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 @@ awareness in applications. GeoClue uses the D-Bus inter-process communication mechanism to provide location information %prep -%autosetup -n %{_name}-%{version} -p1 +%autosetup -n %{_name}-%{version} -N +%patch0 -p1 -R %build %meson \