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 <derek@mcgstyle.net> (github: dmcgowan)
| ... | ... |
@@ -4,7 +4,7 @@ import ( |
| 4 | 4 |
"fmt" |
| 5 | 5 |
"mime" |
| 6 | 6 |
"os" |
| 7 |
- "path" |
|
| 7 |
+ "path/filepath" |
|
| 8 | 8 |
"strings" |
| 9 | 9 |
|
| 10 | 10 |
log "github.com/Sirupsen/logrus" |
| ... | ... |
@@ -55,7 +55,7 @@ func MatchesContentType(contentType, expectedType string) bool {
|
| 55 | 55 |
// LoadOrCreateTrustKey attempts to load the libtrust key at the given path, |
| 56 | 56 |
// otherwise generates a new one |
| 57 | 57 |
func LoadOrCreateTrustKey(trustKeyPath string) (libtrust.PrivateKey, error) {
|
| 58 |
- err := os.MkdirAll(path.Dir(trustKeyPath), 0700) |
|
| 58 |
+ err := os.MkdirAll(filepath.Dir(trustKeyPath), 0700) |
|
| 59 | 59 |
if err != nil {
|
| 60 | 60 |
return nil, err |
| 61 | 61 |
} |