diff options
author | Jan Messer <jan@mtec-studios.ch> | 2023-04-04 22:01:35 +0200 |
---|---|---|
committer | Jan Messer <jan@mtec-studios.ch> | 2023-04-06 23:03:49 +0200 |
commit | 647c65a640f3e4c4b27e96f63684be2a2f55674f (patch) | |
tree | 31bb2468b194ee57c464f0efc5ec5609878d256b | |
parent | 7a443863fe8fba0f33d1eee86d85dd3d5bea2fb6 (diff) | |
download | nextcloud-server-647c65a640f3e4c4b27e96f63684be2a2f55674f.tar.gz nextcloud-server-647c65a640f3e4c4b27e96f63684be2a2f55674f.zip |
[BUGFIX] throw exception instead of error if unable to create file handler (only exceptions are catch)
Signed-off-by: Jan Messer <jan@mtec-studios.ch>
-rw-r--r-- | lib/private/Security/CertificateManager.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index bcc992caa5d..3338c00f579 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -138,6 +138,10 @@ class CertificateManager implements ICertificateManager { $tmpPath = $certPath . '.tmp' . $this->random->generate(10, ISecureRandom::CHAR_DIGITS); $fhCerts = $this->view->fopen($tmpPath, 'w'); + if (!is_resource($fhCerts)) { + throw new \RuntimeException('Unable to open file handler to create certificate bundle "' . $tmpPath . '".'); + } + // Write user certificates foreach ($certs as $cert) { $file = $path . '/uploads/' . $cert->getName(); |