From f7aff0aaa4320505933df838cf5b551b69d5e513 Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Wed, 10 Apr 2019 12:35:43 -0700 Subject: Allow threads with CAP_SYS_RESOURCE to raise hard rlimits. PiperOrigin-RevId: 242919489 Change-Id: Ie3267b3bcd8a54b54bc16a6556369a19e843376f --- pkg/sentry/kernel/fd_map_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/sentry/kernel/fd_map_test.go') diff --git a/pkg/sentry/kernel/fd_map_test.go b/pkg/sentry/kernel/fd_map_test.go index b49996137..9e76f0a2d 100644 --- a/pkg/sentry/kernel/fd_map_test.go +++ b/pkg/sentry/kernel/fd_map_test.go @@ -40,7 +40,7 @@ func newTestFDMap() *FDMap { func TestFDMapMany(t *testing.T) { file := filetest.NewTestFile(t) limitSet := limits.NewLimitSet() - limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD}) + limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD}, true /* privileged */) f := newTestFDMap() for i := 0; i < maxFD; i++ { @@ -64,7 +64,7 @@ func TestFDMapMany(t *testing.T) { func TestFDMap(t *testing.T) { file := filetest.NewTestFile(t) limitSet := limits.NewLimitSet() - limitSet.Set(limits.NumberOfFiles, limits.Limit{1, maxFD}) + limitSet.Set(limits.NumberOfFiles, limits.Limit{1, maxFD}, true /* privileged */) f := newTestFDMap() if _, err := f.NewFDFrom(0, file, FDFlags{}, limitSet); err != nil { @@ -76,7 +76,7 @@ func TestFDMap(t *testing.T) { } largeLimit := limits.Limit{maxFD, maxFD} - limitSet.Set(limits.NumberOfFiles, largeLimit) + limitSet.Set(limits.NumberOfFiles, largeLimit, true /* privileged */) if fd, err := f.NewFDFrom(0, file, FDFlags{}, limitSet); err != nil { t.Fatalf("Adding an FD to a resized map: got %v, want nil", err) @@ -117,7 +117,7 @@ func TestDescriptorFlags(t *testing.T) { file := filetest.NewTestFile(t) f := newTestFDMap() limitSet := limits.NewLimitSet() - limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD}) + limitSet.Set(limits.NumberOfFiles, limits.Limit{maxFD, maxFD}, true /* privileged */) origFlags := FDFlags{CloseOnExec: true} -- cgit v1.2.3