golangci-lint: The parameters passed to exec.Command are safe

None of these parameters are user controlled, they are either
constructed from paths or are constants.
This commit is contained in:
Brian C. Lane 2022-09-09 10:16:25 -07:00 committed by Brian C. Lane
parent 29fb97f3d6
commit dfb69dc8e7
2 changed files with 4 additions and 0 deletions

View file

@ -180,6 +180,7 @@ func WithBootedQemuImage(image string, ns NetNS, f func() error) error {
// WithBootedNspawnImage boots the specified image in the specified namespace
// using nspawn. The VM is killed immediately after function returns.
func WithBootedNspawnImage(image string, ns NetNS, f func() error) error {
//nolint:gosec
cmd := exec.Command(
"systemd-nspawn",
"--boot", "--register=no",
@ -205,6 +206,7 @@ func WithBootedNspawnImage(image string, ns NetNS, f func() error) error {
// WithBootedNspawnImage boots the specified directory in the specified namespace
// using nspawn. The VM is killed immediately after function returns.
func WithBootedNspawnDirectory(dir string, ns NetNS, f func() error) error {
//nolint:gosec
cmd := exec.Command(
"systemd-nspawn",
"--boot", "--register=no",