respect mount option while encrypting

This commit is contained in:
Thomas Müller 2015-04-07 09:42:54 +02:00
parent d637bffac6
commit 4a70ca665c
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}