[net.unix-wizards] protect tape access

jle@ncsu.UUCP (Jamie Evans) (02/07/85)

	Does anyone have a neat way by which a tape drive is
protected from use by anyone else other that the user who has
mounted the tape?  Since we are in a university environment,
often a student has mounted a tape to write on and someone else,
thinking that the tape was their's, has written over the tape.
We have a 780 running 4.2 with a ancient TE16 tape drive.  I was
wondering if someone else had encountered this problem, and had
a nice solution.

	Please mail responses, do not post them to the net.

-Jamie Evans-

decvax!mcnc!ncsu!jle
mcnc!ncsu!jle

BostonU SysMgr <root%bostonu.csnet@csnet-relay.arpa> (02/12/85)

	I started to put one in my system, tell me if you
	find one but my scheme went like this:

	create a psuedo-user 'free' (or some such)
	free owns the tape drive (owner/group)
	make a tapealloc command called something which
	is setuid. It chowns the tape drive and forks a
	sub-shell. When the subshell exits it returns it
	to 'free'. The reason for the subshell is that
	any attempt to log out (eg. hanging up a phone)
	will free up the tape drive again (you may have
	to play with signals in tapealloc but it is straightforward.)

	The major problem is: The subshell method could make a
	few things awkward but this is not an unusual constraint
	and a user could still 'hog' a tape drive although at
	least now a 'ls -l /dev/?mt*' lists who is using what.
	Also, you will have to chown some set of devices
	(eg, /dev/mt0, /dev/rmt0, /dev/mt8 etc on 4.2bsd)
	but this is still reasonable.

		-Barry Shein

	[oh yeah, make sure you do your setuids correctly before
	forking that (setuid'd) subshell.]

Doug Gwyn (VLD/VMB) <gwyn@Brl-Vld.ARPA> (02/12/85)

One doesn't need a subshell nor a hack to "init" if he arranges for
borrowed devices to be reclaimed by the allocator when appropriate.