diff --git a/0001-Fix-for-BGO-641338-Gracefully-handle-errors-listenin.patch b/0001-Fix-for-BGO-641338-Gracefully-handle-errors-listenin.patch new file mode 100644 index 0000000..f836095 --- /dev/null +++ b/0001-Fix-for-BGO-641338-Gracefully-handle-errors-listenin.patch @@ -0,0 +1,76 @@ +From 7a04aebc85d20b9c31850b5615f040ec208134c3 Mon Sep 17 00:00:00 2001 +From: Mike Gorse +Date: Sun, 6 Feb 2011 13:57:55 -0600 +Subject: [PATCH 1/2] Fix for BGO#641338: Gracefully handle errors listening to dbus server for p2p + +--- + atk-adaptor/bridge.c | 10 ++++++++-- + atk-adaptor/event.c | 5 +++-- + po/POTFILES.in | 1 + + 3 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c +index e856c82..0baf6f8 100644 +--- a/atk-adaptor/bridge.c ++++ b/atk-adaptor/bridge.c +@@ -37,6 +37,7 @@ + + #include + #include ++#include + + #include "bridge.h" + #include "event.h" +@@ -527,10 +528,15 @@ setup_bus (void) + + dbus_error_init(&err); + server = dbus_server_listen(spi_global_app_data->app_bus_addr, &err); +- +- /* is there a better way to handle this */ + if (server == NULL) ++ { ++ g_warning (_("atk-bridge: Couldn't listen on dbus server: %s"), err.message); ++ dbus_error_init (&err); ++ spi_global_app_data->app_bus_addr [0] = '\0'; ++ g_main_context_unref (spi_global_app_data->main_context); ++ spi_global_app_data->main_context = NULL; + return -1; ++ } + + dbus_server_setup_with_g_main(server, NULL); + dbus_server_set_new_connection_function(server, new_connection_cb, NULL, NULL); +diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c +index cc1877a..81a0f34 100644 +--- a/atk-adaptor/event.c ++++ b/atk-adaptor/event.c +@@ -55,15 +55,16 @@ typedef struct _SpiReentrantCallClosure + static void + switch_main_context (GMainContext *cnx) + { +-#ifndef DISABLE_P2P + /* This code won't work on dbus-glib earlier than 0.9.0 because of FDO#30574 */ ++ if (spi_global_app_data->app_bus_addr [0] == '\0') ++ return; ++ + GList *list; + + dbus_server_setup_with_g_main (spi_global_app_data->server, cnx); + dbus_connection_setup_with_g_main (spi_global_app_data->bus, cnx); + for (list = spi_global_app_data->direct_connections; list; list = list->next) + dbus_connection_setup_with_g_main (list->data, cnx); +-#endif + } + + static void +diff --git a/po/POTFILES.in b/po/POTFILES.in +index ebb0efe..2d9aefd 100644 +--- a/po/POTFILES.in ++++ b/po/POTFILES.in +@@ -1,3 +1,4 @@ + # List of source files containing translatable strings. + # Please keep this file sorted alphabetically. + at-spi2.schemas.in ++atk-adaptor/bridge.c +-- +1.7.4 + diff --git a/0002-tmp-at-spi2-should-be-created-with-permissions-of-0x.patch b/0002-tmp-at-spi2-should-be-created-with-permissions-of-0x.patch new file mode 100644 index 0000000..386e235 --- /dev/null +++ b/0002-tmp-at-spi2-should-be-created-with-permissions-of-0x.patch @@ -0,0 +1,37 @@ +From 901fe4058f776cefb4cbea0bd160d2fd1b7f9d3b Mon Sep 17 00:00:00 2001 +From: Mike Gorse +Date: Sun, 6 Feb 2011 14:10:09 -0600 +Subject: [PATCH 2/2] /tmp/at-spi2 should be created with permissions of 0x1777 + +--- + atk-adaptor/bridge.c | 13 +++++++------ + 1 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c +index 0baf6f8..d03f0c3 100644 +--- a/atk-adaptor/bridge.c ++++ b/atk-adaptor/bridge.c +@@ -317,13 +317,14 @@ register_application (SpiBridge * app) + if (message) + dbus_message_unref (message); + +-/* could this be better, we accept some amount of race in getting the temp name*/ +-/* make sure the directory exists */ +-mkdir("/tmp/at-spi2/", S_IRWXU); +-app->app_bus_addr = g_malloc(max_addr_length * sizeof(char)); ++ /* could this be better, we accept some amount of race in getting the temp name*/ ++ /* make sure the directory exists */ ++ mkdir ("/tmp/at-spi2/", S_IRWXU|S_IRWXG|S_IRWXO|S_ISVTX); ++ chmod ("/tmp/at-spi2/", S_IRWXU|S_IRWXG|S_IRWXO|S_ISVTX); ++ app->app_bus_addr = g_malloc(max_addr_length * sizeof(char)); + #ifndef DISABLE_P2P +-sprintf(app->app_bus_addr, "unix:path=/tmp/at-spi2/socket-%d-%d", getpid(), +-rand()); ++ sprintf (app->app_bus_addr, "unix:path=/tmp/at-spi2/socket-%d-%d", getpid(), ++ rand()); + #else + app->app_bus_addr [0] = '\0'; + #endif +-- +1.7.4 + diff --git a/at-spi2-atk-1.91.6-crasher-revert.patch b/at-spi2-atk-1.91.6-crasher-revert.patch deleted file mode 100644 index f19c806..0000000 --- a/at-spi2-atk-1.91.6-crasher-revert.patch +++ /dev/null @@ -1,124 +0,0 @@ -diff -Nru -x '*.gmo' -x '*.mo' --speed-large-files --minimal at-spi2-atk-1.91.5/atk-adaptor/adaptors/component-adaptor.c at-spi2-atk-1.91.6/atk-adaptor/adaptors/component-adaptor.c ---- at-spi2-atk-1.91.5/atk-adaptor/adaptors/component-adaptor.c 2010-06-23 13:20:49.000000000 +0000 -+++ at-spi2-atk-1.91.6/atk-adaptor/adaptors/component-adaptor.c 2011-01-26 22:53:49.000000000 +0000 -@@ -291,6 +291,110 @@ - return reply; - } - -+static DBusMessage * -+impl_SetExtents (DBusConnection * bus, DBusMessage * message, void *user_data) -+{ -+ AtkComponent *component = (AtkComponent *) user_data; -+ DBusMessageIter iter, iter_struct; -+ dbus_uint32_t coord_type; -+ dbus_int32_t x, y, width, height; -+ dbus_bool_t ret; -+ DBusMessage *reply; -+ -+ g_return_val_if_fail (ATK_IS_COMPONENT (user_data), -+ droute_not_yet_handled_error (message)); -+ -+ if (strcmp (dbus_message_get_signature (message), "(iiii)u") != 0) -+ { -+ return droute_invalid_arguments_error (message); -+ } -+ -+ dbus_message_iter_init (message, &iter); -+ dbus_message_iter_recurse (&iter, &iter_struct); -+ dbus_message_iter_get_basic (&iter_struct, &x); -+ dbus_message_iter_next (&iter_struct); -+ dbus_message_iter_get_basic (&iter_struct, &y); -+ dbus_message_iter_next (&iter_struct); -+ dbus_message_iter_get_basic (&iter_struct, &width); -+ dbus_message_iter_next (&iter_struct); -+ dbus_message_iter_get_basic (&iter_struct, &height); -+ dbus_message_iter_next (&iter_struct); -+ dbus_message_iter_next (&iter); -+ dbus_message_iter_get_basic (&iter, &coord_type); -+ -+ ret = atk_component_set_extents (component, x, y, width, height, coord_type); -+ -+ reply = dbus_message_new_method_return (message); -+ if (reply) -+ { -+ dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret, -+ DBUS_TYPE_INVALID); -+ } -+ -+ return reply; -+} -+ -+static DBusMessage * -+impl_SetPosition (DBusConnection * bus, DBusMessage * message, void *user_data) -+{ -+ AtkComponent *component = (AtkComponent *) user_data; -+ dbus_uint32_t coord_type; -+ dbus_int32_t x, y; -+ dbus_bool_t ret; -+ DBusMessage *reply; -+ -+ g_return_val_if_fail (ATK_IS_COMPONENT (user_data), -+ droute_not_yet_handled_error (message)); -+ -+ if (!dbus_message_get_args -+ (message, NULL, DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, -+ DBUS_TYPE_UINT32, &coord_type, DBUS_TYPE_INVALID)) -+ { -+ return droute_invalid_arguments_error (message); -+ } -+ -+ ret = atk_component_set_position (component, x, y, coord_type); -+ -+ reply = dbus_message_new_method_return (message); -+ if (reply) -+ { -+ dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret, -+ DBUS_TYPE_INVALID); -+ } -+ -+ return reply; -+} -+ -+static DBusMessage * -+impl_SetSize (DBusConnection * bus, DBusMessage * message, void *user_data) -+{ -+ AtkComponent *component = (AtkComponent *) user_data; -+ dbus_int32_t width, height; -+ dbus_bool_t ret; -+ DBusMessage *reply; -+ -+ g_return_val_if_fail (ATK_IS_COMPONENT (user_data), -+ droute_not_yet_handled_error (message)); -+ -+ if (!dbus_message_get_args -+ (message, NULL, DBUS_TYPE_INT32, &width, DBUS_TYPE_INT32, &height, -+ DBUS_TYPE_INVALID)) -+ { -+ return droute_invalid_arguments_error (message); -+ } -+ -+ ret = atk_component_set_size (component, width, height); -+ -+ reply = dbus_message_new_method_return (message); -+ if (reply) -+ { -+ dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &ret, -+ DBUS_TYPE_INVALID); -+ } -+ -+ return reply; -+} -+ - static DRouteMethod methods[] = { - {impl_contains, "contains"}, - {impl_GetAccessibleAtPoint, "GetAccessibleAtPoint"}, -@@ -303,6 +407,9 @@ - //{impl_registerFocusHandler, "registerFocusHandler"}, - //{impl_deregisterFocusHandler, "deregisterFocusHandler"}, - {impl_GetAlpha, "GetAlpha"}, -+ {impl_SetExtents, "SetExtents"}, -+ {impl_SetPosition, "SetPosition"}, -+ {impl_SetSize, "SetSize"}, - {NULL, NULL} - }; - diff --git a/at-spi2-atk.spec b/at-spi2-atk.spec index 023fb83..ab80bdb 100644 --- a/at-spi2-atk.spec +++ b/at-spi2-atk.spec @@ -1,6 +1,6 @@ Name: at-spi2-atk Version: 1.91.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A GTK+ module that bridges ATK to D-Bus at-spi Group: System Environment/Libraries @@ -20,9 +20,9 @@ BuildRequires: intltool Requires: at-spi2-core -# Revert crasher that got into 1.91.6 # https://bugzilla.gnome.org/show_bug.cgi?id=641338 -Patch0: at-spi2-atk-1.91.6-crasher-revert.patch +Patch0: 0001-Fix-for-BGO-641338-Gracefully-handle-errors-listenin.patch +Patch1: 0002-tmp-at-spi2-should-be-created-with-permissions-of-0x.patch %description at-spi allows assistive technologies to access GTK-based @@ -40,7 +40,8 @@ D-Bus based at-spi. %prep %setup -q -%patch0 -p1 -R -b .crasher +%patch0 -p1 -b .crasher +%patch1 -p1 -b .p2p-perms %build %configure --disable-relocate @@ -80,6 +81,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas %changelog +* Mon Feb 07 2011 Bastien Nocera 1.91.6-3 +- Add upstream patches to fix crashers + * Fri Feb 04 2011 Bastien Nocera 1.91.6-2 - Revert crashy part of 1.91.6 release