ash,hush: fix "saved" redirected fds still visible in children
Based on a patch by Mark Marshall <mark.marshall@omicronenergy.com> function old new delta dup_CLOEXEC - 49 +49 fcntl_F_DUPFD 46 - -46 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -0,0 +1,5 @@
|
||||
/proc/self/fd
|
||||
/proc/self/fd/0
|
||||
/proc/self/fd/1
|
||||
/proc/self/fd/2
|
||||
/proc/self/fd/3
|
6
shell/ash_test/ash-redir/redir_children_should_not_see_saved_fd_1.tests
Executable file
6
shell/ash_test/ash-redir/redir_children_should_not_see_saved_fd_1.tests
Executable file
@ -0,0 +1,6 @@
|
||||
# The "find" should not see "saved" (duplicated) fd #1
|
||||
# Explicitly use bbox find, since other implementations of "find"
|
||||
# may open other descriptors as well.
|
||||
busybox find /proc/self/fd >tmp_$$.out
|
||||
cat tmp_$$.out
|
||||
rm -f tmp_$$.out
|
@ -0,0 +1,5 @@
|
||||
/proc/self/fd
|
||||
/proc/self/fd/0
|
||||
/proc/self/fd/1
|
||||
/proc/self/fd/2
|
||||
/proc/self/fd/3
|
6
shell/ash_test/ash-redir/redir_children_should_not_see_saved_fd_2.tests
Executable file
6
shell/ash_test/ash-redir/redir_children_should_not_see_saved_fd_2.tests
Executable file
@ -0,0 +1,6 @@
|
||||
# The "find" should not see "saved" (duplicated) fd #1
|
||||
# Explicitly use bbox find, since other implementations of "find"
|
||||
# may open other descriptors as well.
|
||||
{ busybox find /proc/self/fd; } >tmp_$$.out
|
||||
cat tmp_$$.out
|
||||
rm -f tmp_$$.out
|
@ -0,0 +1,5 @@
|
||||
/proc/self/fd
|
||||
/proc/self/fd/0
|
||||
/proc/self/fd/1
|
||||
/proc/self/fd/2
|
||||
/proc/self/fd/3
|
6
shell/ash_test/ash-redir/redir_children_should_not_see_saved_fd_3.tests
Executable file
6
shell/ash_test/ash-redir/redir_children_should_not_see_saved_fd_3.tests
Executable file
@ -0,0 +1,6 @@
|
||||
# The "find" should not see "saved" (duplicated) fd #1
|
||||
# Explicitly use bbox find, since other implementations of "find"
|
||||
# may open other descriptors as well.
|
||||
{ busybox find /proc/self/fd; true; } >tmp_$$.out
|
||||
cat tmp_$$.out
|
||||
rm -f tmp_$$.out
|
Reference in New Issue
Block a user