Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-8037 fileset: reject dotdot as a path component
[fs/lustre-release.git]
/
lustre
/
mdt
/
mdt_handler.c
diff --git
a/lustre/mdt/mdt_handler.c
b/lustre/mdt/mdt_handler.c
index
95ac27e
..
47c8a17
100644
(file)
--- a/
lustre/mdt/mdt_handler.c
+++ b/
lustre/mdt/mdt_handler.c
@@
-312,6
+312,14
@@
static int mdt_lookup_fileset(struct mdt_thread_info *info, const char *fileset,
rc = -EINVAL;
break;
}
+
+ /* reject .. as a path component */
+ if (lname->ln_namelen == 2 &&
+ strncmp(s1, "..", 2) == 0) {
+ rc = -EINVAL;
+ break;
+ }
+
strncpy(name, s1, lname->ln_namelen);
name[lname->ln_namelen] = '\0';