Please add an option which prevents the closing of upper fds (3 .. _SC_OPEN_MAX). I have an application (kismet) which starts a helper program (kismet_capture) through consolehelper and both are communicating through a previously opened socket. This socket will be closed by consolehelper atm.
I hacked around this issue by writing yet another wrapper which dup2's this socket to fd 0 (which is not touched). But this does not scale very well...
Thanks for your report.
The request makes sense, I'm a bit worried about the implementation specifics - the determination whether to close the file descriptors or not would have to happen after most code in userhelper was already executed.
At the very least, the file descriptors should be closed in the privileged userhelper, not in its callers.
(It's not likely I'll have time to work on this in the next few weeks, a patch would definitely speed things up.)
Looking at this more, userhelper internally uses FDs 3 and 4, so the modifications would have to be more involved (probably specifying the FDs for userhelper <-> consolehelper-gtk communication on the command line).
Metadata Update from @mitr:
- Issue assigned to mitr
to comment on this ticket.