]> git.hungrycats.org Git - linux/commitdiff
[PATCH] more sparse checking of do_utimes()
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sat, 29 May 2004 07:33:30 +0000 (00:33 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 29 May 2004 07:33:30 +0000 (00:33 -0700)
Speaking of conflicts...  Here's another half of a do_utimes() patch,
same story as on ppc64:

arch/sparc64/kernel/sys_sparc32.c

index 34bedbf5c5a6f43637a8ccf26e6700a44c335d34..3302cee91f919f3079a3e71bbc5d8a6f5491c6b7 100644 (file)
@@ -1445,28 +1445,15 @@ asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz
 
 asmlinkage int sys32_utimes(char *filename, struct compat_timeval *tvs)
 {
-       char *kfilename;
        struct timeval ktvs[2];
-       mm_segment_t old_fs;
-       int ret;
-
-       kfilename = getname(filename);
-       ret = PTR_ERR(kfilename);
-       if (!IS_ERR(kfilename)) {
-               if (tvs) {
-                       if (get_tv32(&ktvs[0], tvs) ||
-                           get_tv32(&ktvs[1], 1+tvs))
-                               return -EFAULT;
-               }
 
-               old_fs = get_fs();
-               set_fs(KERNEL_DS);
-               ret = do_utimes(kfilename, (tvs ? &ktvs[0] : NULL));
-               set_fs(old_fs);
-
-               putname(kfilename);
+       if (tvs) {
+               if (get_tv32(&ktvs[0], tvs) ||
+                   get_tv32(&ktvs[1], 1+tvs))
+                       return -EFAULT;
        }
-       return ret;
+
+       return do_utimes(filename, (tvs ? &ktvs[0] : NULL));
 }
 
 /* These are here just in case some old sparc32 binary calls it. */