Skip to content

Commit 80174c1

Browse files
committed
Allow absolute path in credential store/helpers
This would allow users to use a helper that does not live in path. The underlying credentials helper library uses os/exec exec.Command so this should be safe to do. I should add a test, please advice for the best location to do that. Signed-off-by: Erlend Hamnaberg <[email protected]>
1 parent b2c4452 commit 80174c1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cli/config/credentials/native_store.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/docker/cli/cli/config/types"
55
"github.com/docker/docker-credential-helpers/client"
66
"github.com/docker/docker-credential-helpers/credentials"
7+
"path/filepath"
78
)
89

910
const (
@@ -22,7 +23,12 @@ type nativeStore struct {
2223
// NewNativeStore creates a new native store that
2324
// uses a remote helper program to manage credentials.
2425
func NewNativeStore(file store, helperSuffix string) Store {
25-
name := remoteCredentialsPrefix + helperSuffix
26+
var name string
27+
if filepath.IsAbs(helperSuffix) {
28+
name = helperSuffix
29+
} else {
30+
name = remoteCredentialsPrefix + helperSuffix
31+
}
2632
return &nativeStore{
2733
programFunc: client.NewShellProgramFunc(name),
2834
fileStore: NewFileStore(file),

0 commit comments

Comments
 (0)