Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mojsys!joevl From: joevl@mojsys.com (Joe Vlietstra) Newsgroups: comp.sys.hp Subject: Re: Mediainit "not owner" error Summary: Use setuid shell script Message-ID: <1991Feb15.221447.600@mojsys.com> Date: 15 Feb 91 22:14:47 GMT References: <11950@pt.cs.cmu.edu> Reply-To: joevl@mojsys.UUCP (Joe Vlietstra) Organization: Mojave Systems Corporation, Claremont, CA Lines: 34 In article <11950@pt.cs.cmu.edu> tgl@g.gp.cs.cmu.edu (Tom Lane) writes: >When I try to use mediainit(1) on a floppy disk, it says > mediainit: can't lock volume - Not owner >unless I am root. >I tried changing the ownership of the device file to be myself, >and it still wouldn't work. > >What's the problem? Can I fix things so that unprivileged users >can init a floppy? Where in the manual is this discussed?? mediainit is described in "System Administration Tasks", page 6-14. The first step in the procedure is: 1. Log in as the root user. This is the only place in the documentation where it is mentioned that only root may use mediainit. mediainit doesn't distinguish between hard disks and floppy disks -- it only ensures that the disk is not a mounted volume. Requiring root to execute mediainit is a safety "feature." Our work-around is a small shell script in /usr/local/bin: #!/bin/sh # Initialize a floppy disk /usr/bin/mediainit /dev/rfloppy This script is owned by root and has setuid. This works for us since we're a small company. A larger organization may want to use a lock file and other safety enhancements. Joe Vlietstra -- ------------------------------------------------------------------ Joe Vlietstra | Checked Daily: ...!uunet!mojsys!joevl Mojave Systems Corp | Checked Weekly: mojave@hmcvax.claremont.edu 1254 Harvard Avenue | Iffy Routing: joevl@mojsys.com