Skip to content

Commit 9eeaed0

Browse files
committed
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 <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
1 parent 67fcbac commit 9eeaed0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/private/Files/Storage/Wrapper/Encryption.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,11 @@ private function copyBetweenStorage(Storage\IStorage $sourceStorage, $sourceInte
768768

769769
if ($sourceStorage->is_dir($sourceInternalPath)) {
770770
$dh = $sourceStorage->opendir($sourceInternalPath);
771-
$result = $this->mkdir($targetInternalPath);
771+
if (!$this->is_dir($targetInternalPath)) {
772+
$result = $this->mkdir($targetInternalPath);
773+
} else {
774+
$result = true;
775+
}
772776
if (is_resource($dh)) {
773777
while ($result and ($file = readdir($dh)) !== false) {
774778
if (!Filesystem::isIgnoredDir($file)) {

0 commit comments

Comments
 (0)