aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/tests/execution/shellproc3.0
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/tests/execution/shellproc3.0')
-rw-r--r--bin/sh/tests/execution/shellproc3.013
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/sh/tests/execution/shellproc3.0 b/bin/sh/tests/execution/shellproc3.0
new file mode 100644
index 000000000000..17026480a90a
--- /dev/null
+++ b/bin/sh/tests/execution/shellproc3.0
@@ -0,0 +1,13 @@
+# This tests a quality of implementation issue.
+# Shells are not required to reject executing binary files as shell scripts
+# but executing, for example, ELF files for a different architecture as
+# shell scripts may have annoying side effects.
+
+T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
+trap 'rm -rf "${T}"' 0
+printf '\177ELF\001!!\011\0\0\0\0\0\0\0\0' >"$T/testshellproc"
+chmod 755 "$T/testshellproc"
+PATH=$T:$PATH
+errout=`testshellproc 3>&2 2>&1 >&3 3>&-`
+r=$?
+[ "$r" = 126 ] && [ -n "$errout" ]