]> git.hungrycats.org Git - linux/commitdiff
[PATCH] moxa serial: add proper capability check
authorAlan Cox <alan@redhat.com>
Mon, 9 Jan 2006 14:35:28 +0000 (09:35 -0500)
committerChris Wright <chrisw@sous-sol.org>
Sun, 15 Jan 2006 06:15:30 +0000 (22:15 -0800)
This requires the proper capabilities for the moxa bios update ioctl's.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/char/moxa.c

index 79e490ef2cf2ea352045e2d5a71913bac50158eb..68844439b59b0b276cd77613d0a7960a35f6ae34 100644 (file)
@@ -1661,6 +1661,8 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
        case MOXA_FIND_BOARD:
        case MOXA_LOAD_C320B:
        case MOXA_LOAD_CODE:
+               if (!capable(CAP_SYS_RAWIO))
+                       return -EPERM;
                break;
        }