--- linux-2.6.8.1/drivers/block/scsi_ioctl.c 2004-08-16 21:44:53.000000000 +0200 +++ linux/drivers/block/scsi_ioctl.c 2004-08-17 00:53:12.000000000 +0200 @@ -156,6 +156,35 @@ safe_for_write(WRITE_16), safe_for_write(WRITE_BUFFER), safe_for_write(WRITE_LONG), + + /* Some defs for recording CDs */ + + /* obsolete: 0x01 REZERO_UNIT, 0x5c READ_BUFFER */ + /* used by k3b, but also work without */ + + + safe_for_read(GPCMD_GET_CONFIGURATION), + safe_for_read(GPCMD_MODE_SELECT_10), /* read needed by k3b */ + safe_for_read(GPCMD_SET_SPEED), /* obsolete but often used */ + safe_for_read(GPCMD_LOAD_UNLOAD), + + safe_for_write(GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL), + safe_for_write(GPCMD_FLUSH_CACHE), + safe_for_write(GPCMD_CLOSE_TRACK), + safe_for_write(GPCMD_FORMAT_UNIT), + safe_for_write(GPCMD_BLANK), + safe_for_write(GPCMD_READ_FORMAT_CAPACITIES), + safe_for_write(GPCMD_RESERVE_RZONE_TRACK), + safe_for_write(GPCMD_SEND_KEY), + safe_for_write(GPCMD_SEND_OPC), + safe_for_write(GPCMD_SET_STREAMING), + + /* possibly needed: 0x5d SEND_CUE_SHEET/SEND_EVENT*/ + /* 0xbf SEND_DVD_STRUCTURE */ + /* but not defined yet in linux/cdrom.h */ + + safe_for_write(0x5d), + safe_for_write(0xbf), }; unsigned char type = cmd_type[cmd[0]]; @@ -173,6 +202,14 @@ if (capable(CAP_SYS_RAWIO)) return 0; + /* Added for debugging*/ + + if(file->f_mode & FMODE_WRITE) + printk(KERN_WARNING "SCSI-CMD Filter: 0x%x not allowed with write-mode\n",cmd[0]); + else + printk(KERN_WARNING "SCSI-CMD Filter: 0x%x not allowed with read-mode\n",cmd[0]); + + /* Otherwise fail it with an "Operation not permitted" */ return -EPERM; }