summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-05-16 14:17:53 +0000
committerJim Meyering <jim@meyering.net>2004-05-16 14:17:53 +0000
commitbe8365288df9175374a724bad49f17aad2fcc9d2 (patch)
tree1e158d415c371859da947dd6a3bc3de0ee6bd695 /tests
parent877467bc0cfc95e9ed8b73b37ed928adbd00ffa3 (diff)
downloadcoreutils-be8365288df9175374a724bad49f17aad2fcc9d2.tar.xz
*** empty log message ***
Diffstat (limited to 'tests')
-rwxr-xr-xtests/chown/deref15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/chown/deref b/tests/chown/deref
index 065686962..a10603719 100755
--- a/tests/chown/deref
+++ b/tests/chown/deref
@@ -7,6 +7,8 @@ if test "$VERBOSE" = yes; then
chown --version
fi
+. $srcdir/../envvar-check
+
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
@@ -24,8 +26,17 @@ fi
fail=0
-set _ `ls -ldg dangle`; user=$3
+set _ `ls -ldg dangle`; shift; user=$3
+
+# With 5.2.1 and earlier, this command would mistakenly succeed.
+chown --dereference $user dangle 2> out1 && fail=1
+sed 's/: [^:]*$//' out1 > out
+
+cat <<\EOF > exp || fail=1
+chown: cannot dereference `dangle'
+EOF
-chown --dereference $user dangle && fail=1
+cmp out exp || fail=1
+test $fail = 1 && diff out exp 2> /dev/null
(exit $fail); exit $fail