inetd fd leak?

Cathey, Jim jcathey at ciena.com
Fri Sep 4 15:54:14 UTC 2009


>Now I guess the only worry is that some implementation
>of syslog won't set FD_CLOEXEC, but even that probably
>wouldn't be a major cause for concern.

I didn't think vforked children shared fd's, only memory maps.
So correct me if I'm wrong, but the problem is that the
child side changed a global, not that it closed the file.
So why not just close the file descriptor on the child side
_without_ changing any globals, like state variables or
buffered I/O streams?  Then it'd be safe even if it _was_
missing FD_CLOEXEC.

-- Jim






More information about the busybox mailing list