diff options
author | Ray Strode <rstrode@redhat.com> | 2012-11-05 17:07:05 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2012-11-05 17:16:21 -0500 |
commit | eaabecd70f79c89f6bfd912557c0cbb7718d4c63 (patch) | |
tree | 7604c4a1f5388f2a8481be67441890176dde5aad /daemon/gdm-display.c | |
parent | 0f2e987a1e15ec0355835ed1c7793abdc759f2af (diff) | |
download | gdm-eaabecd70f79c89f6bfd912557c0cbb7718d4c63.tar.gz |
daemon: allow NULs in X11 cookie
We currently allow the slave access to its X server via two
mechanisms:
1) we set XAUTHORITY to point to the X servers Xauthority file
2) we call XSetAuthorization with the cookie from the Xauthority file
1) may fail if the user's hostname changes at the wrong moment, and
a bug in the code meant that 2 would fail if NULs are encoded in the
auth cookie.
This commit fixes 2) to work with embedded NUL bytes.
https://bugzilla.gnome.org/show_bug.cgi?id=687691
Diffstat (limited to 'daemon/gdm-display.c')
-rw-r--r-- | daemon/gdm-display.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c index 42f5990b..435dc1ca 100644 --- a/daemon/gdm-display.c +++ b/daemon/gdm-display.c @@ -1106,10 +1106,15 @@ handle_get_x11_cookie (GdmDBusDisplay *skeleton, GdmDisplay *display) { GArray *cookie = NULL; + GVariant *variant; gdm_display_get_x11_cookie (display, &cookie, NULL); - gdm_dbus_display_complete_get_x11_cookie (skeleton, invocation, cookie->data); + variant = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, + cookie->data, + cookie->len, + sizeof (char)); + gdm_dbus_display_complete_get_x11_cookie (skeleton, invocation, variant); g_array_unref (cookie); return TRUE; |