]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move keys instead of copy during encryption key migration
authorVincent Petry <pvince81@owncloud.com>
Fri, 27 Feb 2015 15:08:05 +0000 (16:08 +0100)
committerVincent Petry <pvince81@owncloud.com>
Fri, 27 Feb 2015 16:14:17 +0000 (17:14 +0100)
apps/files_encryption/lib/migration.php

index b88e671fe56df2134f409ca2fe6f3ad6fe5d6c1c..ad954db7ebbbd285f06ba323e30a4d5ab38eabf9 100644 (file)
@@ -221,7 +221,7 @@ class Migration {
                                                $extension = $this->getExtension($file, $trash);
                                                $targetDir = $this->getTargetDir($user, $filePath, $filename, $extension, $trash);
                                                $this->createPathForKeys($targetDir);
-                                               $this->view->copy($path . '/' . $file, $targetDir . '/fileKey');
+                                               $this->view->rename($path . '/' . $file, $targetDir . '/fileKey');
                                                $this->renameShareKeys($user, $filePath, $filename, $targetDir, $trash);
                                        }
                                }
@@ -267,7 +267,7 @@ class Migration {
                                                if (substr($file, 0, strlen($filename) + 1) === $filename . '.') {
 
                                                        $uid = $this->getUidFromShareKey($file, $filename, $trash);
-                                                       $this->view->copy($oldShareKeyPath . '/' . $file, $target . '/' . $uid . '.shareKey');
+                                                       $this->view->rename($oldShareKeyPath . '/' . $file, $target . '/' . $uid . '.shareKey');
                                                }
                                        }