On 1/17/17 8:24 AM, Siteshwar Vashisht wrote: > Hello, > > Bash leaks heredoc fd to child processes if heredoc string contains command > substitution.
Thanks for the report. Here's a simpler patch. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.4-patched/redir.c 2016-06-02 20:22:24.000000000 -0400 --- redir.c 2017-01-17 13:23:40.000000000 -0500 *************** *** 470,473 **** --- 467,472 ---- } + SET_CLOSE_ON_EXEC (fd); + errno = r = 0; /* XXX */ /* write_here_document returns 0 on success, errno on failure. */