Administrator might access Lustre internal files by
using dotdot path for example:
mount -t lustre ip@tcp:/lustre/.. /mnt/lustre
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I137e12aa3f2feacb8549eb85f966c9dc8426f3af
Reviewed-on: http://review.whamcloud.com/19646
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
+
+ /* 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';
strncpy(name, s1, lname->ln_namelen);
name[lname->ln_namelen] = '\0';
}
run_test 247d "running fid2path inside root"
}
run_test 247d "running fid2path inside root"
+# LU-8037
+test_247e() {
+ lctl get_param -n mdc.$FSNAME-MDT0000*.import |
+ grep -q subtree ||
+ { skip "Fileset feature is not supported"; return; }
+
+ local submount=${MOUNT}_$tdir
+
+ mkdir $MOUNT/$tdir
+ mkdir -p $submount || error "mkdir $submount failed"
+ FILESET="$FILESET/.." mount_client $submount &&
+ error "mount $submount should fail"
+ rmdir $submount
+}
+run_test 247e "mount .. as fileset"
+
test_250() {
[ "$(facet_fstype ost$(($($GETSTRIPE -i $DIR/$tfile) + 1)))" = "zfs" ] \
&& skip "no 16TB file size limit on ZFS" && return
test_250() {
[ "$(facet_fstype ost$(($($GETSTRIPE -i $DIR/$tfile) + 1)))" = "zfs" ] \
&& skip "no 16TB file size limit on ZFS" && return