awesome-devel  

Leaking FDs to childs started by awful.util.spawn() and close-on-exec

Uli Schlachter
Thu, 02 Apr 2009 03:58:12 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

recently I noticed that all my processes had a pipe as FD 3 and 4 which seemed
to come from awesome. Some investigation revealed that they come from my
.xsession (I don't know why yet), but I also found cases where awesome leaked
FDs to child processes (sockets to awesome-clients, to be exact).

I wrote a couple of patches to address this. strace showed that this patch
causes the close-on-exec flag to be set multiple times on some sockets, but I
think it's better to be safe. If it's libev which sometimes sets the flag (which
I suspect), then I don't know why the sockets to awesome-clients don't get this
flag.

For testing that this is real, I started an xterm through awesome-client.
"ls -l /proc/self/fd" told me that fd 10 was the only socket it had and
"echo test >&10" displayed "test" in awesome-client when I ran the next command.

Cheers,
Uli

P.S.: I'm sending the patches by hand, no idea how fast I'll be.
- --
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknUmjMACgkQABixOSrV99/HMgCfW1NdzEJsqq6pR4FJ4ql6qh4U
5AgAoJfm1oyPx/PX6aYXPZOmqG999gKi
=NgZN
-----END PGP SIGNATURE-----

-- 
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.