git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] be paranoid about closed stdin/stdout/stderr

From
Stephen R. van den Berg <srb@cuci.nl>
Date
Aug 28, 2008, 12:52 UTC
Message-ID
<20080828125258.GA16940@cuci.nl>
In-Reply-To
<20080828122142.GA6518@mail.local.tull.net>
Nick Andrew wrote:
>On Wed, Aug 27, 2008 at 02:22:39PM -0400, Avery Pennarun wrote:
>> I'm just feeling protective of the future sanity of other developers
>> here, hoping they don't have to go through what I did on a multi-week
>You're not alone. I've been having trouble with a combination of
>fetchmail, procmail and ssmtp, in which situation the ssmtp program
>_somehow_ sometimes opens /dev/urandom as file descriptor 0 (while
>in controlled circumstances. It's possible that fetchmail or procmail
>is doing something stupid - but a little more defensive programming
>in ssmtp could avoid the total disaster area of sending an endless
>binary stream to an SMTP server.

Procmail I can vouch for, it basically assumes your OS is broken and fights it's way back to sanity (it can be setuid root, so it has to be rather careful). Nonetheless, I still maintain that hiding problems doesn't help, it only makes the bugs even rarer and more difficult to find.

The filedescriptor problem is a programmer-error, not a user-error, which is why not hiding it should be preferred. If it were a user-error, thing would be different, assisting the user is a Good Thing.

-- 
Sincerely,
           Stephen R. van den Berg.

"Listen carefully, I shall say this only wence."
Previous: Nick AndrewNext: Junio C Hamano
Message 25 of 37 in “Fix start_command() pipe bug when stdin is closed.”
  1. Fix start_command() pipe bug when stdin is closed.Karl Chen, Aug 25, 2008
  2. Johannes SixtAug 25, 2008
  3. Paolo BonziniAug 25, 2008
  4. fix start_command() bug when stdin is closedPaolo Bonzini, Aug 25, 2008
  5. Johannes SixtAug 25, 2008
  6. fix start_command() bug when stdin is closedPaolo Bonzini, Aug 25, 2008
  7. Karl ChenAug 25, 2008
  8. Junio C HamanoAug 26, 2008
  9. Junio C HamanoAug 26, 2008
  10. Johannes SixtAug 26, 2008
  11. Paolo BonziniAug 26, 2008
  12. be paranoid about closed stdin/stdout/stderrPaolo Bonzini, Aug 26, 2008
  13. Johannes SixtAug 26, 2008
  14. Stephen R. van den BergAug 26, 2008
  15. Avery PennarunAug 27, 2008
  16. Stephen R. van den BergAug 27, 2008
  17. Paolo BonziniAug 27, 2008
  18. make git-shell paranoid about closed stdin/stdout/stderrPaolo Bonzini, Aug 27, 2008
  19. Stephen R. van den BergAug 27, 2008
  20. Junio C HamanoAug 27, 2008
  21. Paolo BonziniAug 28, 2008
  22. Stephen R. van den BergAug 28, 2008
  23. Avery PennarunAug 27, 2008
  24. Nick AndrewAug 28, 2008
  25. Stephen R. van den BergAug 28, 2008
  26. Junio C HamanoAug 26, 2008
  27. Paolo BonziniAug 26, 2008
  28. Junio C HamanoAug 26, 2008
  29. Junio C HamanoAug 26, 2008
  30. Stephen R. van den BergAug 26, 2008
  31. Karl ChenAug 27, 2008
  32. Paolo BonziniAug 27, 2008
  33. Stephen R. van den BergAug 27, 2008
  34. Johannes SixtAug 27, 2008
  35. Paolo BonziniAug 27, 2008
  36. Nick AndrewAug 27, 2008
  37. Karl ChenAug 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.