ash: fix open fds leaking in redirects. Closes 9561
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 7 Jan 2017 09:15:01 +0000 (10:15 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 10 Jan 2017 15:55:51 +0000 (16:55 +0100)
commit8e38108d03e0e583eabf61953b5e7b4f5af8966f
treea60319d70aa9e33f119228354b4ce00fac671e63
parentadd927e3d16414738ce46c28bb9d83e173848740
ash: fix open fds leaking in redirects. Closes 9561

commit e19923f6652a638ac39c84012e97f52cf5a7568e deleted clearredir()
call in shellexec():

ash: [REDIR] Remove redundant CLOEXEC calls
Upstream commit:

Now that we're marking file descriptors as CLOEXEC in savefd, we no longer
need to close them on exec or in setinputfd.

but it missed one place where we don't set CLOEXEC. Fixing this.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c
shell/ash_test/ash-redir/redir_leak.right [new file with mode: 0644]
shell/ash_test/ash-redir/redir_leak.tests [new file with mode: 0755]
shell/hush_test/hush-redir/redir_leak.right [new file with mode: 0644]
shell/hush_test/hush-redir/redir_leak.tests [new file with mode: 0755]