GNOME Bugzilla – Bug 776059
Some xdmcp related fixes
Last modified: 2016-12-15 19:56:46 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.
Created attachment 341912 [details] [review] display: close X11 connection We're opening an X11 connection but never closing it, this commit fixes that.
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.
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.
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.
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)
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