home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!bnr.co.uk!uknet!gdt!ccsis
- From: ccsis@sunlab1.bath.ac.uk (Icarus Sparry)
- Newsgroups: comp.unix.admin
- Subject: Re: How to write a "turnin" utility??
- Message-ID: <C06t44.451@sunlab1.bath.ac.uk>
- Date: 1 Jan 93 18:11:08 GMT
- References: <1992Dec28.213900.14908@organpipe.uug.arizona.edu> <1992Dec29.015418.12223@doug.cae.wisc.edu>
- Organization: Bath University Computing Services, UK
- Lines: 45
-
- In the referenced article, chris@castlab.uucp (Christian) writes:
- >
- >There is the script idea. SetUID on the script to that of a user that
- >has write access to the directory, and have the script copy the file name
- >specified to that directory.
- >
- >how about:
- >
- ># /bin/csh
- >cp %1 /usr/home/instructors/directory/
- >
-
- >Dunno if that helps...
- >
- >-Chris
-
- I would strongly advise against this idea. The script is fine, except as others
- have pointed out it does not check against overwriting other peoples files.
- HOWEVER it MUST NOT be made SetUID. Doing so invites people to destroy all
- the instructors files!
-
- There is a very easy approach if your system allows the 'sticky-bit' on
- directories to mean that only the owner of a file and the owner of the
- directory can remove files. A quick (but by no means foolproof) way would
- be to type 'ls -ld /tmp'. If the system replies with 'drwxrwxrwt' (note
- the final 't') then there is a good chance that this is the case.
- Read the manual pages to be sure.
-
- If so, you just type
- mkdir /usr/home/instructors/directory
- chmod 1777 /usr/home/instructors/directory
-
- and then use the following script.
- #! /bin/sh
- umask 022
- /bin/cp $1 /usr/home/instructors/directory/$USER
-
- See the file convex.com:/pub/csh.whynot for reasons not to use csh!
- This approach also makes it easy for the instuctor to put a deadline
- as all he has to do is chmod 700 /usr/home/instructors/directory/
- when the time is up.
-
- If the system does not allow the sticky-bit on directories to mean this,
- then you will require some kind of SUID program.
- I see that Luc Bussieres has provided the information about one from Purdue.
-