From dfb69dc8e7e661ebadf1c3297cd6c5e6353dc6b8 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Fri, 9 Sep 2022 10:16:25 -0700 Subject: [PATCH] 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. --- cmd/osbuild-auth-tests/certificates.go | 2 ++ internal/boot/context-managers.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmd/osbuild-auth-tests/certificates.go b/cmd/osbuild-auth-tests/certificates.go index 57f82883d..beaf14754 100644 --- a/cmd/osbuild-auth-tests/certificates.go +++ b/cmd/osbuild-auth-tests/certificates.go @@ -44,6 +44,7 @@ func newSelfSignedCertificateKeyPair(subj string) (*certificateKeyPair, error) { ckp := certificateKeyPair{baseDir: dir} + //nolint:gosec cmd := exec.Command( "openssl", "req", "-nodes", "-x509", "-subj", subj, @@ -115,6 +116,7 @@ func newCA(subj string) (*ca, error) { BaseDir: baseDir, } + //nolint:gosec cmd := exec.Command( "openssl", "req", "-config", opensslConfig, diff --git a/internal/boot/context-managers.go b/internal/boot/context-managers.go index 29444360a..c66c2ae0d 100644 --- a/internal/boot/context-managers.go +++ b/internal/boot/context-managers.go @@ -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",