summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/mount_test.go
diff options
context:
space:
mode:
authorBrian Geffon <bgeffon@google.com>2018-12-04 14:31:08 -0800
committerShentubot <shentubot@google.com>2018-12-04 14:32:03 -0800
commit82719be42e636f86780d21b01e10ecb2c9a25e53 (patch)
tree1c635cae30683e3cdc13a497cf529063ed7f56dc /pkg/sentry/fs/mount_test.go
parentadafc08d7cee594ea94abefbedf67ea315922550 (diff)
Max link traversals should be for an entire path.
The number of symbolic links that are allowed to be followed are for a full path and not just a chain of symbolic links. PiperOrigin-RevId: 224047321 Change-Id: I5e3c4caf66a93c17eeddcc7f046d1e8bb9434a40
Diffstat (limited to 'pkg/sentry/fs/mount_test.go')
-rw-r--r--pkg/sentry/fs/mount_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/sentry/fs/mount_test.go b/pkg/sentry/fs/mount_test.go
index a1c9f4f79..269d6b9da 100644
--- a/pkg/sentry/fs/mount_test.go
+++ b/pkg/sentry/fs/mount_test.go
@@ -115,8 +115,10 @@ func TestMountSourceParentChildRelationship(t *testing.T) {
"/waldo",
}
+ var maxTraversals uint
for _, p := range paths {
- d, err := mm.FindLink(ctx, rootDirent, nil, p, 0)
+ maxTraversals = 0
+ d, err := mm.FindLink(ctx, rootDirent, nil, p, &maxTraversals)
if err != nil {
t.Fatalf("could not find path %q in mount manager: %v", p, err)
}
@@ -164,7 +166,8 @@ func TestMountSourceParentChildRelationship(t *testing.T) {
}
// "foo" mount should have two children: /foo/bar, and /foo/qux.
- d, err := mm.FindLink(ctx, rootDirent, nil, "/foo", 0)
+ maxTraversals = 0
+ d, err := mm.FindLink(ctx, rootDirent, nil, "/foo", &maxTraversals)
if err != nil {
t.Fatalf("could not find path %q in mount manager: %v", "/foo", err)
}
@@ -185,7 +188,8 @@ func TestMountSourceParentChildRelationship(t *testing.T) {
}
// "waldo" mount should have no submounts or children.
- waldo, err := mm.FindLink(ctx, rootDirent, nil, "/waldo", 0)
+ maxTraversals = 0
+ waldo, err := mm.FindLink(ctx, rootDirent, nil, "/waldo", &maxTraversals)
if err != nil {
t.Fatalf("could not find path %q in mount manager: %v", "/waldo", err)
}