[K12OSN] Hopefully the last permission question

Les Mikesell les at futuresource.com
Thu Apr 29 17:09:01 UTC 2004


On Thu, 2004-04-29 at 11:26, Jim Kronebusch wrote:
> Last problem I seem to be having is that when a student drops
> homework into /home/drop/teacher1/class1 folder which is
> owned by teacher1 and group teacher1 with Set Uid and Gid
> checked, the file the student drops is still owned by the
> student.

If you have setgid on the directory, it should force the
default for new file creation to the group of the directory.
However, it does not force it to stay that way and
many copying tools will reset the group/owner/modes
after the copy to match the source file or at least as
close as permissions allow.  One way to fix things would
be a cron job running as root every few minutes that
would go to this directory, turn off any setuid bits
and change owership of all files to the teacher.  Note that
this does set up the potential for any student to blow the
teacher's quota (which is why you normally can't give files
away).

If you really want to control ownership as the file is
dropped, you could make a samba share on the same or a different
machine and smbmount it as the drop location.  Samba has
all the options you need to force the owner/group as files
are written and the teacher could either access through the
mount or directly.  This would also work in a situation where
some of the students use windows, some linux because the
windows boxes could also map the shared directory with the
same restricted access.

---
  Les Mikesell
   les at futuresource.com






More information about the K12OSN mailing list