Chore: Restore permissions used to create plugins dir (#94139)

This commit is contained in:
Andres Martinez Gotor
2024-10-03 09:09:54 +02:00
committed by GitHub
parent bcee44db5f
commit 4c4f7a3331
@@ -51,7 +51,10 @@ func validateInput(c utils.CommandLine) error {
fileInfo, err := os.Stat(pluginsDir)
if err != nil {
if err = os.MkdirAll(pluginsDir, 0o750); err != nil {
// If the directory does not exist, try to create it with permissions enough
// so the server running Grafana can write to it to install new plugins.
// nolint: gosec
if err = os.MkdirAll(pluginsDir, os.ModePerm); err != nil {
return fmt.Errorf("pluginsDir (%s) is not a writable directory", pluginsDir)
}
return nil