mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
config/path: Figure out absolute paths properly on windows. (#3996)
The following form of arguments such as ``` minio.exe -C some_dir server dir ``` has stopped working because of lack of handling of absolute paths for config directory. Always calculate absolute path for any relative paths on any operating system. The following fix converts all config directory relative paths into absolute paths. Fixes #3991
This commit is contained in:
parent
d99efa2c93
commit
1caad902cb
@ -23,6 +23,7 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -482,6 +483,14 @@ func serverMain(c *cli.Context) {
|
||||
fatalIf(errors.New("empty directory"), "Configuration directory cannot be empty.")
|
||||
}
|
||||
|
||||
// Disallow relative paths, figure out absolute paths.
|
||||
{
|
||||
configDirAbs, err := filepath.Abs(configDir)
|
||||
fatalIf(err, "Unable to fetch absolute path for config directory %s", configDir)
|
||||
|
||||
configDir = configDirAbs
|
||||
}
|
||||
|
||||
// Set configuration directory.
|
||||
setConfigDir(configDir)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user