2008-03-20 07:39:25

by Randy Dunlap

[permalink] [raw]
Subject: [mmotm] iscsi_ibft build error

mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c: In function 'ibft_show_attribute':
mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: implicit declaration of function 'capable'
mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: (Each undeclared identifier is reported only once
mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: for each function it appears in.)
make[3]: *** [drivers/firmware/iscsi_ibft.o] Error 1

---
~Randy


Attachments:
config-rand3 (30.68 kB)

2008-03-20 22:46:32

by Andrew Morton

[permalink] [raw]
Subject: Re: [mmotm] iscsi_ibft build error

On Wed, 19 Mar 2008 11:56:55 -0700
Randy Dunlap <[email protected]> wrote:

> mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c: In function 'ibft_show_attribute':
> mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: implicit declaration of function 'capable'
> mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
> mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: (Each undeclared identifier is reported only once
> mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: for each function it appears in.)
> make[3]: *** [drivers/firmware/iscsi_ibft.o] Error 1
>

--- a/drivers/firmware/iscsi_ibft.c~scsi-add-iscsi-ibft-support-fix
+++ a/drivers/firmware/iscsi_ibft.c
@@ -65,6 +65,7 @@


#include <linux/blkdev.h>
+#include <linux/capability.h>
#include <linux/ctype.h>
#include <linux/device.h>
#include <linux/err.h>

should do the trick.

Does this driver actually need to run capable(CAP_SYS_ADMIN)? Can we not
rely upon permissions of the reelvant sysfs file?

2008-03-21 15:41:53

by Konrad Rzeszutek Wilk

[permalink] [raw]
Subject: Re: [mmotm] iscsi_ibft build error

On Thu, Mar 20, 2008 at 03:45:55PM -0700, Andrew Morton wrote:
> On Wed, 19 Mar 2008 11:56:55 -0700
> Randy Dunlap <[email protected]> wrote:
>
> > mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c: In function 'ibft_show_attribute':
> > mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: implicit declaration of function 'capable'
> > mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
> > mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: (Each undeclared identifier is reported only once
> > mmotm-2008-0318-1720/drivers/firmware/iscsi_ibft.c:521: error: for each function it appears in.)
> > make[3]: *** [drivers/firmware/iscsi_ibft.o] Error 1
> >
>
> --- a/drivers/firmware/iscsi_ibft.c~scsi-add-iscsi-ibft-support-fix
> +++ a/drivers/firmware/iscsi_ibft.c
> @@ -65,6 +65,7 @@
>
>
> #include <linux/blkdev.h>
> +#include <linux/capability.h>
> #include <linux/ctype.h>
> #include <linux/device.h>
> #include <linux/err.h>
>
> should do the trick.
>
> Does this driver actually need to run capable(CAP_SYS_ADMIN)? Can we not
> rely upon permissions of the reelvant sysfs file?

I followed what the efivars driver does. The permissions of the
files are secure (as they are in the efivars), so one layer
of protection could be suffice?