- Handle unknown object properties without asserting (fdo #16079)

- Handle GetAll() property names correctly (fdo #16114)
- Enable the freeze-abi patch
- Cherry-pick some fixes from upstream git
This commit is contained in:
Daniel Williams 2008-05-27 15:37:40 +00:00
parent c66fedaf50
commit 271d9deacd
5 changed files with 130 additions and 1 deletions

View File

@ -0,0 +1,41 @@
commit 2cf62d7ff7d3a7bc450d0b60bb81a8365ffd310b
Author: Ross Burton <ross@burtonini.com>
Date: Wed Feb 27 14:19:48 2008 +0000
Fix pending call cancelling in proxy dispose
The dispose treated the hash values as DBusGProxyCall objects, but they are
DBusPendingCall (thanks Dafyd Harries).
diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c
index 3d5a0c5..1244151 100644
--- a/dbus/dbus-gproxy.c
+++ b/dbus/dbus-gproxy.c
@@ -1419,13 +1419,14 @@ dbus_g_proxy_class_init (DBusGProxyClass *klass)
G_TYPE_NONE, 2, DBUS_TYPE_MESSAGE, G_TYPE_POINTER);
}
-static void
+static gboolean
cancel_pending_call (gpointer key, gpointer val, gpointer data)
{
- DBusGProxyCall *call = key;
- DBusGProxy *proxy = data;
+ DBusPendingCall *pending = val;
- dbus_g_proxy_cancel_call (proxy, call);
+ dbus_pending_call_cancel (pending);
+
+ return TRUE;
}
static void
@@ -1440,7 +1441,7 @@ dbus_g_proxy_dispose (GObject *object)
}
/* Cancel outgoing pending calls */
- g_hash_table_foreach (priv->pending_calls, cancel_pending_call, proxy);
+ g_hash_table_foreach_remove (priv->pending_calls, cancel_pending_call, NULL);
g_hash_table_destroy (priv->pending_calls);
priv->pending_calls = NULL;

View File

@ -0,0 +1,32 @@
diff -up dbus-glib-0.74/dbus/dbus-gobject.c.getall-wincaps-to-uscore dbus-glib-0.74/dbus/dbus-gobject.c
--- dbus-glib-0.74/dbus/dbus-gobject.c.getall-wincaps-to-uscore 2008-05-27 08:49:46.000000000 -0400
+++ dbus-glib-0.74/dbus/dbus-gobject.c 2008-05-27 09:39:13.000000000 -0400
@@ -775,6 +775,7 @@ get_all_object_properties (DBusConnectio
DBusMessageIter iter_dict_entry;
DBusMessageIter iter_dict_value;
const char *p;
+ char *uscore_propname;
ret = dbus_message_new_method_return (message);
if (ret == NULL)
@@ -815,13 +816,18 @@ get_all_object_properties (DBusConnectio
p++;
p++;
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), prop_name);
+ uscore_propname = _dbus_gutils_wincaps_to_uscore (prop_name);
+
+ pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), uscore_propname);
if (pspec == NULL)
{
- g_warning ("introspection data references non-existing property %s", prop_name);
+ g_warning ("introspection data references non-existing property %s", uscore_propname);
+ g_free (uscore_propname);
continue;
}
+ g_free (uscore_propname);
+
g_value_init (&value, pspec->value_type);
g_object_get_property (object, pspec->name, &value);

View File

@ -0,0 +1,17 @@
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c
index 6596309..3744d84 100644
--- a/dbus/dbus-gobject.c
+++ b/dbus/dbus-gobject.c
@@ -1503,6 +1503,12 @@ gobject_message_function (DBusConnection *connection,
ret = NULL;
}
}
+ else
+ {
+ ret = dbus_message_new_error_printf (message,
+ DBUS_ERROR_INVALID_ARGS,
+ "No such property %s", wincaps_propname);
+ }
}
g_assert (ret != NULL);

View File

@ -0,0 +1,20 @@
commit 8e024ae2252e6e948c28203f07aa416df3dac0b8
Author: Ross Burton <ross@burtonini.com>
Date: Wed Feb 27 14:02:36 2008 +0000
Unref the connection and message on dbus_g_return_error
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c
index df26e3b..17855bf 100644
--- a/dbus/dbus-gobject.c
+++ b/dbus/dbus-gobject.c
@@ -2073,6 +2073,9 @@ dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error)
reply = gerror_to_dbus_error_message (context->object, dbus_g_message_get_message (context->message), error);
dbus_connection_send (dbus_g_connection_get_connection (context->connection), reply, NULL);
dbus_message_unref (reply);
+
+ dbus_g_connection_unref (context->connection);
+ dbus_g_message_unref (context->message);
g_free (context);
}

View File

@ -8,7 +8,7 @@
Summary: GLib bindings for D-Bus
Name: dbus-glib
Version: 0.74
Release: r87%{?dist}
Release: 9%{?dist}
URL: http://www.freedesktop.org/software/dbus/
Source0: http://dbus.freedesktop.org/releases/dbus-glib/%{name}-%{version}.tar.gz
Source1: dbus-bus-introspect.xml
@ -20,6 +20,14 @@ Patch3: dbus-glib-0.74-set-default-timeout-for-proxy.patch
Patch4: dbus-glib-0.74-export-getall.patch
# http://bugs.freedesktop.org/show_bug.cgi?id=15430
Patch5: dbus-glib-0.74-freeze-abi.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=16079
Patch6: dbus-glib-0.74-handle-unknown-property.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=16114
Patch7: dbus-glib-0.74-getall-wincaps-to-uscore.patch
# Upstream; 8e024ae2252e6e948c28203f07aa416df3dac0b8
Patch8: dbus-glib-0.74-leak-fix.patch
# Upstream; 2cf62d7ff7d3a7bc450d0b60bb81a8365ffd310b
Patch9: dbus-glib-0.74-fix-call-cancel-on-proxy-dispose.patch
License: AFL and GPLv2+
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -70,6 +78,11 @@ D-Bus tools written using the gtk+ GUI libaries
%patch2 -p1 -b .ignore-namespaces
%patch3 -p1 -b .set-default-timeout
%patch4 -p1 -b .export-getall
%patch5 -p1 -b .freeze-abi
%patch6 -p1 -b .handle-unknown-property
%patch7 -p1 -b .getall-wincaps-to-uscore
%patch8 -p1 -b .leak-fix
%patch9 -p1 -b .fix-call-cancel-on-proxy-dispose
%build
@ -125,6 +138,12 @@ rm -rf %{buildroot}
%endif
%changelog
* Tue May 27 2008 Dan Williams <dcbw@redhat.com> - 0.74-9
- Handle unknown object properties without asserting (fdo #16079)
- Handle GetAll() property names correctly (fdo #16114)
- Enable the freeze-abi patch
- Cherry-pick some fixes from upstream git
* Thu May 8 2008 Matthias Clasen <mclasen@redhat.com> - 0.74-8
- Fix license field