[CVE-2009-0029] System call wrappers part 29
[deliverable/linux.git] / fs / utimes.c
index dad679d3a1584009b183732bc296a0513ee057d3..ee853615798a57627b1564282e9fff7e6d07584e 100644 (file)
@@ -24,7 +24,7 @@
  * must be owner or have write permission.
  * Else, update from *times, must be owner or super user.
  */
-asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times)
+SYSCALL_DEFINE2(utime, char __user *, filename, struct utimbuf __user *, times)
 {
        struct timespec tv[2];
 
@@ -96,7 +96,7 @@ static int utimes_common(struct path *path, struct timespec *times)
                        goto mnt_drop_write_and_out;
 
                if (!is_owner_or_cap(inode)) {
-                       error = permission(inode, MAY_WRITE, NULL);
+                       error = inode_permission(inode, MAY_WRITE);
                        if (error)
                                goto mnt_drop_write_and_out;
                }
@@ -152,18 +152,18 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
                error = utimes_common(&file->f_path, times);
                fput(file);
        } else {
-               struct nameidata nd;
+               struct path path;
                int lookup_flags = 0;
 
                if (!(flags & AT_SYMLINK_NOFOLLOW))
                        lookup_flags |= LOOKUP_FOLLOW;
 
-               error = __user_walk_fd(dfd, filename, lookup_flags, &nd);
+               error = user_path_at(dfd, filename, lookup_flags, &path);
                if (error)
                        goto out;
 
-               error = utimes_common(&nd.path, times);
-               path_put(&nd.path);
+               error = utimes_common(&path, times);
+               path_put(&path);
        }
 
 out:
@@ -214,7 +214,8 @@ asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __u
        return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0);
 }
 
-asmlinkage long sys_utimes(char __user *filename, struct timeval __user *utimes)
+SYSCALL_DEFINE2(utimes, char __user *, filename,
+               struct timeval __user *, utimes)
 {
        return sys_futimesat(AT_FDCWD, filename, utimes);
 }
This page took 0.027931 seconds and 5 git commands to generate.