patch-2.3.99-pre1 linux/drivers/net/wan/cosa.c

Next file: linux/drivers/net/wan/hscx.h
Previous file: linux/drivers/net/wan/comxhw.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.51/linux/drivers/net/wan/cosa.c linux/drivers/net/wan/cosa.c
@@ -1150,19 +1150,19 @@
 {
 	switch(cmd) {
 	case COSAIORSET:	/* Reset the device */
-		if (!suser())
+		if (!capable(CAP_NET_ADMIN))
 			return -EACCES;
 		return cosa_reset(cosa);
 	case COSAIOSTRT:	/* Start the firmware */
-		if (!suser())
+		if (!capable(CAP_SYS_RAWIO))
 			return -EACCES;
 		return cosa_start(cosa, arg);
 	case COSAIODOWNLD:	/* Download the firmware */
-		if (!suser())
+		if (!capable(CAP_SYS_RAWIO))
 			return -EACCES;
 		return cosa_download(cosa, (struct cosa_download *)arg);
 	case COSAIORMEM:
-		if (!suser())
+		if (!capable(CAP_SYS_RAWIO))
 			return -EACCES;
 		return cosa_readmem(cosa, (struct cosa_download *)arg);
 	case COSAIORTYPE:
@@ -1189,7 +1189,7 @@
 	case COSAIONRCHANS:
 		return cosa->nchannels;
 	case COSAIOBMSET:
-		if (!suser())
+		if (!capable(CAP_SYS_RAWIO))
 			return -EACCES;
 		if (is_8bit(cosa))
 			return -EINVAL;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)