patch-2.1.100 linux/drivers/char/random.c

Next file: linux/drivers/char/riscom8.c
Previous file: linux/drivers/char/nvram.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/drivers/char/random.c linux/drivers/char/random.c
@@ -1199,7 +1199,7 @@
 		put_user(ent_count, (int *) arg);
 		return 0;
 	case RNDADDTOENTCNT:
-		if (!suser())
+		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		retval = verify_area(VERIFY_READ, (void *) arg, sizeof(int));
 		if (retval)
@@ -1228,7 +1228,7 @@
 			wake_up_interruptible(&random_read_wait);
 		return 0;
 	case RNDGETPOOL:
-		if (!suser())
+		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		p = (int *) arg;
 		retval = verify_area(VERIFY_WRITE, (void *) p, sizeof(int));
@@ -1249,7 +1249,7 @@
 			return -EFAULT;
 		return 0;
 	case RNDADDENTROPY:
-		if (!suser())
+		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		p = (int *) arg;
 		retval = verify_area(VERIFY_READ, (void *) p, 2*sizeof(int));
@@ -1287,13 +1287,13 @@
 			wake_up_interruptible(&random_read_wait);
 		return 0;
 	case RNDZAPENTCNT:
-		if (!suser())
+		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		random_state.entropy_count = 0;
 		return 0;
 	case RNDCLEARPOOL:
 		/* Clear the entropy pool and associated counters. */
-		if (!suser())
+		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		rand_clear_pool();
 		return 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov