Skip to content

Commit

Permalink
Merge pull request #4140 from nextcloud/no_encryption_no_wrapper
Browse files Browse the repository at this point in the history
Don't add the Encryption Storage Wrapper if there are no encryption modules
  • Loading branch information
schiessle authored Mar 31, 2017
2 parents 6a6300b + 7d4c422 commit 85da937
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/integration/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [ "$INSTALLED" == "true" ]; then
$OCC app:enable files_external

mkdir -p work/local_storage
OUTPUT_CREATE_STORAGE=`$OCC files_external:create local_storage local null::null -c datadir=./build/integration/work/local_storage`
OUTPUT_CREATE_STORAGE=`$OCC files_external:create local_storage local null::null -c datadir=$PWD/work/local_storage`

ID_STORAGE=`echo $OUTPUT_CREATE_STORAGE | tr ' ' '\n' | tail -n1`

Expand Down
7 changes: 5 additions & 2 deletions lib/private/Encryption/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,11 @@ public function getDefaultEncryptionModuleId() {
* Add storage wrapper
*/
public function setupStorage() {
$encryptionWrapper = new EncryptionWrapper($this->arrayCache, $this, $this->logger);
Filesystem::addStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'), 2);
// If encryption is disabled and there are no loaded modules it makes no sense to load the wrapper
if (!empty($this->encryptionModules) || $this->isEnabled()) {
$encryptionWrapper = new EncryptionWrapper($this->arrayCache, $this, $this->logger);
Filesystem::addStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'), 2);
}
}


Expand Down

0 comments on commit 85da937

Please sign in to comment.