Re: [PATCH] Various suser() -> capable() chang

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Sat Apr 27 2002 - 13:56:48 EST


> case IDAPASSTHRU:
> - if (!suser()) return -EPERM;
> + if (!capable(CAP_SYS_ADMIN)) return -EPERM;

The cpqarray ones should be CAP_SYS_RAWIO

> diff -Nru a/drivers/scsi/cpqfcTSinit.c b/drivers/scsi/cpqfcTSinit.c
> --- a/drivers/scsi/cpqfcTSinit.c Fri Apr 26 18:34:23 2002
> +++ b/drivers/scsi/cpqfcTSinit.c Fri Apr 26 18:34:23 2002
> @@ -532,7 +532,7 @@
> =20
> // must be super user to send stuff directly to the
> // controller and/or physical drives...
> - if( !suser() )
> + if( !capable(CAP_SYS_ADMIN) )

Also RAWIO

Basically - stuff giving raw hardware access sohuld be CAP_SYS_RAWIO, the
others CAP_SYS_ADMIN is a good general case, but as you change then check
its appropriate
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 30 2002 - 22:00:14 EST