<p dir="ltr">Exactly. As I said earlier, if you forget to clear FD_CLOEXEC when you meant to then your program breaks loudly and obviously; if you forget to *set* FD_CLOEXEC then the bug is much quieter and more subtle.</p>
<p dir="ltr">I asked for a specific example of some existing code that would be broken by this, but none was forthcoming. I understand why, in theory, changing this would be a problem (indeed, changing anything is similarly problematic) but in practice the pros enormously outweigh the cons here.</p>
<div class="gmail_quote">On 30 Aug 2015 11:17 pm, "Niklas Hambüchen" <<a href="mailto:mail@nh2.me">mail@nh2.me</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 30/08/15 16:59, Donn Cave wrote:<br>
> Quoth Niklas Hambüchen <<a href="mailto:mail@nh2.me">mail@nh2.me</a>>,<br>
> ... and you go on to demonstrate that you didn't really take the point<br>
> I was trying to make.  How did you find out about this flock(2) scenario?<br>
> Do you suppose that this is the only one, because you and I don't know<br>
> of any more?<br>
<br>
No, I do take your point, and I admit that more things may break when<br>
changing the default.<br>
<br>
What I'm saying is that such cases are relatively easy to find. When you<br>
rely on inheriting FDs, you know it.<br>
It is exotic enough that when you've built something that needs it,<br>
you'll remember it.<br>
<br>
This leads me to think that the damage done / cost to fix introduced by<br>
breaking the backwards compatibility here might be smaller than the<br>
damage / fixing that will arise in the future from surprising behaviour<br>
and security/privilege problems through leaked FDs in all non-exotic<br>
programs that want to exec() something. I'd assume the Python and Perl<br>
people came to this conclusion.<br>
<br>
Further, our community is small, and if you announce something loud and<br>
long-term via mailing list and Reddit, it will go a long way and make it<br>
unlikely that somebody will be unaware of such a change. Your point that<br>
we may break things that we don't know of / understand still stands though.<br>
<br>
Regarding pipes and sockets, pipe()/socket() accept CLOEXEC as well.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>