mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 01:34:14 +08:00
[PATCH] scsi_ioctl: only warn for rejected commands
We should not be warning about commands that we allow, even if they are unknown. So move the if-root-allow check up a notch. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
8aa19ad84c
commit
3b0e77bd14
@ -201,15 +201,15 @@ static int verify_command(struct file *file, unsigned char *cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* And root can do any command.. */
|
||||
if (capable(CAP_SYS_RAWIO))
|
||||
return 0;
|
||||
|
||||
if (!type) {
|
||||
cmd_type[cmd[0]] = CMD_WARNED;
|
||||
printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
|
||||
}
|
||||
|
||||
/* And root can do any command.. */
|
||||
if (capable(CAP_SYS_RAWIO))
|
||||
return 0;
|
||||
|
||||
/* Otherwise fail it with an "Operation not permitted" */
|
||||
return -EPERM;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user