gdm r6781 - in trunk: . daemon
- From: halfline svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6781 - in trunk: . daemon
- Date: Mon, 16 Mar 2009 20:15:56 +0000 (UTC)
Author: halfline
Date: Mon Mar 16 20:15:55 2009
New Revision: 6781
URL: http://svn.gnome.org/viewvc/gdm?rev=6781&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/daemon/gdm-display.c
trunk/daemon/gdm-display.h
trunk/daemon/gdm-display.xml
trunk/daemon/gdm-xdmcp-display-factory.c
Modified: trunk/daemon/gdm-display.c
==============================================================================
--- trunk/daemon/gdm-display.c (original)
+++ trunk/daemon/gdm-display.c Mon Mar 16 20:15:55 2009
@@ -416,19 +416,16 @@
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;
Modified: trunk/daemon/gdm-display.h
==============================================================================
--- trunk/daemon/gdm-display.h (original)
+++ trunk/daemon/gdm-display.h Mon Mar 16 20:15:55 2009
@@ -125,8 +125,7 @@
/* 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,
Modified: trunk/daemon/gdm-display.xml
==============================================================================
--- trunk/daemon/gdm-display.xml (original)
+++ trunk/daemon/gdm-display.xml Mon Mar 16 20:15:55 2009
@@ -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"/>
Modified: trunk/daemon/gdm-xdmcp-display-factory.c
==============================================================================
--- trunk/daemon/gdm-xdmcp-display-factory.c (original)
+++ trunk/daemon/gdm-xdmcp-display-factory.c Mon Mar 16 20:15:55 2009
@@ -2281,19 +2281,17 @@
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 @@
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]