diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-24 22:34:43 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-24 22:34:43 +0000 |
commit | 22f741484391c3b2fd94881fd41c8c0df9749e95 (patch) | |
tree | 6d8f9ac524cefa7ebb0edeeb5e9545e4ada53e29 /shell/ash_test | |
parent | 5a867317bb1cbf36d396d9cdb552212607dcc2b1 (diff) | |
download | busybox-w32-22f741484391c3b2fd94881fd41c8c0df9749e95.tar.gz busybox-w32-22f741484391c3b2fd94881fd41c8c0df9749e95.tar.bz2 busybox-w32-22f741484391c3b2fd94881fd41c8c0df9749e95.zip |
ash: prevent exec NN>&- from closing fd used for script reading
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-redir/redir4.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir4.tests | 72 |
2 files changed, 73 insertions, 0 deletions
diff --git a/shell/ash_test/ash-redir/redir4.right b/shell/ash_test/ash-redir/redir4.right new file mode 100644 index 000000000..d86bac9de --- /dev/null +++ b/shell/ash_test/ash-redir/redir4.right | |||
@@ -0,0 +1 @@ | |||
OK | |||
diff --git a/shell/ash_test/ash-redir/redir4.tests b/shell/ash_test/ash-redir/redir4.tests new file mode 100755 index 000000000..4bdf5ae27 --- /dev/null +++ b/shell/ash_test/ash-redir/redir4.tests | |||
@@ -0,0 +1,72 @@ | |||
1 | # ash uses fd 10 (usually) for reading the script | ||
2 | exec 13>&- | ||
3 | exec 12>&- | ||
4 | exec 11>&- | ||
5 | exec 10>&- | ||
6 | # some amount of input is prefetched. | ||
7 | # make sure final echo is far enough to not be prefetched. | ||
8 | ############################################################### | ||
9 | ############################################################### | ||
10 | ############################################################### | ||
11 | ############################################################### | ||
12 | ############################################################### | ||
13 | ############################################################### | ||
14 | ############################################################### | ||
15 | ############################################################### | ||
16 | ############################################################### | ||
17 | ############################################################### | ||
18 | ############################################################### | ||
19 | ############################################################### | ||
20 | ############################################################### | ||
21 | ############################################################### | ||
22 | ############################################################### | ||
23 | ############################################################### | ||
24 | ############################################################### | ||
25 | ############################################################### | ||
26 | ############################################################### | ||
27 | ############################################################### | ||
28 | ############################################################### | ||
29 | ############################################################### | ||
30 | ############################################################### | ||
31 | ############################################################### | ||
32 | ############################################################### | ||
33 | ############################################################### | ||
34 | ############################################################### | ||
35 | ############################################################### | ||
36 | ############################################################### | ||
37 | ############################################################### | ||
38 | ############################################################### | ||
39 | ############################################################### | ||
40 | ############################################################### | ||
41 | ############################################################### | ||
42 | ############################################################### | ||
43 | ############################################################### | ||
44 | ############################################################### | ||
45 | ############################################################### | ||
46 | ############################################################### | ||
47 | ############################################################### | ||
48 | ############################################################### | ||
49 | ############################################################### | ||
50 | ############################################################### | ||
51 | ############################################################### | ||
52 | ############################################################### | ||
53 | ############################################################### | ||
54 | ############################################################### | ||
55 | ############################################################### | ||
56 | ############################################################### | ||
57 | ############################################################### | ||
58 | ############################################################### | ||
59 | ############################################################### | ||
60 | ############################################################### | ||
61 | ############################################################### | ||
62 | ############################################################### | ||
63 | ############################################################### | ||
64 | ############################################################### | ||
65 | ############################################################### | ||
66 | ############################################################### | ||
67 | ############################################################### | ||
68 | ############################################################### | ||
69 | ############################################################### | ||
70 | ############################################################### | ||
71 | ############################################################### | ||
72 | echo "OK" | ||