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 776059 - Some xdmcp related fixes
Some xdmcp related fixes
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-13 19:57 UTC by Ray Strode [halfline]
Modified: 2016-12-15 19:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
display: close X11 connection (2.77 KB, patch)
2016-12-13 19:57 UTC, Ray Strode [halfline]
committed Details | Review
display: port GdmDisplay to xcb (28.54 KB, patch)
2016-12-13 19:58 UTC, Ray Strode [halfline]
committed Details | Review
xdmcp-display-factory: notify remote display when session ended (6.86 KB, patch)
2016-12-13 19:58 UTC, Ray Strode [halfline]
committed Details | Review
worker: kill process group when session exits (2.73 KB, patch)
2016-12-13 19:58 UTC, Ray Strode [halfline]
committed Details | Review
slave: kill off clients from display when finished (3.49 KB, patch)
2016-12-13 19:58 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2016-12-13 19:57:05 UTC
Below are some fixes related to XDMCP handling. In particular, we try
really hard to scrub the display of clients, so they don't linger when
we aren't in control of the X server.

We also switch to using XCB for two reasons:

1) XCB won't kill the main daemon process when the X server goes away
2) XCB has a way to query the client id range and xlib doesn't

This is all pretty yucky, but it's better (and more reliable) than the other
alternative I came up with using longjmp.
Comment 1 Ray Strode [halfline] 2016-12-13 19:57:56 UTC
Created attachment 341912 [details] [review]
display: close X11 connection

We're opening an X11 connection but never closing it, this
commit fixes that.
Comment 2 Ray Strode [halfline] 2016-12-13 19:58:00 UTC
Created attachment 341913 [details] [review]
display: port GdmDisplay to xcb

Xlib will kill the process if it notices the display connection has
gone away. This is suboptimal for the main gdm process!

This commit ports the Xlib code to xcb, so it won't have the above
fragility.
Comment 3 Ray Strode [halfline] 2016-12-13 19:58:04 UTC
Created attachment 341914 [details] [review]
xdmcp-display-factory: notify remote display when session ended

gnome-shell and the session dbus daemon don't automatically exit
when gnome-session does.  They, instead, wait for the display to
exit or regenerate. If the display is remote, that won't happen
until the keep alive timeout.

This commit changes GDM to explicitly notify the remote display
when the session is over, so that it can regenerate immediately.
Comment 4 Ray Strode [halfline] 2016-12-13 19:58:08 UTC
Created attachment 341915 [details] [review]
worker: kill process group when session exits

Send a hangup signal to the session pg when it exits, so things
have a chance to get cleaned up.
Comment 5 Ray Strode [halfline] 2016-12-13 19:58:12 UTC
Created attachment 341916 [details] [review]
slave: kill off clients from display when finished

When we're done with the display we need to kill off any clients
that are lingering and close our own connection to the display.

This is so, for instance, processes from the session don't
stick around on a -noreset Xvnc server (or something)
Comment 6 Ray Strode [halfline] 2016-12-15 19:56:30 UTC
Attachment 341912 [details] pushed as c27fdd9 - display: close X11 connection
Attachment 341913 [details] pushed as ca90061 - display: port GdmDisplay to xcb
Attachment 341914 [details] pushed as 6ae733e - xdmcp-display-factory: notify remote display when session ended
Attachment 341915 [details] pushed as 3d3b47b - worker: kill process group when session exits
Attachment 341916 [details] pushed as a35135a - slave: kill off clients from display when finished