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

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

diff -u --recursive --new-file v2.1.99/linux/drivers/char/rtc.c linux/drivers/char/rtc.c
@@ -220,7 +220,7 @@
 		 * We don't really want Joe User enabling more
 		 * than 64Hz of interrupts on a multi-user machine.
 		 */
-		if ((rtc_freq > 64) && (!suser()))
+		if ((rtc_freq > 64) && (!capable(CAP_SYS_RESOURCE)))
 			return -EACCES;
 
 		if (!(rtc_status & RTC_TIMER_ON)) {
@@ -308,7 +308,7 @@
 		unsigned int yrs;
 		unsigned long flags;
 			
-		if (!suser())
+		if (!capable(CAP_SYS_TIME))
 			return -EACCES;
 
 		if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
@@ -394,7 +394,7 @@
 		 * We don't really want Joe User generating more
 		 * than 64Hz of interrupts on a multi-user machine.
 		 */
-		if ((arg > 64) && (!suser()))
+		if ((arg > 64) && (!capable(CAP_SYS_RESOURCE)))
 			return -EACCES;
 
 		while (arg > (1<<tmp))
@@ -429,7 +429,7 @@
 		if (arg < 1900)
 			return -EINVAL;
 
-		if (!suser())
+		if (!capable(CAP_SYS_TIME))
 			return -EACCES;
 
 		epoch = arg;

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