]> source.dussan.org Git - nextcloud-server.git/commitdiff
respect mount option while encrypting
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 07:42:54 +0000 (09:42 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:31 +0000 (13:30 +0200)
lib/private/files/storage/wrapper/encryption.php

index bc0b5c87adc0a103a71670a5ce6478665f186490..5245fe4cc45a85c2d6e1dd4e160b6b19c77c0c6c 100644 (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;
                        }