Re: [RFC] Let non-root users eject their ipods?

From: Wakko Warner
Date: Mon Dec 19 2005 - 22:31:45 EST


john stultz wrote:
> All,
> I'm getting a little tired of my roommates not knowing how to safely
> eject their usb-flash disks from my system and I'd personally like it if

What exactly is ejecting flash media?

I have USB hard disks, USB Flash sticks, USB DVD-RAM, and an Ipod. The only
one that even needs eject is the DVDRam. IIRC, ALLOW_MEDIUM_MREMOVAL is for
CD-Rom (and possibly tape). If the device is not in use, there's no reason
it cannot be unplugged then. (Not in use as in not mounted, and noone's
accessing the raw device).

> diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
> --- a/block/scsi_ioctl.c
> +++ b/block/scsi_ioctl.c
> @@ -188,6 +188,9 @@ static int verify_command(struct file *f
> safe_for_write(GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL),
> safe_for_write(GPCMD_LOAD_UNLOAD),
> safe_for_write(GPCMD_SET_STREAMING),
> +
> + /* let me eject my damn ipod */
> + safe_for_read(ALLOW_MEDIUM_REMOVAL),
> };
> unsigned char type = cmd_type[cmd[0]];
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Lab tests show that use of micro$oft causes cancer in lab animals
Got Gas???
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/