]>
Commit | Line | Data |
---|---|---|
d166f048 JA |
1 | # test restricted shell mode -- these should all be errors |
2 | # | |
3 | # things not tested for: | |
4 | # adding builtins dynamically with enable -f | |
5 | # importing function definitions from environment | |
6 | ||
d233b485 CR |
7 | ${THIS_SH} ./rsh1.sub |
8 | ${THIS_SH} ./rsh2.sub | |
9 | ||
d166f048 JA |
10 | set -r |
11 | ||
12 | cd / | |
13 | PATH=$PATH:/usr/local/bin | |
14 | SHELL=/bin/sh | |
15 | /bin/sh -c 'echo /bin/sh executed' | |
16 | ||
17 | . ./source.sub3 | |
18 | ||
19 | rm -f /tmp/restricted | |
20 | echo abc > /tmp/restricted | |
21 | if [ -f /tmp/restricted ]; then | |
22 | echo oops 1 -- output | |
23 | fi | |
24 | echo abc >> /tmp/restricted | |
25 | if [ -f /tmp/restricted ]; then | |
26 | echo oops 2 -- append | |
27 | fi | |
28 | ||
29 | command -p date | |
30 | ||
31 | set +r | |
cce855bc | 32 | set +o restricted |
d166f048 JA |
33 | |
34 | exec /bin/date | |
35 | ||
36 | echo $0: after exec |