Fix how UDisksClient filters property changes

This commit is contained in:
Vojtech Trefny 2017-06-19 10:51:26 +02:00
parent d0e4accb53
commit 8077cb67a1
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 192a17d1a89d098a8df7e8b6d1e23c1005597fd5 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Fri, 16 Jun 2017 11:59:57 +0200
Subject: [PATCH] Fix how UDisksClient filters property changes
The value returned from g_strcmp0() is not a boolean. And a
GVariantIter has to be initialized before use.
---
udisks/udisksclient.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/udisks/udisksclient.c b/udisks/udisksclient.c
index ae9364d6..e2cd9a38 100644
--- a/udisks/udisksclient.c
+++ b/udisks/udisksclient.c
@@ -1566,14 +1566,15 @@ on_interface_proxy_properties_changed (GDBusObjectManagerClient *manager,
UDisksClient *client = UDISKS_CLIENT (user_data);
UDisksClientClass *client_class = UDISKS_CLIENT_GET_CLASS (client);
- GVariantIter *iter = NULL;
- const gchar *property_name = NULL;
+ GVariantIter iter;
+ gchar *property_name = NULL;
/* never emit the change signal for Job objects */
- if (g_strcmp0 (g_dbus_proxy_get_interface_name (interface_proxy), "org.freedesktop.UDisks2.Drive.Job"))
+ if (g_strcmp0 (g_dbus_proxy_get_interface_name (interface_proxy), "org.freedesktop.UDisks2.Drive.Job") == 0)
return;
- while (g_variant_iter_next (iter, "{&sv}", &property_name, NULL))
+ g_variant_iter_init (&iter, changed_properties);
+ while (g_variant_iter_next (&iter, "{&sv}", &property_name, NULL))
{
if (! g_hash_table_contains (client_class->changed_blacklist, property_name))
{

View File

@ -16,11 +16,12 @@
Name: udisks2
Summary: Disk Manager
Version: 2.7.0
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: https://github.com/storaged-project/udisks
Source0: https://github.com/storaged-project/udisks/releases/download/udisks-%{version}/udisks-%{version}.tar.bz2
Patch0: udisks-2.7.0-fix-changed-signal-filtering.patch
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
@ -201,6 +202,7 @@ This package contains module for ZRAM configuration.
%prep
%setup -q -n udisks-%{version}
%patch0 -p1
%build
autoreconf -ivf
@ -343,6 +345,9 @@ udevadm trigger
%endif
%changelog
* Mon Jun 19 2017 Vojtech Trefny <vtrefny@redhat.com> - 2.7.0-2
- Fix how UDisksClient filters property changes
* Fri Jun 02 2017 Vojtech Trefny <vtrefny@redhat.com> - 2.7.0-1
- Version 2.7.0