Tape drives and protection of tapes (using tar)

Barry Shein root at bu-cs.UUCP
Sun Mar 31 14:22:14 AEST 1985


I'll repeat my simple suggestion regarding tape drive access under
UNIX, no one has complained yet though I don't use it (yet, no
one here seems to ever USE tapes.)

1.Create a pseudo user who will own the drives when free, the
name 'free' is an excellent choice.
2. chown all tape devices to 'free' and remove other permissions.
3. Write a little shell script or C program to chown to the
current effective uid of the person running this program a
tape drive (all minor devices). Make it setuid() to root.
After it does the chowns it setuid's to the effective uid and
forks a shell and waits for exit. On exit it chowns the tape
devices back to 'free'. Maybe call this 'mtmount', arg could be
unit number if you have more than one tape.

Now just a 'ls -l /dev/mt0' or whatever tells a user that a tape
is 'free' (or who is using it so they can use 'write' if need be.)
Also, hangups and logouts should now free the tape up (catch SIGHUP
in the mtmount prog.)

Hey, like all advice on this net, it's 'free' :-)

	-Barry Shein, Boston University



More information about the Comp.unix mailing list