[PATCH 2/2] Xinit: close stdin to avoid leak of file descriptior to the Xorg session.
Ray Strode
halfline at gmail.com
Tue Jul 26 12:23:23 PDT 2011
Hi,
On Tue, Jul 26, 2011 at 2:57 PM, Jeremy Huddleston <jeremyhu at apple.com> wrote:
> yick... ok, well I'd suggest making that its own patch rather than squashed > into the stdin one... I dunno how I feel about it and will let others chime in...
It's two pieces of the same thing. There's not much point in setting
stdin to /dev/null but leaving the controlling tty the same. The
point of all the steps (as I see it anyway) is a common end goal of
detaching the new X session that's getting launched from the existing
session running on the tty. Another way you could think of it, is it's
basically doing the same fork()/close/dup2/setsid dance a libc
daemon() call would do but without the final exit-in-parent.
--Ray
More information about the xorg-devel
mailing list