Compare commits

...

12 Commits
master ... f16

Author SHA1 Message Date
Matthias Clasen ece541813c 2.30.3 2012-03-11 20:36:28 -04:00
Dan Williams 0e7dd55218 Update to 2.30.2 2012-01-09 12:47:23 -06:00
Matthias Clasen 9466b148b9 2.30.1 2011-10-14 17:00:26 -04:00
Matthias Clasen b5249c24e7 Clean up old patches 2011-10-14 11:00:36 -04:00
Dan Williams f2a59ac4cd Fix release # 2011-10-05 15:11:48 -05:00
Dan Williams a4380b5521 Fix signal marshalling on 64-bit big-endian platforms (rh #736489) 2011-10-05 15:07:03 -05:00
Ray Strode 572cef69be Update to 2.30.0 2011-09-26 18:28:42 -04:00
Matthias Clasen c867079ea9 2.29.92 2011-09-19 18:40:42 -04:00
Matthias Clasen fb27811bc4 2.29.90 2011-09-06 13:32:19 -04:00
Matthias Clasen 5e4a709a11 fix file lists 2011-08-30 17:57:25 -04:00
Matthias Clasen 3451eacb03 2.29.18 2011-08-30 17:49:33 -04:00
Matthias Clasen 82eb152578 2.29.16 2011-08-16 16:01:22 -04:00
12 changed files with 261 additions and 648 deletions

8
.gitignore vendored
View File

@ -23,3 +23,11 @@ glib-2.25.13.tar.bz2
/glib-2.29.8.tar.xz
/glib-2.29.10.tar.xz
/glib-2.29.14.tar.xz
/glib-2.29.16.tar.xz
/glib-2.29.18.tar.xz
/glib-2.29.90.tar.xz
/glib-2.29.92.tar.xz
/glib-2.30.0.tar.xz
/glib-2.30.1.tar.xz
/glib-2.30.2.tar.xz
/glib-2.30.3.tar.xz

View File

@ -1,27 +0,0 @@
From eb454a1cb4d8ea16f6b5575c69e58c2877ea350e Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Sun, 27 Jun 2010 19:27:04 -0400
Subject: [PATCH] Fix a alloc/free mismatch
Pointed out in http://bugzilla.redhat.com/show_bug.cgi?id=608453
by David Tardon.
---
glib/gbuffer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/glib/gbuffer.c b/glib/gbuffer.c
index 4eb83df..5830f04 100644
--- a/glib/gbuffer.c
+++ b/glib/gbuffer.c
@@ -138,7 +138,7 @@ g_buffer_free_usernotify (GBuffer *buffer)
GUserNotifyBuffer *ubuffer = (GUserNotifyBuffer *) buffer;
ubuffer->user_destroy (ubuffer->user_data);
- g_slice_free (GBuffer, buffer);
+ g_slice_free (GUserNotifyBuffer, ubuffer);
}
/* < private >
--
1.7.1

View File

@ -1,225 +0,0 @@
From 5bb94348f4760352f6ae974002db48cb130343a4 Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz@redhat.com>
Date: Wed, 18 Aug 2010 11:35:25 -0400
Subject: [PATCH 1/4] GDBusProxy: Call into well-known name if no name owner currently exists
This is really what (API) users expect from GDBusProxy - in
particular, mclasen and I ran into this problem while debugging a
upower issue, see
https://bugzilla.redhat.com/show_bug.cgi?id=624125
In a nutshell, the problem is that polkitd crashes while upower holds
a PolkitAuthority object (which in turns contains a GDBusProxy for the
well-known name org.freedesktop.PolicyKit1). This means that
subsequent calls on the PolkitAuthority (which is translated into
calls into the GDBusProxy) fails since :g-name-owner is NULL.
With this fix, we'll be requesting the bus daemon to launch polkitd
since we will start calling into org.freedesktop.PolicyKit1 as soon as
we notice that there is no owner for this name.
Unfortunately our test suite doesn't cover service activation so there
is no way to reliably test this. I will file a bug about this.
Signed-off-by: David Zeuthen <davidz@redhat.com>
---
gio/gdbusproxy.c | 108 ++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 80 insertions(+), 28 deletions(-)
diff --git a/gio/gdbusproxy.c b/gio/gdbusproxy.c
index d47a4ad..17e6730 100644
--- a/gio/gdbusproxy.c
+++ b/gio/gdbusproxy.c
@@ -61,9 +61,13 @@
* name is tracked and can be read from
* #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
* get notified of changes. Additionally, only signals and property
- * changes emitted from the current name owner are considered. This
- * avoids a number of race conditions when the name is lost by one
- * owner and claimed by another.
+ * changes emitted from the current name owner are considered and
+ * calls are always sent to the current name owner. This avoids a
+ * number of race conditions when the name is lost by one owner and
+ * claimed by another. However, if no name owner currently exists,
+ * then calls will be sent to the well-known name which may result in
+ * the message bus launching an owner (unless
+ * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
*
* The generic #GDBusProxy::g-properties-changed and #GDBusProxy::g-signal
* signals are not very convenient to work with. Therefore, the recommended
@@ -2179,6 +2183,31 @@ lookup_method_info_or_warn (GDBusProxy *proxy,
return info;
}
+static const gchar *
+get_destination_for_call (GDBusProxy *proxy)
+{
+ const gchar *ret;
+
+ ret = NULL;
+
+ /* If proxy->priv->name is a unique name, then proxy->priv->name_owner
+ * is never NULL and always the same as proxy->priv->name. We use this
+ * knowledge to avoid checking if proxy->priv->name is a unique or
+ * well-known name.
+ */
+ ret = proxy->priv->name_owner;
+ if (ret != NULL)
+ goto out;
+
+ if (proxy->priv->flags & G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START)
+ goto out;
+
+ ret = proxy->priv->name;
+
+ out:
+ return ret;
+}
+
/**
* g_dbus_proxy_call:
* @proxy: A #GDBusProxy.
@@ -2243,9 +2272,9 @@ g_dbus_proxy_call (GDBusProxy *proxy,
gboolean was_split;
gchar *split_interface_name;
const gchar *split_method_name;
- const GDBusMethodInfo *expected_method_info;
const gchar *target_method_name;
const gchar *target_interface_name;
+ const gchar *destination;
GVariantType *reply_type;
g_return_if_fail (G_IS_DBUS_PROXY (proxy));
@@ -2253,6 +2282,9 @@ g_dbus_proxy_call (GDBusProxy *proxy,
g_return_if_fail (parameters == NULL || g_variant_is_of_type (parameters, G_VARIANT_TYPE_TUPLE));
g_return_if_fail (timeout_msec == -1 || timeout_msec >= 0);
+ reply_type = NULL;
+ split_interface_name = NULL;
+
simple = g_simple_async_result_new (G_OBJECT (proxy),
callback,
user_data,
@@ -2265,17 +2297,30 @@ g_dbus_proxy_call (GDBusProxy *proxy,
g_object_set_data_full (G_OBJECT (simple), "-gdbus-proxy-method-name", g_strdup (target_method_name), g_free);
/* Warn if method is unexpected (cf. :g-interface-info) */
- expected_method_info = NULL;
if (!was_split)
- expected_method_info = lookup_method_info_or_warn (proxy, target_method_name);
+ {
+ const GDBusMethodInfo *expected_method_info;
+ expected_method_info = lookup_method_info_or_warn (proxy, target_method_name);
+ if (expected_method_info != NULL)
+ reply_type = _g_dbus_compute_complete_signature (expected_method_info->out_args);
+ }
- if (expected_method_info)
- reply_type = _g_dbus_compute_complete_signature (expected_method_info->out_args);
- else
- reply_type = NULL;
+ destination = NULL;
+ if (proxy->priv->name != NULL)
+ {
+ destination = get_destination_for_call (proxy);
+ if (destination == NULL)
+ {
+ g_simple_async_result_set_error (simple,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ _("Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag"));
+ goto out;
+ }
+ }
g_dbus_connection_call (proxy->priv->connection,
- proxy->priv->name_owner,
+ destination,
proxy->priv->object_path,
target_interface_name,
target_method_name,
@@ -2287,6 +2332,7 @@ g_dbus_proxy_call (GDBusProxy *proxy,
(GAsyncReadyCallback) reply_cb,
simple);
+ out:
if (reply_type != NULL)
g_variant_type_free (reply_type);
@@ -2392,9 +2438,9 @@ g_dbus_proxy_call_sync (GDBusProxy *proxy,
gboolean was_split;
gchar *split_interface_name;
const gchar *split_method_name;
- const GDBusMethodInfo *expected_method_info;
const gchar *target_method_name;
const gchar *target_interface_name;
+ const gchar *destination;
GVariantType *reply_type;
g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), NULL);
@@ -2403,32 +2449,37 @@ g_dbus_proxy_call_sync (GDBusProxy *proxy,
g_return_val_if_fail (timeout_msec == -1 || timeout_msec >= 0, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+ reply_type = NULL;
+
was_split = maybe_split_method_name (method_name, &split_interface_name, &split_method_name);
target_method_name = was_split ? split_method_name : method_name;
target_interface_name = was_split ? split_interface_name : proxy->priv->interface_name;
- if (proxy->priv->expected_interface)
+ /* Warn if method is unexpected (cf. :g-interface-info) */
+ if (!was_split)
{
- expected_method_info = g_dbus_interface_info_lookup_method (proxy->priv->expected_interface, target_method_name);
- if (expected_method_info == NULL)
- {
- g_warning ("Trying to invoke method `%s' which isn't in expected interface `%s'",
- target_method_name,
- target_interface_name);
- }
+ const GDBusMethodInfo *expected_method_info;
+ expected_method_info = lookup_method_info_or_warn (proxy, target_method_name);
+ if (expected_method_info != NULL)
+ reply_type = _g_dbus_compute_complete_signature (expected_method_info->out_args);
}
- else
+
+ destination = NULL;
+ if (proxy->priv->name != NULL)
{
- expected_method_info = NULL;
+ destination = get_destination_for_call (proxy);
+ if (destination == NULL)
+ {
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ _("Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag"));
+ goto out;
+ }
}
- if (expected_method_info)
- reply_type = _g_dbus_compute_complete_signature (expected_method_info->out_args);
- else
- reply_type = NULL;
-
ret = g_dbus_connection_call_sync (proxy->priv->connection,
- proxy->priv->name_owner,
+ destination,
proxy->priv->object_path,
target_interface_name,
target_method_name,
@@ -2439,6 +2490,7 @@ g_dbus_proxy_call_sync (GDBusProxy *proxy,
cancellable,
error);
+ out:
if (reply_type != NULL)
g_variant_type_free (reply_type);
--
1.7.2.1

View File

@ -1,110 +0,0 @@
From c91720255261222d7be685f3a8f039706f04cce5 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Mon, 6 Jun 2011 23:23:29 -0400
Subject: [PATCH 1/2] GDataList: don't hold the bitlock over callbacks
g_datalist_id_clear_i was dropping the dataset lock around
the destroy notifies, but kept the bitlock. This was causing
deadlocks when finalizing widgets.
---
glib/gdataset.c | 45 +++++++++++++++++++++++++++++----------------
1 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/glib/gdataset.c b/glib/gdataset.c
index e1b55c1..0c1f9c1 100644
--- a/glib/gdataset.c
+++ b/glib/gdataset.c
@@ -176,8 +176,7 @@ struct _GDataset
/* --- prototypes --- */
static inline GDataset* g_dataset_lookup (gconstpointer dataset_location);
-static inline void g_datalist_clear_i (GData **datalist,
- gboolean unlock_dataset);
+static inline void g_datalist_clear_i (GData **datalist);
static void g_dataset_destroy_internal (GDataset *dataset);
static inline gpointer g_data_set_internal (GData **datalist,
GQuark key_id,
@@ -228,8 +227,8 @@ g_datalist_unlock (GData **datalist)
/* Called with the datalist lock held, or the dataset global
* lock for dataset lists
*/
-void
-g_datalist_clear_i (GData **datalist, gboolean unlock_dataset)
+static void
+g_datalist_clear_i (GData **datalist)
{
GData *data;
gint i;
@@ -239,15 +238,13 @@ g_datalist_clear_i (GData **datalist, gboolean unlock_dataset)
if (data)
{
- if (unlock_dataset)
- G_UNLOCK (g_dataset_global);
+ G_UNLOCK (g_dataset_global);
for (i = 0; i < data->len; i++)
- {
- if (data->data[i].data && data->data[i].destroy)
- data->data[i].destroy (data->data[i].data);
- }
- if (unlock_dataset)
- G_LOCK (g_dataset_global);
+ {
+ if (data->data[i].data && data->data[i].destroy)
+ data->data[i].destroy (data->data[i].data);
+ }
+ G_LOCK (g_dataset_global);
g_free (data);
}
@@ -258,19 +255,35 @@ g_datalist_clear_i (GData **datalist, gboolean unlock_dataset)
* g_datalist_clear:
* @datalist: a datalist.
*
- * Frees all the data elements of the datalist. The data elements'
- * destroy functions are called if they have been set.
+ * Frees all the data elements of the datalist.
+ * The data elements' destroy functions are called
+ * if they have been set.
**/
void
g_datalist_clear (GData **datalist)
{
+ GData *data;
+ gint i;
+
g_return_if_fail (datalist != NULL);
g_datalist_lock (datalist);
- g_datalist_clear_i (datalist, FALSE);
+ data = G_DATALIST_GET_POINTER (datalist);
+ G_DATALIST_SET_POINTER (datalist, NULL);
g_datalist_unlock (datalist);
+
+ if (data)
+ {
+ for (i = 0; i < data->len; i++)
+ {
+ if (data->data[i].data && data->data[i].destroy)
+ data->data[i].destroy (data->data[i].data);
+ }
+
+ g_free (data);
+ }
}
/* HOLDS: g_dataset_global_lock */
@@ -307,7 +320,7 @@ g_dataset_destroy_internal (GDataset *dataset)
break;
}
- g_datalist_clear_i (&dataset->datalist, TRUE);
+ g_datalist_clear_i (&dataset->datalist);
dataset = g_dataset_lookup (dataset_location);
}
}
--
1.7.5.2

View File

@ -0,0 +1,218 @@
From 8e82225aedf81ea8a33deb3eb27a8878cd606521 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Fri, 23 Sep 2011 12:32:23 -0500
Subject: [PATCH] closure: fix handling of ENUMs and integral return types on
64-bit BE platforms
enums are stored in v_long but need to be marshalled as signed
integers. On platforms where int is 32 bits, taking the
address of v_long resulted in the wrong 32 bits being marshalled.
So we need to stuff the enum's int-sized value to a temporary
int-sized variable and marshall that instead.
Second, on return, libffi actually returns a pointer to a value
that's sized according to platform conventions, not according to
what the caller requested. ie if ffi_type_sint was requested, the
value can still be a 64-bit sign-extended long on a 64-bit
architecture like PPC64, thus the caller cannot simply cast
the return value as a pointer to the desired type, but must cast
as a pointer to an integral type and then cast to the desired
type to remove any sign extension complications.
For more information on how to correctly handle libffi return
values, see the following bug, specifically comment 35:
https://bugzilla.redhat.com/show_bug.cgi?id=736489
"For 64-bit ABIs that extend integral returns types to 64-bits, libffi always
returns full 64-bit values that you can truncate in the calling code. It's
just the way it is has always been. Please don't change libffi. I'll document
this clearly for the next version (perhaps there is a mention of this, I
haven't looked yet).
The same is true for returning 8-bit values, for instance, on 32-bit systems.
All ABIs extend those results to the full 32-bits so you need to provide a
properly aligned buffer that's big enough to hold the result."
https://bugzilla.gnome.org/show_bug.cgi?id=659881
---
gobject/gclosure.c | 76 ++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 59 insertions(+), 17 deletions(-)
diff --git a/gobject/gclosure.c b/gobject/gclosure.c
index 36ec4b0..6893484 100644
--- a/gobject/gclosure.c
+++ b/gobject/gclosure.c
@@ -944,21 +944,42 @@ g_signal_type_cclosure_new (GType itype,
#include <ffi.h>
static ffi_type *
-value_to_ffi_type (const GValue *gvalue, gpointer *value)
+value_to_ffi_type (const GValue *gvalue,
+ gpointer *value,
+ gint *enum_tmpval,
+ gboolean *tmpval_used)
{
ffi_type *rettype = NULL;
GType type = g_type_fundamental (G_VALUE_TYPE (gvalue));
g_assert (type != G_TYPE_INVALID);
+ if (enum_tmpval)
+ {
+ g_assert (tmpval_used != NULL);
+ *tmpval_used = FALSE;
+ }
+
switch (type)
{
case G_TYPE_BOOLEAN:
case G_TYPE_CHAR:
case G_TYPE_INT:
- case G_TYPE_ENUM:
rettype = &ffi_type_sint;
*value = (gpointer)&(gvalue->data[0].v_int);
break;
+ case G_TYPE_ENUM:
+ /* enums are stored in v_long even though they are integers, which makes
+ * marshalling through libffi somewhat complicated. They need to be
+ * marshalled as signed ints, but we need to use a temporary int sized
+ * value to pass to libffi otherwise it'll pull the wrong value on
+ * BE machines with 32-bit integers when treating v_long as 32-bit int.
+ */
+ g_assert (enum_tmpval != NULL);
+ rettype = &ffi_type_sint;
+ *enum_tmpval = g_value_get_enum (gvalue);
+ *value = enum_tmpval;
+ *tmpval_used = TRUE;
+ break;
case G_TYPE_UCHAR:
case G_TYPE_UINT:
case G_TYPE_FLAGS:
@@ -1011,10 +1032,12 @@ value_to_ffi_type (const GValue *gvalue, gpointer *value)
static void
value_from_ffi_type (GValue *gvalue, gpointer *value)
{
+ ffi_arg *int_val = value;
+
switch (g_type_fundamental (G_VALUE_TYPE (gvalue)))
{
case G_TYPE_INT:
- g_value_set_int (gvalue, *(gint*)value);
+ g_value_set_int (gvalue, (gint) *int_val);
break;
case G_TYPE_FLOAT:
g_value_set_float (gvalue, *(gfloat*)value);
@@ -1023,43 +1046,43 @@ value_from_ffi_type (GValue *gvalue, gpointer *value)
g_value_set_double (gvalue, *(gdouble*)value);
break;
case G_TYPE_BOOLEAN:
- g_value_set_boolean (gvalue, *(gboolean*)value);
+ g_value_set_boolean (gvalue, (gboolean) *int_val);
break;
case G_TYPE_STRING:
g_value_set_string (gvalue, *(gchar**)value);
break;
case G_TYPE_CHAR:
- g_value_set_char (gvalue, *(gchar*)value);
+ g_value_set_char (gvalue, (gchar) *int_val);
break;
case G_TYPE_UCHAR:
- g_value_set_uchar (gvalue, *(guchar*)value);
+ g_value_set_uchar (gvalue, (guchar) *int_val);
break;
case G_TYPE_UINT:
- g_value_set_uint (gvalue, *(guint*)value);
+ g_value_set_uint (gvalue, (guint) *int_val);
break;
case G_TYPE_POINTER:
g_value_set_pointer (gvalue, *(gpointer*)value);
break;
case G_TYPE_LONG:
- g_value_set_long (gvalue, *(glong*)value);
+ g_value_set_long (gvalue, (glong) *int_val);
break;
case G_TYPE_ULONG:
- g_value_set_ulong (gvalue, *(gulong*)value);
+ g_value_set_ulong (gvalue, (gulong) *int_val);
break;
case G_TYPE_INT64:
- g_value_set_int64 (gvalue, *(gint64*)value);
+ g_value_set_int64 (gvalue, (gint64) *int_val);
break;
case G_TYPE_UINT64:
- g_value_set_uint64 (gvalue, *(guint64*)value);
+ g_value_set_uint64 (gvalue, (guint64) *int_val);
break;
case G_TYPE_BOXED:
g_value_set_boxed (gvalue, *(gpointer*)value);
break;
case G_TYPE_ENUM:
- g_value_set_enum (gvalue, *(gint*)value);
+ g_value_set_enum (gvalue, (gint) *int_val);
break;
case G_TYPE_FLAGS:
- g_value_set_flags (gvalue, *(guint*)value);
+ g_value_set_flags (gvalue, (guint) *int_val);
break;
case G_TYPE_PARAM:
g_value_set_param (gvalue, *(gpointer*)value);
@@ -1108,10 +1131,13 @@ g_cclosure_marshal_generic (GClosure *closure,
int i;
ffi_cif cif;
GCClosure *cc = (GCClosure*) closure;
+ gint *enum_tmpval;
+ gboolean tmpval_used = FALSE;
+ enum_tmpval = g_alloca (sizeof (gint));
if (return_gvalue && G_VALUE_TYPE (return_gvalue))
{
- rtype = value_to_ffi_type (return_gvalue, &rvalue);
+ rtype = value_to_ffi_type (return_gvalue, &rvalue, enum_tmpval, &tmpval_used);
}
else
{
@@ -1124,22 +1150,38 @@ g_cclosure_marshal_generic (GClosure *closure,
atypes = g_alloca (sizeof (ffi_type *) * n_args);
args = g_alloca (sizeof (gpointer) * n_args);
+ if (tmpval_used)
+ enum_tmpval = g_alloca (sizeof (gint));
+
if (G_CCLOSURE_SWAP_DATA (closure))
{
atypes[n_args-1] = value_to_ffi_type (param_values + 0,
- &args[n_args-1]);
+ &args[n_args-1],
+ enum_tmpval,
+ &tmpval_used);
atypes[0] = &ffi_type_pointer;
args[0] = &closure->data;
}
else
{
- atypes[0] = value_to_ffi_type (param_values + 0, &args[0]);
+ atypes[0] = value_to_ffi_type (param_values + 0,
+ &args[0],
+ enum_tmpval,
+ &tmpval_used);
atypes[n_args-1] = &ffi_type_pointer;
args[n_args-1] = &closure->data;
}
for (i = 1; i < n_args - 1; i++)
- atypes[i] = value_to_ffi_type (param_values + i, &args[i]);
+ {
+ if (tmpval_used)
+ enum_tmpval = g_alloca (sizeof (gint));
+
+ atypes[i] = value_to_ffi_type (param_values + i,
+ &args[i],
+ enum_tmpval,
+ &tmpval_used);
+ }
if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, n_args, rtype, atypes) != FFI_OK)
return;
--
1.7.6.4

View File

@ -1,62 +0,0 @@
From 3ce857f9a489ef3dbfda685623aaea108e53c89a Mon Sep 17 00:00:00 2001
From: Jonathan Matthew <jonathan@d14n.org>
Date: Sun, 27 Mar 2011 10:44:31 +1000
Subject: [PATCH] introspection: add annotations for g_file_load_contents and friends
https://bugzilla.gnome.org/show_bug.cgi?id=645789
---
gio/gfile.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gio/gfile.c b/gio/gfile.c
index da3477b..4cecc8a 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -6124,7 +6124,7 @@ g_file_query_default_handler (GFile *file,
* g_file_load_contents:
* @file: input #GFile.
* @cancellable: optional #GCancellable object, %NULL to ignore.
- * @contents: (out) (transfer full): a location to place the contents of the file.
+ * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
* @length: (out) (allow-none): a location to place the length of the contents of the file,
* or %NULL if the length is not needed
* @etag_out: (out) (allow-none): a location to place the current entity tag for the file,
@@ -6431,7 +6431,7 @@ g_file_load_partial_contents_async (GFile *file,
* g_file_load_partial_contents_finish:
* @file: input #GFile.
* @res: a #GAsyncResult.
- * @contents: (out) (transfer full): a location to place the contents of the file.
+ * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
* @length: (out) (allow-none): a location to place the length of the contents of the file,
* or %NULL if the length is not needed
* @etag_out: (out) (allow-none): a location to place the current entity tag for the file,
@@ -6537,7 +6537,7 @@ g_file_load_contents_async (GFile *file,
* g_file_load_contents_finish:
* @file: input #GFile.
* @res: a #GAsyncResult.
- * @contents: (out) (transfer full): a location to place the contents of the file.
+ * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
* @length: (out) (allow-none): a location to place the length of the contents of the file,
* or %NULL if the length is not needed
* @etag_out: (out) (allow-none): a location to place the current entity tag for the file,
@@ -6572,7 +6572,7 @@ g_file_load_contents_finish (GFile *file,
/**
* g_file_replace_contents:
* @file: input #GFile.
- * @contents: a string containing the new contents for @file.
+ * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file.
* @length: the length of @contents in bytes.
* @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link>
* for the document, or %NULL
@@ -6785,7 +6785,7 @@ replace_contents_open_callback (GObject *obj,
/**
* g_file_replace_contents_async:
* @file: input #GFile.
- * @contents: string of contents to replace the file with.
+ * @contents: (element-type guint8) (array length=length): string of contents to replace the file with.
* @length: the length of @contents in bytes.
* @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
* @make_backup: %TRUE if a backup should be created.
--
1.7.4.2

View File

@ -1,36 +0,0 @@
From a7689537605ade51b19be76baa3fba303527483d Mon Sep 17 00:00:00 2001
From: Ryan Lortie <desrt@desrt.ca>
Date: Sat, 19 Jun 2010 11:38:57 -0400
Subject: [PATCH 03/45] Fix bug in strinfo
We can't search for a larger needle inside of a smaller haystack, and
unsigned integer subtraction tends to result in very large numbers
rather than small ones.
Add a check for this case and abort out immediately.
Also add a test case (lifted directly from the docs) that demonstrates
the problem.
Issue discovered and tracked down by Milan Bouchet-Valat
---
gio/strinfo.c | 3 ++
gio/tests/gschema-compile.c | 3 +-
gio/tests/schema-tests/from-docs.gschema.xml | 34 ++++++++++++++++++++++++++
3 files changed, 39 insertions(+), 1 deletions(-)
create mode 100644 gio/tests/schema-tests/from-docs.gschema.xml
diff --git a/gio/strinfo.c b/gio/strinfo.c
index 9ba18aa..f762fc5 100644
--- a/gio/strinfo.c
+++ b/gio/strinfo.c
@@ -147,6 +147,9 @@ strinfo_scan (const guint32 *strinfo,
{
guint i = 0;
+ if (length < n_words)
+ return -1;
+
while (i <= length - n_words)
{
guint j = 0;

View File

@ -1,120 +0,0 @@
Index: gio/glocalfileinfo.c
===================================================================
--- gio/glocalfileinfo.c (revision 6871)
+++ gio/glocalfileinfo.c (working copy)
@@ -1706,6 +1706,24 @@
#endif
static gboolean
+get_string (const GFileAttributeValue *value,
+ const char **val_out,
+ GError **error)
+{
+ if (value->type != G_FILE_ATTRIBUTE_TYPE_STRING)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+ _("Invalid attribute type (byte string expected)"));
+ return FALSE;
+ }
+
+ *val_out = value->u.string;
+
+ return TRUE;
+}
+
+
+static gboolean
set_unix_mode (char *filename,
const GFileAttributeValue *value,
GError **error)
@@ -1948,6 +1966,52 @@
}
#endif
+
+static gboolean
+set_selinux_context (char *filename,
+ const GFileAttributeValue *value,
+ GError **error)
+{
+ const char *val;
+
+ if (!get_string (value, &val, error))
+ return FALSE;
+
+ if (val == NULL)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+ _("SELinux context must be non-NULL"));
+ return FALSE;
+ }
+
+#ifdef HAVE_SELINUX
+ if (is_selinux_enabled ()) {
+ security_context_t val_s;
+
+ val_s = g_strdup (val);
+
+ if (setfilecon_raw (filename, val_s) < 0)
+ {
+ int errsv = errno;
+
+ g_set_error (error, G_IO_ERROR,
+ g_io_error_from_errno (errsv),
+ _("Error setting SELinux context: %s"),
+ g_strerror (errsv));
+ return FALSE;
+ }
+ g_free (val_s);
+ } else {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+ _("SELinux is not enabled on this system"));
+ return FALSE;
+ }
+#endif
+
+ return TRUE;
+}
+
+
gboolean
_g_local_file_info_set_attribute (char *filename,
const char *attribute,
@@ -1993,6 +2057,11 @@
else if (g_str_has_prefix (attribute, "xattr-sys::"))
return set_xattr (filename, attribute, &value, error);
#endif
+
+#ifdef HAVE_SELINUX
+ else if (strcmp (attribute, G_FILE_ATTRIBUTE_SELINUX_CONTEXT) == 0)
+ return set_selinux_context (filename, &value, error);
+#endif
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Setting attribute %s not supported"), attribute);
@@ -2110,5 +2179,25 @@
/* xattrs are handled by default callback */
+
+ /* SELinux context */
+#ifdef HAVE_SELINUX
+ if (is_selinux_enabled ()) {
+ value = _g_file_info_get_attribute_value (info, G_FILE_ATTRIBUTE_SELINUX_CONTEXT);
+ if (value)
+ {
+ if (!set_selinux_context (filename, value, error))
+ {
+ value->status = G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING;
+ res = FALSE;
+ /* Don't set error multiple times */
+ error = NULL;
+ }
+ else
+ value->status = G_FILE_ATTRIBUTE_STATUS_SET;
+ }
+ }
+#endif
+
return res;
}

View File

@ -1,17 +0,0 @@
diff -up glib-2.23.2/glib/gtestutils.c.abort_msg glib-2.23.2/glib/gtestutils.c
--- glib-2.23.2/glib/gtestutils.c.abort_msg 2010-01-25 18:32:10.793495994 -0500
+++ glib-2.23.2/glib/gtestutils.c 2010-01-25 18:33:23.898497049 -0500
@@ -40,7 +40,12 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
-
+
+/* We can't use the libc variable, since rpm doesn't let us depend on
+ * GLIBC_PRIVATE symbols.
+ */
+#undef HAVE_LIBC_ABORT_MSG
+
/* if we have a recent enough glibc, use its __abort_msg variable for storing
* assertion messages (just like assert()). If not, declare our own variable,
* so that platforms with older glibc or different libc implementations can use

View File

@ -2,13 +2,15 @@
Summary: A library of handy utility functions
Name: glib2
Version: 2.29.14
Version: 2.30.3
Release: 1%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
#VCS: git:git://git.gnome.org/glib
Source: http://download.gnome.org/sources/glib/2.29/glib-%{version}.tar.xz
Source: http://download.gnome.org/sources/glib/2.30/glib-%{version}.tar.xz
Patch0: 0001-closure-fix-handling-of-ENUMs-and-integral-return-ty.patch
BuildRequires: pkgconfig
BuildRequires: gamin-devel
@ -57,6 +59,7 @@ The glib2-static package includes static libraries of the GLib library.
%prep
%setup -q -n glib-%{version}
%patch0 -p1 -b .ffi
%build
# Support builds of both git snapshots and tarballs packed with autogoo
@ -98,7 +101,6 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
%files -f glib20.lang
%defattr(-, root, root, -)
%doc AUTHORS COPYING NEWS README
%{libdir}/libglib-2.0.so.*
%{libdir}/libgthread-2.0.so.*
@ -123,7 +125,6 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
%files devel
%defattr(-, root, root, -)
%{_libdir}/lib*.so
%{_libdir}/glib-2.0
%{_includedir}/*
@ -140,8 +141,8 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
%{_bindir}/gobject-query
%{_bindir}/gtester
%{_bindir}/gdbus-codegen
%dir %{_libdir}/gdbus-codegen
%{_libdir}/gdbus-codegen
%dir %{_libdir}/gdbus-2.0/codegen
%{_libdir}/gdbus-2.0/codegen
%attr (0755, root, root) %{_bindir}/gtester-report
%doc %{_datadir}/gtk-doc/html/*
%doc %{_mandir}/man1/glib-genmarshal.1.gz
@ -157,11 +158,37 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
%files static
%defattr(-, root, root, -)
%{_libdir}/lib*.a
%changelog
* Sun Mar 11 2012 Matthias Clasen <mclasen@redhat.com> - 2.30.3-1
- Update to 2.30.3
* Mon Jan 9 2012 Dan Williams <dcbw@redhat.com> - 2.30.2-1
- Update to 2.30.2
* Fri Oct 14 2011 Matthias Clasen <mclasen@redhat.com> - 2.30.1-1
- Update to 2.30.1
* Wed Oct 05 2011 Dan Williams <dcbw@redhat.com> - 2.30.0-2
- Fix signal marshalling on 64-bit big-endian platforms (rh #736489)
* Mon Sep 26 2011 Ray <rstrode@redhat.com> - 2.30.0-1
- Update to 2.30.0
* Mon Sep 19 2011 Matthias Clasen <mclasen@redhat.com> - 2.29.92-1
- Update to 2.29.92
* Tue Sep 6 2011 Matthias Clasen <mclasen@redhat.com> - 2.29.90-1
- Update to 2.29.90
* Tue Aug 30 2011 Matthias Clasen <mclasen@redhat.com> - 2.29.18-1
- Update to 2.29.18
* Tue Aug 16 2011 Matthias Clasen <mclasen@redhat.com> - 2.29.16-1
- Update to 2.29.16
* Sat Jul 23 2011 Matthias Clasen <mclasen@redhat.com> - 2.29.14-1
- Update to 2.29.14

View File

@ -1,43 +0,0 @@
diff -up glib-2.22.0/configure.in.pyloc glib-2.22.0/configure.in
--- glib-2.22.0/configure.in.pyloc 2009-09-22 09:40:56.000000000 -0400
+++ glib-2.22.0/configure.in 2009-09-23 15:37:23.729418282 -0400
@@ -256,8 +256,10 @@ AC_ARG_WITH(runtime-libdir,
[Install runtime libraries relative to libdir])],
[],
[with_runtime_libdir=""])
-GLIB_RUNTIME_LIBDIR=$with_runtime_libdir
+GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
+ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`"
AC_SUBST(GLIB_RUNTIME_LIBDIR)
+AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR)
AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"])
dnl Checks for programs.
diff -up glib-2.22.0/glib/Makefile.am.pyloc glib-2.22.0/glib/Makefile.am
--- glib-2.22.0/glib/Makefile.am.pyloc 2009-09-22 16:19:35.000000000 -0400
+++ glib-2.22.0/glib/Makefile.am 2009-09-23 15:53:09.109395306 -0400
@@ -380,8 +380,8 @@ libglib-gdb.py: libglib-gdb.py.in
install-data-hook: libglib-gdb.py
- mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load${libdir}
- $(INSTALL) libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load${libdir}/libglib-2.0.so.0.$(LT_CURRENT).0-gdb.py
+ mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
+ $(INSTALL) libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).0-gdb.py
if HAVE_GLIB_RUNTIME_LIBDIR
mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
diff -up glib-2.22.0/gobject/Makefile.am.pyloc glib-2.22.0/gobject/Makefile.am
--- glib-2.22.0/gobject/Makefile.am.pyloc 2009-09-22 16:19:20.000000000 -0400
+++ glib-2.22.0/gobject/Makefile.am 2009-09-23 15:53:18.011645753 -0400
@@ -274,8 +274,8 @@ uninstall-gdb:
-rm -r $(DESTDIR)$(datadir)/gdb
install-data-hook: libgobject-gdb.py
- mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load${libdir}
- $(INSTALL) libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load${libdir}/libgobject-2.0.so.0.$(LT_CURRENT).0-gdb.py
+ mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
+ $(INSTALL) libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).0-gdb.py
if HAVE_GLIB_RUNTIME_LIBDIR
mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)

View File

@ -1 +1 @@
b1154dbc1758df9934f697e90abf5d44 glib-2.29.14.tar.xz
0f9fa329c6c1012d0fd861ad3d8a4520 glib-2.30.3.tar.xz