summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-05-09 15:00:35 +0200
committerGitHub <noreply@github.com>2017-05-09 15:00:35 +0200
commitb9bcc819bdad551000981200d7d8d72f5df70778 (patch)
treed700056eb1181312d8f899de719c1a1e3f56679d
parent04a5c34cac49b3d7fb16d95250bcc897f4432f31 (diff)
parent5a61a794d4aefaab05a273a12b509a1585a679d0 (diff)
downloadnextcloud-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.php5
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);
}