diff options
author | Eric Blake <ebb9@byu.net> | 2009-10-26 07:10:51 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-10-26 21:30:30 -0600 |
commit | 243f1b1c71136171a4da635a84f8e32ba3eb3c94 (patch) | |
tree | b3322fcf26a44e5b3f39479d89f58a34c4eab221 /tests | |
parent | c6900474ef4e0acc02bf5ff41c933afeef4aae09 (diff) | |
download | coreutils-243f1b1c71136171a4da635a84f8e32ba3eb3c94.tar.xz |
env: reject bogus -u arguments
* src/env.c (main): Use unsetenv rather than putenv to remove
items from environ, and check for failure.
* bootstrap.conf (gnulib_modules): Add unsetenv.
* tests/misc/env: Test this.
* NEWS: Document it.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/env | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/misc/env b/tests/misc/env index 1e0a22eae..07dd9e468 100755 --- a/tests/misc/env +++ b/tests/misc/env @@ -48,7 +48,7 @@ env sh -c 'exit 2' # exit status propagation test $? = 2 || fail=2 env . # invalid command test $? = 126 || fail=1 -env ... # no such command +env no_such # no such command test $? = 127 || fail=1 # Cygwin requires a minimal environment to launch new processes, so a @@ -105,8 +105,10 @@ esac # test "x`env c=d echo fail`" = xfail || fail=1 # test "x`env -- c=d echo fail`" = xpass || fail=1 -# FIXME - decide whether we like this behavior -# test `env -i -u a=b` = a=b || fail=1 -# env -u '' true || fail=1 +# catch unsetenv failure, broken through coreutils 8.0 +env -u a=b true && fail=1 +test $? = 125 || fail=1 +env -u '' true && fail=1 +test $? = 125 || fail=1 Exit $fail |