]> git.saurik.com Git - apple/shell_cmds.git/blobdiff - sh/tests/execution/path1.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / execution / path1.0
diff --git a/sh/tests/execution/path1.0 b/sh/tests/execution/path1.0
new file mode 100644 (file)
index 0000000..50829d6
--- /dev/null
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Some builtins should not be overridable via PATH.
+
+set -e
+T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
+trap 'rm -rf ${T}' 0
+echo '#!/bin/sh
+echo bad' >"$T/cd"
+chmod 755 "$T/cd"
+cd /bin
+oPATH=$PATH
+PATH=$T:$PATH:%builtin
+cd /
+PATH=$oPATH
+[ "$(pwd)" = / ]