ash: prevent exec NN>&- from closing fd used for script reading

This commit is contained in:
Denis Vlasenko
2008-07-24 22:34:43 +00:00
parent 5a867317bb
commit 22f7414843
3 changed files with 98 additions and 8 deletions

View File

@@ -0,0 +1 @@
OK

View File

@@ -0,0 +1,72 @@
# ash uses fd 10 (usually) for reading the script
exec 13>&-
exec 12>&-
exec 11>&-
exec 10>&-
# some amount of input is prefetched.
# make sure final echo is far enough to not be prefetched.
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
###############################################################
echo "OK"