[K12OSN] moving a file to a setgid directory not changing file's group

Petre Scheie petre at maltzen.net
Wed Feb 21 01:13:23 UTC 2007


After some further digging, I've confirmed that this is normal Unix 
behavior, and that the best solution seems to be a cron job that runs 
once a minute to change the group of all the files in /home/classroom. 
I think this question has even come up on this list before, and that's 
been the answer.

Petre

Petre Scheie wrote:
> I have a shared directory, /home/classroom, which is setgid.  In this 
> case I have clients that autologin, so documents created on ws001 one 
> day need to be editable on ws002 on another day.  If the kids save the 
> file directly in /home/common, the group for the file is set to the same 
> group as that of /home/classroom, in this case, the group name is 
> classroom.  However, if a student saves the file in the homedir first 
> and then, via nautilus, drags the file to the /home/classroom folder, 
> the group permissions are not changed to classroom but remain that of 
> the autologin of the given workstation.  This means the file can only be 
> edited at the same workstation as where it was created, not what I want.
> 
> I've been doing shared directories on Unix for 10+ years, and I never 
> noticed this, that the setgid of a directory is ignored if a file is 
> moved to that directory.  Copying or creating directly the file works 
> just fine, it's just the moving that's a problem.  Or am I just missing 
> something or do I not have the permissions set correctly?
> 
> Petre
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 




More information about the K12OSN mailing list