summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2009-03-16 20:15:55 +0000
committerRay Strode <halfline@src.gnome.org>2009-03-16 20:15:55 +0000
commit5e464319bdccf9a9c68496d31592ccf7766ce1a3 (patch)
treec69cebc9c3c81fb720d64a706c1e9302f683e58e
parent8a3490706e1a85d8607a117a0387e83764dfc9db (diff)
downloadgdm-5e464319bdccf9a9c68496d31592ccf7766ce1a3.tar.gz
Fix the GetX11Cookie dbus method Send the cookie as a byte array instead
2009-03-16 Ray Strode <rstrode@redhat.com> Fix the GetX11Cookie dbus method * daemon/gdm-display.xml: Send the cookie as a byte array instead of utf-8 string * daemon/gdm-display.[ch] (gdm_display_get_x11_cookie): pass in a GArray instead of the more natural char array and size pointers to make dbus-glib happy. * daemon/gdm-xdmcp-display-factory.c (gdm_xdmcp_handle_request): Update to use new get_x11_cookie signature. svn path=/trunk/; revision=6781
-rw-r--r--ChangeLog16
-rw-r--r--daemon/gdm-display.c13
-rw-r--r--daemon/gdm-display.h3
-rw-r--r--daemon/gdm-display.xml2
-rw-r--r--daemon/gdm-xdmcp-display-factory.c14
5 files changed, 30 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index a8e29575..bbb59b08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
2009-03-16 Ray Strode <rstrode@redhat.com>
+ Fix the GetX11Cookie dbus method
+ * daemon/gdm-display.xml:
+ Send the cookie as a byte array instead of utf-8
+ string
+
+ * daemon/gdm-display.[ch] (gdm_display_get_x11_cookie):
+ pass in a GArray instead of the more natural
+ char array and size pointers to make dbus-glib
+ happy.
+
+ * daemon/gdm-xdmcp-display-factory.c
+ (gdm_xdmcp_handle_request): Update to use new
+ get_x11_cookie signature.
+
+2009-03-16 Ray Strode <rstrode@redhat.com>
+
* data/greeter-autostart/gnome-power-manager.desktop.in.in:
Don't try to start gnome-power-manager in Initialization
phase, since it doesn't know to register with the
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 323d941c..671857aa 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -416,19 +416,16 @@ gdm_display_remove_user_authorization (GdmDisplay *display,
gboolean
gdm_display_get_x11_cookie (GdmDisplay *display,
- char **x11_cookie,
- gsize *x11_cookie_size,
+ GArray **x11_cookie,
GError **error)
{
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
if (x11_cookie != NULL) {
- *x11_cookie = g_memdup (display->priv->x11_cookie,
- display->priv->x11_cookie_size);
- }
-
- if (x11_cookie_size != NULL) {
- *x11_cookie_size = display->priv->x11_cookie_size;
+ *x11_cookie = g_array_new (FALSE, FALSE, sizeof (char));
+ g_array_append_vals (*x11_cookie,
+ display->priv->x11_cookie,
+ display->priv->x11_cookie_size);
}
return TRUE;
diff --git a/daemon/gdm-display.h b/daemon/gdm-display.h
index 2914c81b..607ea1d4 100644
--- a/daemon/gdm-display.h
+++ b/daemon/gdm-display.h
@@ -125,8 +125,7 @@ gboolean gdm_display_get_timed_login_details (GdmDisplay *disp
/* exported but protected */
gboolean gdm_display_get_x11_cookie (GdmDisplay *display,
- char **x11_cookie,
- gsize *cookie_size,
+ GArray **x11_cookie,
GError **error);
gboolean gdm_display_get_x11_authority_file (GdmDisplay *display,
char **filename,
diff --git a/daemon/gdm-display.xml b/daemon/gdm-display.xml
index e8a23692..a92e37fc 100644
--- a/daemon/gdm-display.xml
+++ b/daemon/gdm-display.xml
@@ -11,7 +11,7 @@
<arg name="name" direction="out" type="i"/>
</method>
<method name="GetX11Cookie">
- <arg name="x11_cookie" direction="out" type="s"/>
+ <arg name="x11_cookie" direction="out" type="ay"/>
</method>
<method name="GetX11AuthorityFile">
<arg name="filename" direction="out" type="s"/>
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 05d0261b..724717ce 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -2281,19 +2281,17 @@ gdm_xdmcp_handle_request (GdmXdmcpDisplayFactory *factory,
ARRAY8 authorization_name;
ARRAY8 authorization_data;
gint32 session_number;
- char *cookie;
- gsize cookie_size;
+ GArray *cookie;
char *name;
- gdm_display_get_x11_cookie (display, &cookie,
- &cookie_size, NULL);
+ gdm_display_get_x11_cookie (display, &cookie, NULL);
gdm_display_get_x11_display_name (display, &name, NULL);
g_debug ("GdmXdmcpDisplayFactory: Sending authorization key for display %s", name);
g_free (name);
- g_debug ("GdmXdmcpDisplayFactory: cookie len %d", (int) cookie_size);
+ g_debug ("GdmXdmcpDisplayFactory: cookie len %d", (int) cookie->len);
session_number = gdm_xdmcp_display_get_session_number (GDM_XDMCP_DISPLAY (display));
@@ -2308,8 +2306,10 @@ gdm_xdmcp_handle_request (GdmXdmcpDisplayFactory *factory,
authorization_name.data = (CARD8 *) "MIT-MAGIC-COOKIE-1";
authorization_name.length = strlen ((char *) authorization_name.data);
- authorization_data.data = (CARD8 *) cookie;
- authorization_data.length = cookie_size;
+ authorization_data.data = (CARD8 *) cookie->data;
+ authorization_data.length = cookie->len;
+
+ g_array_free (cookie, TRUE);
/* the addrs are NOT copied */
gdm_xdmcp_send_accept (factory,