Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-01-10 13:15:22 +0300
committerVincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com>2022-01-11 11:20:41 +0300
commit9eeaed0051b005f4320d6a8b623ebac20d5ebb25 (patch)
tree4283862474eef13e575824309150103c58b2b99f /lib/private
parent67fcbacd4f17b0da12adf80f90a4aa30a2a4e784 (diff)
Fix fail when keys/files folder already exists
Fixes an issue with transfer ownership in move mode where the folder "files_encryption/keys/files" already exists. Instead of failing, its existence is checked before calling mkdir. Signed-off-by: Vincent Petry <vincent@nextcloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index 3ee715ae3d3..3fb21fbc01c 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -768,7 +768,11 @@ class Encryption extends Wrapper {
if ($sourceStorage->is_dir($sourceInternalPath)) {
$dh = $sourceStorage->opendir($sourceInternalPath);
- $result = $this->mkdir($targetInternalPath);
+ if (!$this->is_dir($targetInternalPath)) {
+ $result = $this->mkdir($targetInternalPath);
+ } else {
+ $result = true;
+ }
if (is_resource($dh)) {
while ($result and ($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {