| Line | |
|---|
| 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 |
|
|---|
| 7 | set -r
|
|---|
| 8 |
|
|---|
| 9 | cd /
|
|---|
| 10 | PATH=$PATH:/usr/local/bin
|
|---|
| 11 | SHELL=/bin/sh
|
|---|
| 12 | /bin/sh -c 'echo /bin/sh executed'
|
|---|
| 13 |
|
|---|
| 14 | . ./source.sub3
|
|---|
| 15 |
|
|---|
| 16 | rm -f /tmp/restricted
|
|---|
| 17 | echo abc > /tmp/restricted
|
|---|
| 18 | if [ -f /tmp/restricted ]; then
|
|---|
| 19 | echo oops 1 -- output
|
|---|
| 20 | fi
|
|---|
| 21 | echo abc >> /tmp/restricted
|
|---|
| 22 | if [ -f /tmp/restricted ]; then
|
|---|
| 23 | echo oops 2 -- append
|
|---|
| 24 | fi
|
|---|
| 25 |
|
|---|
| 26 | command -p date
|
|---|
| 27 |
|
|---|
| 28 | set +r
|
|---|
| 29 | set +o restricted
|
|---|
| 30 |
|
|---|
| 31 | exec /bin/date
|
|---|
| 32 |
|
|---|
| 33 | echo $0: after exec
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.