Documentation
¶
Overview ¶
Package openfds contains support code for the security.OpenFDs test.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expect ¶
func Expect(ctx context.Context, s *testing.State, allowDirs bool, p *process.Process, es []Expectation)
Expect tests the file types and file modes of the opened files for the given Chrome process p. allowDirs should be true if open directories are allowed. es is a list of expected file modes. Please see also the comment of Expectation for details.
Types ¶
type Expectation ¶
type Expectation struct {
// Regex pattern to be matched with the opened file.
// This is full-string match pattern.
PathPattern string
// List of possible permissions of the symlink under /proc/{PID}/fd/*
// Note: The "mode" on the link tells us if the file is opened for
// read/write. We are more interested in that than the permissions of
// the file on the fs.
Modes []uint32
// contains filtered or unexported fields
}
Expectation represents expected path and file mode for file descriptors in a process. PathPattern is the string rather than regexp.Regexp, in order to avoid verbose expectation data list in the test.
Click to show internal directories.
Click to hide internal directories.