summaryrefslogtreecommitdiff
path: root/tests/chgrp
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-01-03 06:20:25 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-01-03 06:20:25 +0000
commitf6f906808dca5e11bd3180bfbc652de743d75a84 (patch)
tree542327c079af14f3e324e897433cabd84e2acd5b /tests/chgrp
parent7126eb3216c92a7be5a9ff7011ca08a2a32ec190 (diff)
downloadcoreutils-f6f906808dca5e11bd3180bfbc652de743d75a84.tar.xz
Make sure we can change the group of inaccessible files.
Diffstat (limited to 'tests/chgrp')
-rwxr-xr-xtests/chgrp/basic9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/chgrp/basic b/tests/chgrp/basic
index fc4eb5a1c..d4971194c 100755
--- a/tests/chgrp/basic
+++ b/tests/chgrp/basic
@@ -74,8 +74,15 @@ test "$VERBOSE" = yes && set +x
chgrp -R $g2 symlink
chown --from=:$g1 -c :$g2 f
+ # Make sure we can change the group of inaccessible files.
+ chmod a-r f
+ chown --from=:$g2 -c :$g1 f
+ chmod 0 f
+ chown --from=:$g1 -c :$g2 f
+
# chown() must not be optimized away even when
# the file's owner and group already have the desired value.
+ rm -f f g
touch f g
chgrp $g1 f g
chgrp $g2 g
@@ -115,6 +122,8 @@ changed ownership of `f' to :G2
changed group of `symlink' to G1
changed ownership of `f' to :G2
changed ownership of `f' to :G2
+changed ownership of `f' to :G1
+changed ownership of `f' to :G2
f
g
EOF