]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Make sure we can change the group of inaccessible files.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Jan 2006 06:20:25 +0000 (06:20 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Jan 2006 06:20:25 +0000 (06:20 +0000)
ChangeLog
tests/chgrp/basic

index 2d4b0c4fadf3f413023d8a29bef6a4a53297214d..ce931ee488a5c8b0e0cfea4b1c374797f7eb2823 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,15 @@
 
        * Version 6.0-cvs.
 
+       * src/chown-core.c (RC_do_ordinary_chown): New enum value.
+       (restricted_chown): Return it, if the file cannot be accessed due
+       to EPERM, or if no uid or gid are required, or if the file is
+       neither a directory nor a regular file.  Rewrite to avoid gotos.
+       (change_file_owner): Handle RC_do_ordinary_chown case.
+       Rewrite to avoid gotos.
+       * tests/chgrp/basic: Make sure we can change the group of
+       inaccessible files.
+
        * src/date.c (usage): Explain %g, %G, and %V a bit better.
 
 2006-01-02  Jim Meyering  <jim@meyering.net>
index fc4eb5a1c5f771b57ecc917e7d6071c1758050bd..d4971194c1dfdce2accf70e02f6616313fd461b4 100755 (executable)
@@ -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