Re: eject zip disk

From: Dr. Michael Weller (eowmob@exp-math.uni-essen.de)
Date: Tue Jan 18 2000 - 08:58:30 EST


On Tue, 18 Jan 2000, Harald Hoyer wrote:

> Hi,
>
> could anybody explain me, why it is possible to eject a CD media as a
> non-root user, if you own the device, but not a ZIP media.

Well, I reply from memory, from what I saw in the source once:

a) For CD drives (at least EIDE), there is a special eject ioctl().
   And so, if you can open the device, you can eject it.

b) For scsi devices, there is no special eject ioctl. However,
   you can send arbitrary scsi commands (like eject) by ioctl. Now you
   can lowlevel format a disk this way to, or read it byte by byte (even
   when you should have access to some partitions only). I'm unsure, but
   it might be able you can send commands to any other device on the same
   bus. Definitely anything you do to screw up the device might block the
   whole bus.

c) If you have a parallel zip drive, its probably a driver issue in the
   zip driver. But AFAIK these are supported by having an
   scsi-over-parallel interface/driver so b) applies.

I'd say it is possible to change current API/add a specific eject ioctl,
to allow someone owning the device to eject it. However, someone needs to
do that, and if the generic scsi ioctl to send a command is affected it
might mean we need a specific eject ioctl as the general ioctl is too
dangerous for non root.

However, rather than waiting for that, why don't express your trust in
that the eject utility does the right thing (rather than screw your disks)
by making it setuid root, or, if you want to allow only certain parameters
(s.t. only certain users can eject certain devices), write a sudo script?

Michael.

--

Michael Weller: eowmob@exp-math.uni-essen.de, eowmob@ms.exp-math.uni-essen.de, or even mat42b@spi.power.uni-essen.de. If you encounter an eowmob account on any machine in the net, it's very likely it's me.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:17 EST