mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-01 09:52:23 -06:00
let idp init private key also if the file already exists and is empty
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
Bugfix: Autocreate IDP private key also if file exists but is empty
|
||||
|
||||
We've fixed the behavior for the IDP private key generation so that
|
||||
a private key is also generated when the file already exists but is empty.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/4394
|
||||
@@ -161,12 +161,12 @@ func ensureEncryptionSecretExists(path string) error {
|
||||
|
||||
func ensureSigningPrivateKeyExists(paths []string) error {
|
||||
for _, path := range paths {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
// If the file exists we can just return
|
||||
file, err := os.Stat(path)
|
||||
if err == nil && file.Size() > 0 {
|
||||
// If the file exists and is not empty we can just return
|
||||
return nil
|
||||
}
|
||||
if !errors.Is(err, fs.ErrNotExist) {
|
||||
if !errors.Is(err, fs.ErrNotExist) && file.Size() > 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user