From 2cd5b7dae80c5451b729a0be2ade03cbdf2c5c26 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Fri, 23 Jan 2015 14:44:30 -0800 Subject: [PATCH] Use filepath instead of path Currently loading the trust key uses path instead of filepath. This creates problems on some operating systems such as Windows. Fixes #10319 Signed-off-by: Derek McGowan (github: dmcgowan) --- api/common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/common.go b/api/common.go index fb3eefaca0..a96a4066ac 100644 --- a/api/common.go +++ b/api/common.go @@ -4,7 +4,7 @@ import ( "fmt" "mime" "os" - "path" + "path/filepath" "strings" log "github.com/Sirupsen/logrus" @@ -55,7 +55,7 @@ func MatchesContentType(contentType, expectedType string) bool { // LoadOrCreateTrustKey attempts to load the libtrust key at the given path, // otherwise generates a new one func LoadOrCreateTrustKey(trustKeyPath string) (libtrust.PrivateKey, error) { - err := os.MkdirAll(path.Dir(trustKeyPath), 0700) + err := os.MkdirAll(filepath.Dir(trustKeyPath), 0700) if err != nil { return nil, err }