After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687691 - gdm occasionally doesn't start up
gdm occasionally doesn't start up
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-05 22:16 UTC by Ray Strode [halfline]
Modified: 2012-11-05 22:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon: allow NULs in X11 cookie (15.80 KB, patch)
2012-11-05 22:16 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2012-11-05 22:16:20 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.
Comment 1 Ray Strode [halfline] 2012-11-05 22:16:22 UTC
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.
Comment 2 Ray Strode [halfline] 2012-11-05 22:16:35 UTC
Attachment 228193 [details] pushed as eaabecd - daemon: allow NULs in X11 cookie