]>
Commit | Line | Data |
---|---|---|
c6757b8b | 1 | --- linux-2.6.8.1/drivers/block/scsi_ioctl.c 2004-08-16 21:44:53.000000000 +0200 |
2 | +++ linux/drivers/block/scsi_ioctl.c 2004-08-17 00:53:12.000000000 +0200 | |
3 | @@ -156,6 +156,35 @@ | |
4 | safe_for_write(WRITE_16), | |
5 | safe_for_write(WRITE_BUFFER), | |
6 | safe_for_write(WRITE_LONG), | |
7 | + | |
8 | + /* Some defs for recording CDs */ | |
9 | + | |
10 | + /* obsolete: 0x01 REZERO_UNIT, 0x5c READ_BUFFER */ | |
11 | + /* used by k3b, but also work without */ | |
12 | + | |
13 | + | |
14 | + safe_for_read(GPCMD_GET_CONFIGURATION), | |
15 | + safe_for_read(GPCMD_MODE_SELECT_10), /* read needed by k3b */ | |
16 | + safe_for_read(GPCMD_SET_SPEED), /* obsolete but often used */ | |
17 | + safe_for_read(GPCMD_LOAD_UNLOAD), | |
18 | + | |
19 | + safe_for_write(GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL), | |
20 | + safe_for_write(GPCMD_FLUSH_CACHE), | |
21 | + safe_for_write(GPCMD_CLOSE_TRACK), | |
22 | + safe_for_write(GPCMD_FORMAT_UNIT), | |
23 | + safe_for_write(GPCMD_BLANK), | |
24 | + safe_for_write(GPCMD_READ_FORMAT_CAPACITIES), | |
25 | + safe_for_write(GPCMD_RESERVE_RZONE_TRACK), | |
26 | + safe_for_write(GPCMD_SEND_KEY), | |
27 | + safe_for_write(GPCMD_SEND_OPC), | |
28 | + safe_for_write(GPCMD_SET_STREAMING), | |
29 | + | |
30 | + /* possibly needed: 0x5d SEND_CUE_SHEET/SEND_EVENT*/ | |
31 | + /* 0xbf SEND_DVD_STRUCTURE */ | |
32 | + /* but not defined yet in linux/cdrom.h */ | |
33 | + | |
34 | + safe_for_write(0x5d), | |
35 | + safe_for_write(0xbf), | |
36 | }; | |
37 | unsigned char type = cmd_type[cmd[0]]; | |
38 | ||
39 | @@ -173,6 +202,14 @@ | |
40 | if (capable(CAP_SYS_RAWIO)) | |
41 | return 0; | |
42 | ||
43 | + /* Added for debugging*/ | |
44 | + | |
45 | + if(file->f_mode & FMODE_WRITE) | |
46 | + printk(KERN_WARNING "SCSI-CMD Filter: 0x%x not allowed with write-mode\n",cmd[0]); | |
47 | + else | |
48 | + printk(KERN_WARNING "SCSI-CMD Filter: 0x%x not allowed with read-mode\n",cmd[0]); | |
49 | + | |
50 | + | |
51 | /* Otherwise fail it with an "Operation not permitted" */ | |
52 | return -EPERM; | |
53 | } |