]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - bin/sh/tests/execution/shellproc5.0
Add 'contrib/pnglite/' from commit 'a70c2a23d0d84dfc63a1d9413a7f4aaede7313aa'
[FreeBSD/FreeBSD.git] / bin / sh / tests / execution / shellproc5.0
1 # $FreeBSD$
2 # This tests a quality of implementation issue.
3 # Shells are not required to reject executing binary files as shell scripts
4 # but executing, for example, ELF files for a different architecture as
5 # shell scripts may have annoying side effects.
6
7 T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
8 trap 'rm -rf "${T}"' 0
9 printf '\177ELF\001!!\012\0\0\0\0\0\0\0\0' >"$T/testshellproc"
10 chmod 755 "$T/testshellproc"
11 PATH=$T:$PATH
12 errout=`testshellproc 3>&2 2>&1 >&3 3>&-`
13 r=$?
14 [ "$r" = 126 ] && [ -n "$errout" ]