Re: Why dup()?

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On 14/10/17 07:44, Damien Miller wrote:
On Fri, 13 Oct 2017, David Newall wrote:
On 13/10/17 16:22, Damien Miller wrote:
  > At a minimum, I think we'd have to dup2 a fd to /dev/null to
  > STDOUT_FILENO so writes to stdout (e.g. from ill-behaved
  > libraries) have somewhere to go.

Would that really be useful?  Output from Ill-behaved libraries,
written fd 1, already go to the same place.  Don't forget, dup does
not create a new file, it creates a duplicate handle to the same
file.  I'm proposing getting rid of the duplicate.
Then what happens to stdout output between the time that the channel
holding fd 1 closes and the time ssh exits?

The same thing that already happens: After the remote program closes stdout, any further attempt to write to that descriptor will fail; the program cannot continue to write to stdout after closing it; that is already the case.  The difference is that ssh will also close it's stdout; currently it keeps it open, which is an error.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux