summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-06-09 11:41:36 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-06-09 11:41:36 +0200
commit9d90421e6275199fe9e77a731ded2b09cc29eb3f (patch)
treea9c8a3154e511680f3724fd2f5ae6c34cf7d3ae3 /lib
parent7df96f19227e3cf4c42f853a50b15ccecb366da7 (diff)
parent05c2fc72d81857dfea7dbf661b632075a19a48dd (diff)
downloadnextcloud-server-9d90421e6275199fe9e77a731ded2b09cc29eb3f.tar.gz
nextcloud-server-9d90421e6275199fe9e77a731ded2b09cc29eb3f.zip
Merge pull request #16803 from owncloud/issue/16801-group-reshare-part-file-enc-keys
Check if the part files has keys when the original file does not
Diffstat (limited to 'lib')
-rw-r--r--lib/private/encryption/keys/storage.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/encryption/keys/storage.php b/lib/private/encryption/keys/storage.php
index fa317851a56..848d5c0134a 100644
--- a/lib/private/encryption/keys/storage.php
+++ b/lib/private/encryption/keys/storage.php
@@ -72,7 +72,17 @@ class Storage implements IStorage {
public function getFileKey($path, $keyId, $encryptionModuleId) {
$realFile = $this->util->stripPartialFileExtension($path);
$keyDir = $this->getFileKeyDir($encryptionModuleId, $realFile);
- return $this->getKey($keyDir . $keyId);
+ $key = $this->getKey($keyDir . $keyId);
+
+ if ($key === '' && $realFile !== $path) {
+ // Check if the part file has keys and use them, if no normal keys
+ // exist. This is required to fix copyBetweenStorage() when we
+ // rename a .part file over storage borders.
+ $keyDir = $this->getFileKeyDir($encryptionModuleId, $path);
+ $key = $this->getKey($keyDir . $keyId);
+ }
+
+ return $key;
}
/**