[PATCH 2/2] Xinit: close stdin to avoid leak of file descriptior to the Xorg session.

Lennart Poettering lennart at poettering.net
Tue Jul 26 13:42:03 PDT 2011


On Tue, 26.07.11 16:34, Ray Strode (halfline at gmail.com) wrote:

> The example serves to show that redirecting STDIN to /dev/null
> partially solves the same problem setsid partially solves.That problem
> is "detaching X clients from the tty startx was run on".
> 
> Or is there another problem being solved, that you have in mind?

I didn't really follow the discussion here, just wanted to note that
there's quite a bit of software that relies that the X server is the
controlling process of /dev/ttyX for the VT it is running on.

ConsoleKit uses this to figure out the VT that a specific X server ended
up using without having to connect to it. In fact in pam_systemd there's
a similar hack to figure out the same information if it isn't specified
explicitly when setting up the session. (In CK it's the primary path to
determine this information, in pam_systemd just a fallback)

What I am trying to say here basically: if you are planning to invoke
setsid() or detach from the controlling tty otherwise in the normal X
servers, then you'll break existing code. And I'd like to ask you not to
do that...

But then again, I didn't really follow the discussion and maybe you are
discussing something compltely different.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the xorg-devel mailing list