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 {
|
func ensureSigningPrivateKeyExists(paths []string) error {
|
||||||
for _, path := range paths {
|
for _, path := range paths {
|
||||||
_, err := os.Stat(path)
|
file, err := os.Stat(path)
|
||||||
if err == nil {
|
if err == nil && file.Size() > 0 {
|
||||||
// If the file exists we can just return
|
// If the file exists and is not empty we can just return
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if !errors.Is(err, fs.ErrNotExist) {
|
if !errors.Is(err, fs.ErrNotExist) && file.Size() > 0 {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user