Merge pull request #2667 from rhafer/mkdir-idp

idp: Create parent directories if they don't exist
This commit is contained in:
David Christofas
2021-10-22 17:41:12 +02:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
Bugfix: Create parent directories for idp configuration
The parent directories of the identifier-registration.yaml config file might
not exist when starting idp. Create them, when that is the case.
https://github.com/owncloud/ocis/issues/2667

View File

@@ -73,7 +73,7 @@ func createConfigsIfNotExist(assets http.FileSystem, filePath, ocisURL string) e
folder := path.Dir(filePath)
if _, err := os.Stat(folder); os.IsNotExist(err) {
if err := os.Mkdir(folder, 0700); err != nil {
if err := os.MkdirAll(folder, 0700); err != nil {
return err
}
}