diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-05-09 15:00:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-09 15:00:35 +0200 |
commit | b9bcc819bdad551000981200d7d8d72f5df70778 (patch) | |
tree | d700056eb1181312d8f899de719c1a1e3f56679d | |
parent | 04a5c34cac49b3d7fb16d95250bcc897f4432f31 (diff) | |
parent | 5a61a794d4aefaab05a273a12b509a1585a679d0 (diff) | |
download | nextcloud-server-b9bcc819bdad551000981200d7d8d72f5df70778.tar.gz nextcloud-server-b9bcc819bdad551000981200d7d8d72f5df70778.zip |
Merge pull request #4758 from nextcloud/fix_3470
Do not write and read rootcerts.crt at the same time
-rw-r--r-- | lib/private/Security/CertificateManager.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index 461ef9457a7..4419b56012f 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -119,7 +119,8 @@ class CertificateManager implements ICertificateManager { return; } - $fhCerts = $this->view->fopen($path . '/rootcerts.crt', 'w'); + $certPath = $path . 'rootcerts.crt'; + $fhCerts = $this->view->fopen($certPath, 'w'); // Write user certificates foreach ($certs as $cert) { @@ -136,7 +137,7 @@ class CertificateManager implements ICertificateManager { // Append the system certificate bundle $systemBundle = $this->getCertificateBundle(null); - if ($this->view->file_exists($systemBundle)) { + if ($systemBundle !== $certPath && $this->view->file_exists($systemBundle)) { $systemCertificates = $this->view->file_get_contents($systemBundle); fwrite($fhCerts, $systemCertificates); } |