sh: Test that bogus values of PWD are not imported from the environment.
Current versions pass this test trivially by never importing PWD, but I plan to change sh to import PWD if it is an absolute pathname for the current directory, possibly containing symlinks.
This commit is contained in:
parent
b7e9bee71c
commit
e74e09f851
11
tools/regression/bin/sh/parameters/pwd1.0
Normal file
11
tools/regression/bin/sh/parameters/pwd1.0
Normal file
@ -0,0 +1,11 @@
|
||||
# $FreeBSD$
|
||||
# Check that bogus PWD values are not accepted from the environment.
|
||||
|
||||
cd / || exit 3
|
||||
failures=0
|
||||
[ "$(PWD=foo sh -c 'pwd')" = / ] || : $((failures += 1))
|
||||
[ "$(PWD=/var/empty sh -c 'pwd')" = / ] || : $((failures += 1))
|
||||
[ "$(PWD=/var/empty/foo sh -c 'pwd')" = / ] || : $((failures += 1))
|
||||
[ "$(PWD=/bin/ls sh -c 'pwd')" = / ] || : $((failures += 1))
|
||||
|
||||
exit $((failures != 0))
|
Loading…
x
Reference in New Issue
Block a user