summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-07-05 16:57:48 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-05 17:24:09 +0200
commit3a45bb52bc24fd13c63c03486b78d7bc3f798942 (patch)
treed44b0b300df7784b2e0ac0eb4b7452ee6b435632 /lib
parent642ebea4902c57ea2e536f9389602f3061572af1 (diff)
downloadnextcloud-server-3a45bb52bc24fd13c63c03486b78d7bc3f798942.tar.gz
nextcloud-server-3a45bb52bc24fd13c63c03486b78d7bc3f798942.zip
allow to disable encryption
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index 685ecc837bd..1baea1e476c 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -414,9 +414,13 @@ class Encryption extends Wrapper {
|| $mode === 'wb'
|| $mode === 'wb+'
) {
- // don't overwrite encrypted files if encryption is not enabled
+ // if we update a encrypted file with a un-encrypted one we change the db flag
if ($targetIsEncrypted && $encryptionEnabled === false) {
- throw new GenericEncryptionException('Tried to access encrypted file but encryption is not enabled');
+ $cache = $this->storage->getCache();
+ if ($cache) {
+ $entry = $cache->get($path);
+ $cache->update($entry->getId(), ['encrypted' => 0]);
+ }
}
if ($encryptionEnabled) {
// if $encryptionModuleId is empty, the default module will be used