check for CAP_SYS_MODULE instead of CAP_SYS_ADMIN in comedi_fop_open()
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 22 Mar 2005 02:30:46 +0000 (02:30 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 22 Mar 2005 02:30:46 +0000 (02:30 +0000)
comedi/comedi_fops.c

index d872a1967be9ee25137cf88b4a683b1e6c4b757d..d012c02917ee56c077065d2b0bd88a7b2ae1ad59 100644 (file)
@@ -1638,11 +1638,11 @@ static int comedi_fop_open(struct inode *inode,struct file *file)
         */
        if(dev->attached)
                goto ok;
-       if(!capable(CAP_SYS_ADMIN) && dev->in_request_module){
+       if(!capable(CAP_SYS_MODULE) && dev->in_request_module){
                DPRINTK("in request module\n");
                return -ENODEV;
        }
-       if(capable(CAP_SYS_ADMIN) && dev->in_request_module)
+       if(capable(CAP_SYS_MODULE) && dev->in_request_module)
                goto ok;
 
        dev->in_request_module=1;
@@ -1654,8 +1654,8 @@ static int comedi_fop_open(struct inode *inode,struct file *file)
 
        dev->in_request_module=0;
 
-       if(!dev->attached && !capable(CAP_SYS_ADMIN)){
-               DPRINTK("not attached and not root\n");
+       if(!dev->attached && !capable(CAP_SYS_MODULE)){
+               DPRINTK("not attached and not CAP_SYS_MODULE\n");
                return -ENODEV;
        }
 ok: