Re: Preventing file descriptor leak to execl'd processes

2021-03-12 Thread Andy Wingo
On Sat 06 Mar 2021 17:55, Marius Bakke writes: > $ ls -l /proc/self/fd > lrwx-- 1 marius marius 64 Mar 6 17:41 0 -> /dev/pts/18 > lrwx-- 1 marius marius 64 Mar 6 17:41 1 -> /dev/pts/18 > lrwx-- 1 marius marius 64 Mar 6 17:41 2 -> /dev/pts/18 > lr-x-- 1 marius marius 64 Mar 6 1

Re: Preventing file descriptor leak to execl'd processes

2021-03-06 Thread Maxime Devos
On Sat, 2021-03-06 at 17:55 +0100, Marius Bakke wrote: > Hello Guilers, > > [...] > > It works great, except that the script filename (/tmp/test-shell) has > an open file descriptor which leaks into the new process: > > [...] > > I've managed to work around it by setting FD_CLOEXEC on it: > >

Preventing file descriptor leak to execl'd processes

2021-03-06 Thread Marius Bakke
Hello Guilers, I recently had the insa^W bright idea of making my login shell a Guile script instead of fiddling so much with bashrc and the likes. For example, here is how I start my window manager when logging into TTY2 or TTY3: $ cat /tmp/test-shell #!/gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l