diff --git a/pkg/config/config.go b/pkg/config/config.go index f45f0c0cdf..0be1f3ec33 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -12,6 +12,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" ) // Config is a Scaleway CLI configuration file @@ -55,12 +56,16 @@ func GetConfig() (*Config, error) { return nil, err } - stat, err := os.Stat(scwrcPath) - // we don't care if it fails, the user just won't see the warning - if err == nil { - mode := stat.Mode() - if mode&0066 != 0 { - return nil, fmt.Errorf("permissions %#o for .scwrc are too open", mode) + // Don't check permissions on Windows, Go knows nothing about them on this platform + // User profile is to be assumed safe anyway + if runtime.GOOS != "windows" { + stat, err := os.Stat(scwrcPath) + // we don't care if it fails, the user just won't see the warning + if err == nil { + perm := stat.Mode().Perm() + if perm&0066 != 0 { + return nil, fmt.Errorf("permissions %#o for .scwrc are too open", perm) + } } }