GNOME Bugzilla – Bug 687691
gdm occasionally doesn't start up
Last modified: 2012-11-05 22:16:37 UTC
I've noticed GDM doesn't always start on boot. In very rare circumstances it fails. I did some tracing and determined the X server was refusing the auth cookie setup by GDM. I think this is because of this line in the code: XSetAuthorization ("MIT-MAGIC-COOKIE-1", strlen ("MIT-MAGIC-COOKIE-1"), slave->priv->display_x11_cookie, strlen (slave->priv->display_x11_cookie)); It obviously won't work if display_x11_cookie has embedded NULs. I don't know why the XAUTHORITY fallback code is failing in this case, but I think it might be related to the hostname getting set at start up.
Created attachment 228193 [details] [review] 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.
Attachment 228193 [details] pushed as eaabecd - daemon: allow NULs in X11 cookie