summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-07 09:42:54 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:31 +0200
commit4a70ca665c64253ef4da7b0e8b18f12db9cda442 (patch)
treec743156f3bcd49fa8ad65169ced85c462d6a93c1 /lib
parentd637bffac6b8149aa2520ee7acb637ca1cbcc5f1 (diff)
downloadnextcloud-server-4a70ca665c64253ef4da7b0e8b18f12db9cda442.tar.gz
nextcloud-server-4a70ca665c64253ef4da7b0e8b18f12db9cda442.zip
respect mount option while encrypting
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/wrapper/encryption.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index bc0b5c87adc..5245fe4cc45 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -25,6 +25,7 @@ namespace OC\Files\Storage\Wrapper;
use OC\Encryption\Exceptions\ModuleDoesNotExistsException;
use OC\Files\Storage\LocalTempFileTrait;
+use OCP\Files\Mount\IMountPoint;
class Encryption extends Wrapper {
@@ -51,6 +52,9 @@ class Encryption extends Wrapper {
/** @var \OC\Encryption\File */
private $fileHelper;
+ /** @var IMountPoint */
+ private $mount;
+
/**
* @param array $parameters
* @param \OC\Encryption\Manager $encryptionManager
@@ -69,6 +73,7 @@ class Encryption extends Wrapper {
) {
$this->mountPoint = $parameters['mountPoint'];
+ $this->mount = $parameters['mount'];
$this->encryptionManager = $encryptionManager;
$this->util = $util;
$this->logger = $logger;
@@ -272,7 +277,7 @@ class Encryption extends Wrapper {
// encryption disabled on write of new file and write to existing unencrypted file -> don't encrypt
$encEnabled = $this->encryptionManager->isEnabled();
- if (!$encEnabled ) {
+ if (!$encEnabled || !$this->mount->getOption('encrypt', true)) {
if (!$targetExists || !$targetIsEncrypted) {
$shouldEncrypt = false;
}