Package: libgksu1.2
Version: 1.3.1-1
Severity: important
Tags: patch

Currently, libgksu defines a callback function (keyring_create_item_cb)
inside another function. The problem is that this callback function
is stored on the stack (like any other local variable). amd64 has this
famous NX flag which prevent execution of the stack. So when the
callback stored on the stack is called, it simply segfault.
The fix is very simple: move keyring_create_item_cb callback definition
outside of the function.
The attached patch fix this issue.

BTW: this patch should also close #307975

Aurel
--- libgksu/gksu-context.c.orig 2005-07-13 01:29:24.000000000 +0200
+++ libgksu/gksu-context.c      2005-07-13 01:30:36.000000000 +0200
@@ -784,6 +784,13 @@
   return TRUE;
 }
 
+static void
+keyring_create_item_cb (GnomeKeyringResult result,
+                        guint32 id, gpointer keyring_loop)
+{
+  g_main_loop_quit (keyring_loop);
+}
+
 /**
  * gksu_context_run:
  * @context: a #GksuContext
@@ -989,20 +996,14 @@
       
                      keyring_loop = g_main_loop_new (NULL, FALSE);
 
-                     void
-                       keyring_create_item_cb (GnomeKeyringResult result,
-                                               guint32 id, gpointer data)
-                       {
-                         g_main_loop_quit (keyring_loop);
-                       }
-
                      gnome_keyring_item_create (NULL,
                                                 
GNOME_KEYRING_ITEM_GENERIC_SECRET,
                                                 key_name,
                                                 attributes,
                                                 gksu_context_get_password 
(context),
                                                 TRUE,
-                                                keyring_create_item_cb, NULL, 
NULL);
+                                                keyring_create_item_cb,
+                                                keyring_loop, NULL);
                      gnome_keyring_attribute_list_free (attributes);
                      g_main_loop_run (keyring_loop);
                    }

Reply via email to