Subject: Re: Group IDs of directories (was Re: Sticky bit?)
To: Benjamin Lorenz <benni@ps.uni-sb.de>
From: Andrew Brown <codewarrior@daemon.org>
List: netbsd-users
Date: 09/11/1997 10:55:35
[snip]
>So, the problem only occurs when doing a `cp' to /tmp, not when doing a
>`mv'. This is interesting, as in both cases the file has to be created
>(see df output, ~ and /tmp are on different filesystems).

there is another difference that you are not seeing: the fact that the
cp simply creates the file with the same group ownership as the
directory containing the new file is true.  but when moving between
file systems, mv actually ends up calling cp with the "P", "R", and
"p" options.  this *changes* the group ownership of the file back to
what it was before you moved it after it's finished (it also modifies
the m- and a- timestamps), more closely emulating a true
intra-filesystem mv.

try cp-ing and file to your /tmp, chgrp it to a group you *are* in,
and then mv it back to your home directory.

your true complaint is that you cannot chgrp a file to a group of
which you are not a member.  which is perfectly correct.

-- 
|-----< "CODE WARRIOR" >-----|
andrew@echonyc.com (TheMan)        * "ah!  i see you have the internet
codewarrior@daemon.org                               that goes *ping*!"
warfare@graffiti.com      * "information is power -- share the wealth."