Mounting floppies

John Chambers jc at minya.UUCP
Fri Nov 18 13:53:39 AEST 1988


> It might; but there are no known uses for the (now disallowed) kernel
> invocation of set-id #! scripts that are also secure.  ksh can be made
> to interpret set-id scripts, but it works without #! doing the ID setting;
> one installs ksh itself setuid root instead.  Similar changes could be
> made to sh and csh.
> 
> In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)

Hmmmm; I have a problem where this seems an ideal solution, and I'd like
to hear another way to do it.  True, I can code up a C program to do the
job, and make it setuid, but a one-line script seems so much easier...

The problem?  Well, there's a floppy disk drive on this Sys/V machine,
and as usual, floppies may be formatted in various ways, including
made into file systems and mounted.  The problem with this is that
the mount command says:
|	WARNING!! - mounting: <> as </fd>
|	mount: Not owner
This despite the fact that the /dev/dsk file has 666 permissions and
/fd has 777 permissions.  Only root can do a mount.

This sorta interferes with users sticking a floppy in and saying
to mount it.  If this system had the #! convention implemented,
I could just put the floppy-mount command into a script, make it
setuid to root, and users would be happy.  It seems that instead
I have to write a bigger C program.

(Well, actually, I've temporarily implemented another kludge, but
it's insecure, so I won't tell you about it.)

Is there a straightforward way for a sh script on a Sys/V system
to do a mount on a device when run by an ordinary user?  Is there
some reason (other than bureaucratic perversity) that the Sys/V
mount command won't do its job when the /dev and the directory
have write permissions?  

Note that I'm talking about a small, personal workstation here,
not a 1000-user system.  It's obvious why you might not want
this capability on a giant system.  But most Sys/V machines
are small, with one or two users.  This hangup is viewd by
some users I know as an example of how Unix is less powerful 
than MS/DOS. ("With DOS, all you gotta do is stick the floppy 
in, turn the lever, and it works.  What's Unix's problem that
it can't handle that?")

I can feel the flames already....;-)
-- 
John Chambers <{adelie,ima,maynard,mit-eddie}!minya!{jc,root}> (617/484-6393)

[Any errors in the above are due to failures in the logic of the keyboard,
not in the fingers that did the typing.]



More information about the Comp.unix.wizards mailing list