From 38bceb0d744357fc25cf0353989aa59f1bdcf11c Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 21 May 2015 14:06:45 +0200 Subject: distinguish between source and target mount point to allow copy/rename between system wide mount points and user specific mountpoints --- lib/private/encryption/keys/storage.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/private/encryption/keys/storage.php b/lib/private/encryption/keys/storage.php index 6aa00c5b5ee..1d2638b4504 100644 --- a/lib/private/encryption/keys/storage.php +++ b/lib/private/encryption/keys/storage.php @@ -233,13 +233,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 . '/'; } @@ -264,13 +269,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 . '/'; } -- cgit v1.2.3