diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-01-10 13:15:22 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2022-01-10 13:15:22 +0300 |
commit | be590df58863deb959fc54c46594086d2de3c402 (patch) | |
tree | fa05cee471a934360ec3df157ac355e77e695279 /lib/private/Files | |
parent | 91c7efaeb6c3a65643f1f0a9377d7c42b9231f8a (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>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Encryption.php | 6 |
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)) { |