diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-22 09:59:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 20:53:34 -0400 |
commit | 2d8f30380ab8c706f4e0a8f1aaa22b5886e9ac8a (patch) | |
tree | b798097fd831eab39f35c8c2e5a8ccfd7a850ef5 /include/linux/namei.h | |
parent | 256984a83880ff7ac78055cb87baea48137f0b77 (diff) |
[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 'include/linux/namei.h')
-rw-r--r-- | include/linux/namei.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/namei.h b/include/linux/namei.h index 60e35a02f6cb..00888ff69504 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -54,12 +54,13 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
54 | #define LOOKUP_OPEN (0x0100) | 54 | #define LOOKUP_OPEN (0x0100) |
55 | #define LOOKUP_CREATE (0x0200) | 55 | #define LOOKUP_CREATE (0x0200) |
56 | 56 | ||
57 | extern int __user_walk(const char __user *, unsigned, struct nameidata *); | 57 | extern int user_path_at(int, const char __user *, unsigned, struct path *); |
58 | extern int __user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *); | 58 | |
59 | #define user_path_walk(name,nd) \ | 59 | #define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) |
60 | __user_walk_fd(AT_FDCWD, name, LOOKUP_FOLLOW, nd) | 60 | #define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) |
61 | #define user_path_walk_link(name,nd) \ | 61 | #define user_path_dir(name, path) \ |
62 | __user_walk_fd(AT_FDCWD, name, 0, nd) | 62 | user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path) |
63 | |||
63 | extern int path_lookup(const char *, unsigned, struct nameidata *); | 64 | extern int path_lookup(const char *, unsigned, struct nameidata *); |
64 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | 65 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, |
65 | const char *, unsigned int, struct nameidata *); | 66 | const char *, unsigned int, struct nameidata *); |