4 ms·
Other comments have mentioned _how_, I figured I'd mention a couple of scenarios that this could create. Programs that fork/exec will typically close all their
by anitil 4y ago
Other comments have mentioned _how_, I figured I'd mention a couple of scenarios that this could create.
Programs that fork/exec will typically close all their open file descriptors, so if a close fails (like an EINTR) it's possible a child could inherit an open file descriptor for a file that they otherwise wouldn't have access to.
File descriptors are also a finite resource so if you're opening and closing thousands of files you could run out.
Both situations are unlikely, but I'm sure somebody has had their day ruined by these.