This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / kernel / time.c
index b6d01cf..87d441c 100644 (file)
@@ -31,9 +31,6 @@
 #include <linux/timex.h>
 #include <linux/errno.h>
 #include <linux/smp_lock.h>
-#include <linux/syscalls.h>
-#include <linux/security.h>
-
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
 
@@ -80,17 +77,13 @@ asmlinkage long sys_time(int __user * tloc)
 asmlinkage long sys_stime(time_t __user *tptr)
 {
        struct timespec tv;
-       int err;
 
+       if (!capable(CAP_SYS_TIME))
+               return -EPERM;
        if (get_user(tv.tv_sec, tptr))
                return -EFAULT;
 
        tv.tv_nsec = 0;
-
-       err = security_settime(&tv, NULL);
-       if (err)
-               return err;
-
        do_settimeofday(&tv);
        return 0;
 }
@@ -152,12 +145,10 @@ inline static void warp_clock(void)
 int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
 {
        static int firsttime = 1;
-       int error = 0;
-
-       error = security_settime(tv, tz);
-       if (error)
-               return error;
 
+       if (!capable(CAP_SYS_TIME))
+               return -EPERM;
+               
        if (tz) {
                /* SMP safe, global irq locking makes it work. */
                sys_tz = *tz;
@@ -487,6 +478,8 @@ int do_settimeofday (struct timespec *tv)
        return 0;
 }
 
+EXPORT_SYMBOL(do_settimeofday);
+
 void do_gettimeofday (struct timeval *tv)
 {
        unsigned long seq, nsec, usec, sec, offset;