summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-10-07 19:41:34 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-08 15:00:57 -0700
commit3b0e77bd144203a507eb191f7117d2c5004ea1de (patch)
tree3af6611ca518b7d9d85ecc36b238878ed571456b /drivers
parent8aa19ad84c38cd50bfc0560646efe1c9ca83d925 (diff)
downloadlinux-3.10-3b0e77bd144203a507eb191f7117d2c5004ea1de.tar.gz
linux-3.10-3b0e77bd144203a507eb191f7117d2c5004ea1de.tar.bz2
linux-3.10-3b0e77bd144203a507eb191f7117d2c5004ea1de.zip
[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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/scsi_ioctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c
index 079ec344eb4..382dea7b224 100644
--- a/drivers/block/scsi_ioctl.c
+++ b/drivers/block/scsi_ioctl.c
@@ -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;
}