[gdm/wip/slave-connection: 20/36] daemon: NUL terminate X11 cookie



commit 89a820f4874ee7e46f49baa799c1b2f0b8767a63
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sat Jul 7 19:55:23 2012 -0400

    daemon: NUL terminate X11 cookie
    
    The X11 cookie is used as a shared secret between X clients
    and the X server.  This cookie is written into an Xauthority
    file pointed to by the XAUTHORITY environment variable.  In the
    event standard peer-credential based access isn't available, clients
    read this file and gain authorization to use the X server by
    presenting the cookie to the X server.
    
    This cookie is passed from the gdm daemon to the slave over the bus
    as an array of bytes. GDBus expects bytes strings to be NUL terminated.
    
    This commit NUL terminates the cookie, so that it will be compatible
    with GDBus's generated code.

 daemon/gdm-display.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index e885bdf..ccc1ff6 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -431,7 +431,7 @@ gdm_display_get_x11_cookie (GdmDisplay *display,
         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
 
         if (x11_cookie != NULL) {
-                *x11_cookie = g_array_new (FALSE, FALSE, sizeof (char));
+                *x11_cookie = g_array_new (TRUE, FALSE, sizeof (char));
                 g_array_append_vals (*x11_cookie,
                                      display->priv->x11_cookie,
                                      display->priv->x11_cookie_size);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]