Skip to content

Commit c858af7

Browse files
committed
Use shlex instead of shellquote
Signed-off-by: Danilo Bürger <danilo.buerger@helsing.ai>
1 parent eea4b7b commit c858af7

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

age/keysource.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/sirupsen/logrus"
2020

2121
"github.com/getsops/sops/v3/logging"
22-
"github.com/kballard/go-shellquote"
22+
"github.com/google/shlex"
2323
)
2424

2525
const (
@@ -316,13 +316,13 @@ func (key *MasterKey) loadIdentities() (ParsedIdentities, error) {
316316
}
317317

318318
if ageKeyCmd, ok := os.LookupEnv(SopsAgeKeyCmdEnv); ok {
319-
args, err := shellquote.Split(ageKeyCmd)
319+
args, err := shlex.Split(ageKeyCmd)
320320
if err != nil {
321-
return nil, fmt.Errorf("failed to parse command %s: %w", ageKeyCmd, err)
321+
return nil, fmt.Errorf("failed to parse command %s from %s: %w", ageKeyCmd, SopsAgeKeyCmdEnv, err)
322322
}
323323
out, err := exec.Command(args[0], args[1:]...).Output()
324324
if err != nil {
325-
return nil, fmt.Errorf("failed to execute command %s: %w", ageKeyCmd, err)
325+
return nil, fmt.Errorf("failed to execute command %s from %s: %w", ageKeyCmd, SopsAgeKeyCmdEnv, err)
326326
}
327327
readers[SopsAgeKeyCmdEnv] = bytes.NewReader(out)
328328
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module github.com/getsops/sops/v3
22

3-
go 1.22
3+
go 1.23.0
4+
45
toolchain go1.24.1
56

67
require (
@@ -26,7 +27,6 @@ require (
2627
github.com/goware/prefixer v0.0.0-20160118172347-395022866408
2728
github.com/hashicorp/go-cleanhttp v0.5.2
2829
github.com/hashicorp/vault/api v1.16.0
29-
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
3030
github.com/lib/pq v1.10.9
3131
github.com/mitchellh/go-homedir v1.1.0
3232
github.com/mitchellh/go-wordwrap v1.0.1

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
205205
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
206206
github.com/hashicorp/vault/api v1.16.0 h1:nbEYGJiAPGzT9U4oWgaaB0g+Rj8E59QuHKyA5LhwQN4=
207207
github.com/hashicorp/vault/api v1.16.0/go.mod h1:KhuUhzOD8lDSk29AtzNjgAu2kxRA9jL9NAbkFlqvkBA=
208-
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
209-
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
210208
github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs=
211209
github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw=
212210
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=

0 commit comments

Comments
 (0)