possible chgrp(1) bug?

Juergen Wagner gandalf at csli.stanford.edu
Thu Dec 15 00:19:30 AEST 1988


The manual page for chgrp(1) says:
[SunOS 4.0]

     chgrp changes the group-ID of the filenames given  as  argu-
     ments  to group.
...
     -R   Recursive.  chgrp descends through the  directory,  and
          any  subdirectories,  setting the specified group-ID as
          it proceeds.   When  symbolic  links  are  encountered,
          their group is changed, but they are not traversed.

The manual page for chmod(1) says:
[SunOS 4.0]

     Change the permissions (mode) of a file or files.  Only  the
     owner of a file (or the super-user) may change its mode.
...
     -R   Recursively descend through directory  arguments,  set-
          ting  the  mode for each file as described above.  When
          symbolic links  are  encountered,  their  mode  is  not
          changed and they are not traversed.

Now, try the following:
    peano:work(17). touch x
    peano:work(18). ln -s x y
    peano:work(19). ls -lg x y
    -rw-r--r--  1 wagner   parc            0 Dec  2 13:29 x
    lrwxrwxrwx  1 wagner   parc            1 Dec  2 13:29 y -> x
    peano:work(20). chgrp kmem y
    peano:work(21). chmod 770 y
    peano:work(22). ls -lg x y
    -rwxrwx---  1 wagner   parc            0 Dec  2 13:29 x
    lrwxrwxrwx  1 wagner   kmem            1 Dec  2 13:29 y -> x
    peano:work(23).

This shows that chmod changes the protection of the file (as it should),
but chgrp changes the group of the link (shouldn't it change the file's
group?).

[[ Well, perhaps it should, but what does that have to do with the -R
option?  --wnl ]]

Juergen Wagner		   			gandalf at csli.stanford.edu
						 wagner at arisia.xerox.com



More information about the Comp.sys.sun mailing list