From: Frank Mori Hess Date: Tue, 22 Mar 2005 02:30:46 +0000 (+0000) Subject: check for CAP_SYS_MODULE instead of CAP_SYS_ADMIN in comedi_fop_open() X-Git-Tag: r0_7_70~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f0e7df34478d82754dd18f674204272742b6c552;p=comedi.git check for CAP_SYS_MODULE instead of CAP_SYS_ADMIN in comedi_fop_open() --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index d872a196..d012c029 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -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: