selftests: mount: add nosymfollow tests
authorRoss Zwisler <zwisler@chromium.org>
Thu, 27 Aug 2020 17:09:47 +0000 (11:09 -0600)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Aug 2020 20:06:47 +0000 (16:06 -0400)
commit8ec90bfd1aeb39f44c3e704aaa9ca88c52e6866a
tree5c7b809b83e92e3843ff7f3cb042a6f0a06637f3
parentdab741e0e02bd3c4f5e2e97be74b39df2523fc6e
selftests: mount: add nosymfollow tests

Add tests for the new 'nosymfollow' mount option.  We test to make sure
that symlink traversal fails with ELOOP when 'nosymfollow' is set, but
that readlink(2) and realpath(3) still work as expected.  We also verify
that statfs(2) correctly returns ST_NOSYMFOLLOW when we are mounted with
the 'nosymfollow' option.

Signed-off-by: Ross Zwisler <zwisler@google.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
tools/testing/selftests/mount/.gitignore
tools/testing/selftests/mount/Makefile
tools/testing/selftests/mount/nosymfollow-test.c [new file with mode: 0644]
tools/testing/selftests/mount/run_nosymfollow.sh [new file with mode: 0755]
tools/testing/selftests/mount/run_tests.sh [deleted file]
tools/testing/selftests/mount/run_unprivileged_remount.sh [new file with mode: 0755]