From 812554087f092b7e6c1842965f0a0f395c2586bd Mon Sep 17 00:00:00 2001 From: Danilo Pereira Date: Thu, 30 Jun 2016 19:49:18 -0300 Subject: [PATCH] getCertsPath should use getConfigPath instead of defaulting to users homedir. (#2039) Fixes #2028 --- certs.go | 7 +++---- globals.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/certs.go b/certs.go index 7c57f4932..f87bde0d1 100644 --- a/certs.go +++ b/certs.go @@ -19,8 +19,6 @@ package main import ( "os" "path/filepath" - - "github.com/minio/go-homedir" ) // createCertsPath create certs path. @@ -34,11 +32,12 @@ func createCertsPath() error { // getCertsPath get certs path. func getCertsPath() (string, error) { - homeDir, err := homedir.Dir() + var certsPath string + configDir, err := getConfigPath() if err != nil { return "", err } - certsPath := filepath.Join(homeDir, globalMinioCertsDir) + certsPath = filepath.Join(configDir, globalMinioCertsDir) return certsPath, nil } diff --git a/globals.go b/globals.go index 0ffb61a6f..431568159 100644 --- a/globals.go +++ b/globals.go @@ -27,7 +27,7 @@ const ( const ( globalMinioConfigVersion = "4" globalMinioConfigDir = ".minio" - globalMinioCertsDir = ".minio/certs" + globalMinioCertsDir = "certs" globalMinioCertFile = "public.crt" globalMinioKeyFile = "private.key" globalMinioConfigFile = "config.json"