summaryrefslogtreecommitdiff
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:29:07 -0400
commitc06ef826167298b56d29e77bf37194ecb6983ff5 (patch)
tree44f13dc6cd6812bdc6d66e1aad7696742f20c92c
parent3384a514b694f14dd09c78e138bba849e65e42bd (diff)
downloadgdm-c06ef826167298b56d29e77bf37194ecb6983ff5.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.
-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);