mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
integration-cli: ignore some file-permissions issues (gosec)
These already had a comment, so let's make it a ignore-comment
integration-cli/docker_cli_exec_test.go:409:13: G302: Expect file permissions to be 0600 or less (gosec)
f, err := os.OpenFile(netFilePath, os.O_WRONLY|os.O_SYNC|os.O_APPEND, 0o644)
^
integration-cli/docker_cli_run_test.go:3050:12: G302: Expect file permissions to be 0600 or less (gosec)
if err := os.Chmod(filename, 0o646); err != nil {
^
integration-cli/docker_cli_run_test.go:3072:12: G302: Expect file permissions to be 0600 or less (gosec)
if err := os.Chmod(filename, 0o646); err != nil {
^
integration-cli/docker_cli_run_test.go:3094:12: G302: Expect file permissions to be 0600 or less (gosec)
if err := os.Chmod(filename, 0o646); err != nil {
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -3046,7 +3046,7 @@ func (s *DockerCLIRunSuite) TestRunNetworkFilesBindMount(c *testing.T) {
|
||||
filename := createTmpFile(c, expected)
|
||||
defer os.Remove(filename)
|
||||
|
||||
// for user namespaced test runs, the temp file must be accessible to unprivileged root
|
||||
// #nosec G302 -- for user namespaced test runs, the temp file must be accessible to unprivileged root
|
||||
if err := os.Chmod(filename, 0o646); err != nil {
|
||||
c.Fatalf("error modifying permissions of %s: %v", filename, err)
|
||||
}
|
||||
@@ -3068,7 +3068,7 @@ func (s *DockerCLIRunSuite) TestRunNetworkFilesBindMountRO(c *testing.T) {
|
||||
filename := createTmpFile(c, "test123")
|
||||
defer os.Remove(filename)
|
||||
|
||||
// for user namespaced test runs, the temp file must be accessible to unprivileged root
|
||||
// #nosec G302 -- for user namespaced test runs, the temp file must be accessible to unprivileged root
|
||||
if err := os.Chmod(filename, 0o646); err != nil {
|
||||
c.Fatalf("error modifying permissions of %s: %v", filename, err)
|
||||
}
|
||||
@@ -3090,7 +3090,7 @@ func (s *DockerCLIRunSuite) TestRunNetworkFilesBindMountROFilesystem(c *testing.
|
||||
filename := createTmpFile(c, "test123")
|
||||
defer os.Remove(filename)
|
||||
|
||||
// for user namespaced test runs, the temp file must be accessible to unprivileged root
|
||||
// #nosec G302 -- for user namespaced test runs, the temp file must be accessible to unprivileged root
|
||||
if err := os.Chmod(filename, 0o646); err != nil {
|
||||
c.Fatalf("error modifying permissions of %s: %v", filename, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user