summaryrefslogtreecommitdiffstats
path: root/lib/private/encryption
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-05-28 15:28:25 +0200
committerVincent Petry <pvince81@owncloud.com>2015-05-28 15:28:25 +0200
commitded62ff69341bc96b673a0ab2cfda314c9af1bc8 (patch)
treef666e783c53eab222723114bf2f9726b983bdf02 /lib/private/encryption
parent474c99e19a73bcb3ce378c12f0629ee1eac059b5 (diff)
parentc63f2286c06e94926a8af738397c18c3bb1ff4ea (diff)
downloadnextcloud-server-ded62ff69341bc96b673a0ab2cfda314c9af1bc8.tar.gz
nextcloud-server-ded62ff69341bc96b673a0ab2cfda314c9af1bc8.zip
Merge pull request #16501 from owncloud/enc_fix_move_versions_between_storages
[encryption] fix move versions between storages
Diffstat (limited to 'lib/private/encryption')
-rw-r--r--lib/private/encryption/keys/storage.php21
-rw-r--r--lib/private/encryption/manager.php5
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/private/encryption/keys/storage.php b/lib/private/encryption/keys/storage.php
index f90548fd319..692633f98da 100644
--- a/lib/private/encryption/keys/storage.php
+++ b/lib/private/encryption/keys/storage.php
@@ -234,13 +234,18 @@ class Storage implements IStorage {
list($owner, $source) = $this->util->getUidAndFilename($source);
list(, $target) = $this->util->getUidAndFilename($target);
- $systemWide = $this->util->isSystemWideMountPoint($target, $owner);
+ $systemWideSource = $this->util->isSystemWideMountPoint($source, $owner);
+ $systemWideTarget = $this->util->isSystemWideMountPoint($target, $owner);
- if ($systemWide) {
+ if ($systemWideSource) {
$sourcePath = $this->keys_base_dir . $source . '/';
- $targetPath = $this->keys_base_dir . $target . '/';
} else {
$sourcePath = '/' . $owner . $this->keys_base_dir . $source . '/';
+ }
+
+ if ($systemWideTarget) {
+ $targetPath = $this->keys_base_dir . $target . '/';
+ } else {
$targetPath = '/' . $owner . $this->keys_base_dir . $target . '/';
}
@@ -265,13 +270,17 @@ class Storage implements IStorage {
list($owner, $source) = $this->util->getUidAndFilename($source);
list(, $target) = $this->util->getUidAndFilename($target);
- $systemWide = $this->util->isSystemWideMountPoint($target, $owner);
+ $systemWideTarget = $this->util->isSystemWideMountPoint($target, $owner);
+ $systemWideSource = $this->util->isSystemWideMountPoint($source, $owner);
- if ($systemWide) {
+ if ($systemWideSource) {
$sourcePath = $this->keys_base_dir . $source . '/';
- $targetPath = $this->keys_base_dir . $target . '/';
} else {
$sourcePath = '/' . $owner . $this->keys_base_dir . $source . '/';
+ }
+ if ($systemWideTarget) {
+ $targetPath = $this->keys_base_dir . $target . '/';
+ } else {
$targetPath = '/' . $owner . $this->keys_base_dir . $target . '/';
}
diff --git a/lib/private/encryption/manager.php b/lib/private/encryption/manager.php
index 6942376f0b7..ecbb86993ec 100644
--- a/lib/private/encryption/manager.php
+++ b/lib/private/encryption/manager.php
@@ -26,6 +26,7 @@ use OC\Files\Filesystem;
use OC\Files\Storage\Shared;
use OC\Files\Storage\Wrapper\Encryption;
use OC\Files\View;
+use OC\Search\Provider\File;
use OCP\Encryption\IEncryptionModule;
use OCP\Encryption\IManager;
use OCP\Files\Mount\IMountPoint;
@@ -224,6 +225,7 @@ class Manager implements IManager {
);
$user = \OC::$server->getUserSession()->getUser();
$logger = \OC::$server->getLogger();
+ $mountManager = Filesystem::getMountManager();
$uid = $user ? $user->getUID() : null;
$fileHelper = \OC::$server->getEncryptionFilesHelper();
$keyStorage = \OC::$server->getEncryptionKeyStorage();
@@ -243,7 +245,8 @@ class Manager implements IManager {
$fileHelper,
$uid,
$keyStorage,
- $update
+ $update,
+ $mountManager
);
} else {
return $storage;