getCertsPath should use getConfigPath instead of defaulting to users homedir. (#2039)

Fixes #2028
This commit is contained in:
Danilo Pereira 2016-06-30 19:49:18 -03:00 committed by Harshavardhana
parent 57bc08cc7e
commit 812554087f
2 changed files with 4 additions and 5 deletions

View File

@ -19,8 +19,6 @@ package main
import ( import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/minio/go-homedir"
) )
// createCertsPath create certs path. // createCertsPath create certs path.
@ -34,11 +32,12 @@ func createCertsPath() error {
// getCertsPath get certs path. // getCertsPath get certs path.
func getCertsPath() (string, error) { func getCertsPath() (string, error) {
homeDir, err := homedir.Dir() var certsPath string
configDir, err := getConfigPath()
if err != nil { if err != nil {
return "", err return "", err
} }
certsPath := filepath.Join(homeDir, globalMinioCertsDir) certsPath = filepath.Join(configDir, globalMinioCertsDir)
return certsPath, nil return certsPath, nil
} }

View File

@ -27,7 +27,7 @@ const (
const ( const (
globalMinioConfigVersion = "4" globalMinioConfigVersion = "4"
globalMinioConfigDir = ".minio" globalMinioConfigDir = ".minio"
globalMinioCertsDir = ".minio/certs" globalMinioCertsDir = "certs"
globalMinioCertFile = "public.crt" globalMinioCertFile = "public.crt"
globalMinioKeyFile = "private.key" globalMinioKeyFile = "private.key"
globalMinioConfigFile = "config.json" globalMinioConfigFile = "config.json"