]> err.no Git - linux-2.6/commitdiff
[PATCH] moxa serial: add proper capability check
authorAlan Cox <alan@redhat.com>
Mon, 9 Jan 2006 14:35:28 +0000 (09:35 -0500)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 10 Jan 2006 17:45:36 +0000 (09:45 -0800)
This requires the proper capabilities for the moxa bios update ioctl's.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/moxa.c

index 5e3ef5522194d441758c006eb99ff34ef12b1703..f43c2e04eadd3878d57126b154afa2b4cbdc74aa 100644 (file)
@@ -1649,6 +1649,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;
        }