Skip to content

Commit

Permalink
[PATCH] scsi_ioctl: only warn for rejected commands
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Oct 8, 2005
1 parent 8aa19ad commit 3b0e77b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3b0e77b

Please sign in to comment.