Why dup(), again and again?

David Newall openssh at davidnewall.com
Sun Oct 22 18:21:41 AEDT 2017


On 22/10/17 09:07, Damien Miller wrote:
>> WHAT CAN I DO TO HELP STEWARD THIS CHANGE INTO THE MASTER SOURCE?
>> What do I need to do?
> Stop yelling and go file a bug at https://bugzilla.mindrot.org/

I am not yelling.  I have donated days of my valuable time finding and 
understanding a bug, and I'm donating even more trying to get it fixed.

> As I mentioned previously, your suggested change is wrong

you say it's wrong, but you've come up with a bad idea:

> we'd (at least) need to replace fd 1 with /dev/null prior to assigning
> it to the channel.

The channel fd is already closed.  You want to keep ssh's stdout open, 
by assigning it to /dev/null?  Why would anybody do that?  (By all 
means, do that.  The problem will go away, but it's wrong.)

When you suggested this before, I asked how that would help, but you 
haven't answered that.  Instead, you belatedly repeat yourself.  You 
said that you think this is good for "ill-behaved libraries". That's 
wrong.  Any "ill-behaved library" on the remote machine already writes 
to a closed descriptor.  You've presented a straw man, but I'm trying to 
understand your concern: If you think that ssh (i.e. on the local 
machine) uses an ill-behaved library, which one; and, what's wrong with 
letting it try to write to a closed file?

I don't think you are trying to help.


More information about the openssh-unix-dev mailing list