summaryrefslogtreecommitdiff
path: root/fs/utimes.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-07-22 09:59:21 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-07-26 20:53:34 -0400
commit2d8f30380ab8c706f4e0a8f1aaa22b5886e9ac8a (patch)
treeb798097fd831eab39f35c8c2e5a8ccfd7a850ef5 /fs/utimes.c
parent256984a83880ff7ac78055cb87baea48137f0b77 (diff)
downloadlwn-2d8f30380ab8c706f4e0a8f1aaa22b5886e9ac8a.tar.gz
lwn-2d8f30380ab8c706f4e0a8f1aaa22b5886e9ac8a.zip
[PATCH] sanitize __user_walk_fd() et.al.
* do not pass nameidata; struct path is all the callers want. * switch to new helpers: user_path_at(dfd, pathname, flags, &path) user_path(pathname, &path) user_lpath(pathname, &path) user_path_dir(pathname, &path) (fail if not a directory) The last 3 are trivial macro wrappers for the first one. * remove nameidata in callers. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/utimes.c')
-rw-r--r--fs/utimes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/utimes.c b/fs/utimes.c
index dc28b7826259..6929e3e91d05 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -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: