aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Messer <jan@mtec-studios.ch>2023-04-04 22:01:35 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-05-04 20:33:02 +0000
commit364f3f5f26056fac82fb7f249852341fa69d2630 (patch)
treeaa9f082d8e31d56283e457dc55a308fe35134dc2
parent6c90e3f78067c718b2eadb01c190175c0ddd1f8c (diff)
downloadnextcloud-server-364f3f5f26056fac82fb7f249852341fa69d2630.tar.gz
nextcloud-server-364f3f5f26056fac82fb7f249852341fa69d2630.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.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php
index f1107130887..f22a06641de 100644
--- a/lib/private/Security/CertificateManager.php
+++ b/lib/private/Security/CertificateManager.php
@@ -147,6 +147,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();