summaryrefslogtreecommitdiff
path: root/daemon/gdm-display.c
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2012-07-07 19:55:23 -0400
committerRay Strode <rstrode@redhat.com>2012-07-17 03:38:10 -0400
commit0478d42218f7ba14db4d6952d4f92701d673ba9c (patch)
tree80bd234649cde8054bb660d42c9738df4e080d56 /daemon/gdm-display.c
parentc417ebc2f2efd9e4198e29b482f4b610ab056683 (diff)
downloadgdm-0478d42218f7ba14db4d6952d4f92701d673ba9c.tar.gz
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.
Diffstat (limited to 'daemon/gdm-display.c')
-rw-r--r--daemon/gdm-display.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index be1d5e05..7a6b4b38 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);