precreate folders to json files

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2021-03-04 15:26:03 +00:00
parent 2a565b80fa
commit 9669ae3ade
4 changed files with 38 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"os/signal"
"path"
"path/filepath"
"time"
"github.com/cs3org/reva/cmd/revad/runtime"
@@ -67,6 +68,13 @@ func AuthBasic(cfg *config.Config) *cli.Command {
defer cancel()
// precreate folders
if cfg.Reva.AuthProvider.Driver == "json" && cfg.Reva.AuthProvider.JSON != "" {
if err := os.MkdirAll(filepath.Dir(cfg.Reva.AuthProvider.JSON), os.ModeExclusive); err != nil {
return err
}
}
{
uuid := uuid.Must(uuid.NewV4())