bash/bash-4.4-heredoc-cloexec.patch
Siteshwar Vashisht fbc2878c17 Fix heredoc file descriptor leak
Resolves: #1413676
2017-04-26 13:51:24 +02:00

14 lines
327 B
Diff

diff --git a/redir.c b/redir.c
index 25488ea..1858b0b 100644
--- a/redir.c
+++ b/redir.c
@@ -469,6 +469,8 @@ here_document_to_fd (redirectee, ri)
return (fd);
}
+ SET_CLOSE_ON_EXEC (fd);
+
errno = r = 0; /* XXX */
/* write_here_document returns 0 on success, errno on failure. */
if (redirectee->word)