Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-03-31 19:06:37 +0300
committerLukas Reschke <lukas@owncloud.com>2016-03-31 21:39:35 +0300
commitd16553d2d8f651e1c3ba8cc60df52558cb253983 (patch)
treef8af3d1d9c0e4aac1cd4c304c7d0e107b67b148c /lib
parent8453073fdb6b2f9debe9e70e8709c0b610d5a27d (diff)
Make sure that the encrypted version is set
The code path called when using external storage with WebDAV is using `\OC\Files\Storage\Wrapper\Encryption::getMetaData` which did not contain the actual encrypted version inside the cache entry version. This lead to the following: 1. User uploaded a file 2. File is created and `\OC\Files\Storage\Wrapper\Encryption::getMetaData` is called. It has an empty `encryptedVersion` but sets `encrypted` to either `true` or `false`. 3. The call when updating the file cache will use the old version.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/wrapper/encryption.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index 81eea9944f8..47daf6bab88 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -104,7 +104,7 @@ class Encryption extends Wrapper {
Update $update = null,
Manager $mountManager = null
) {
-
+
$this->mountPoint = $parameters['mountPoint'];
$this->mount = $parameters['mount'];
$this->encryptionManager = $encryptionManager;
@@ -167,20 +167,25 @@ class Encryption extends Wrapper {
return null;
}
$fullPath = $this->getFullPath($path);
+ $info = $this->getCache()->get($path);
if (isset($this->unencryptedSize[$fullPath])) {
$data['encrypted'] = true;
$data['size'] = $this->unencryptedSize[$fullPath];
} else {
- $info = $this->getCache()->get($path);
if (isset($info['fileid']) && $info['encrypted']) {
$data['size'] = $this->verifyUnencryptedSize($path, $info['size']);
$data['encrypted'] = true;
}
}
+ if (isset($info['encryptedVersion']) && $info['encryptedVersion'] > 1) {
+ $data['encryptedVersion'] = $info['encryptedVersion'];
+ }
+
return $data;
}
+
/**
* see http://php.net/manual/en/function.file_get_contents.php
*