summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2018-03-02 16:10:49 +0100
committerGitHub <noreply@github.com>2018-03-02 16:10:49 +0100
commit1953a11dfa84611cf6a70ecf4d057072f54b0f64 (patch)
treed9e98c47db4bb5bdea2118f5c62aff15d0489199
parented239d72dc51b4b50eaec1ab8bbeb2e5cf6249b7 (diff)
parent3a3368336440dc0cecf82b48b96879ebdeb6bb75 (diff)
downloadnextcloud-server-1953a11dfa84611cf6a70ecf4d057072f54b0f64.tar.gz
nextcloud-server-1953a11dfa84611cf6a70ecf4d057072f54b0f64.zip
Merge pull request #6805 from nextcloud/can-not-change-encryption-directory
Can not change encryption directory
-rw-r--r--core/Command/Encryption/ChangeKeyStorageRoot.php6
-rw-r--r--tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php3
2 files changed, 5 insertions, 4 deletions
diff --git a/core/Command/Encryption/ChangeKeyStorageRoot.php b/core/Command/Encryption/ChangeKeyStorageRoot.php
index 7c6ad5d6126..15e88326973 100644
--- a/core/Command/Encryption/ChangeKeyStorageRoot.php
+++ b/core/Command/Encryption/ChangeKeyStorageRoot.php
@@ -143,11 +143,11 @@ class ChangeKeyStorageRoot extends Command {
$result = $this->rootView->file_put_contents(
$newRoot . '/' . Storage::KEY_STORAGE_MARKER,
- 'ownCloud will detect this folder as key storage root only if this file exists'
+ 'Nextcloud will detect this folder as key storage root only if this file exists'
);
- if ($result === false) {
- throw new \Exception("Can't write to new root folder. Please check the permissions and try again");
+ if (!$result) {
+ throw new \Exception("Can't access the new root folder. Please check the permissions and make sure that the folder is in your data folder");
}
}
diff --git a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
index 57eb2137ac1..4ecea745cfa 100644
--- a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
+++ b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
@@ -175,7 +175,7 @@ class ChangeKeyStorageRootTest extends TestCase {
$this->view->expects($this->once())->method('file_put_contents')
->with('newRoot/' . \OC\Encryption\Keys\Storage::KEY_STORAGE_MARKER,
- 'ownCloud will detect this folder as key storage root only if this file exists');
+ 'Nextcloud will detect this folder as key storage root only if this file exists')->willReturn(true);
$this->invokePrivate($this->changeKeyStorageRoot, 'prepareNewRoot', ['newRoot']);
}
@@ -198,6 +198,7 @@ class ChangeKeyStorageRootTest extends TestCase {
public function dataTestPrepareNewRootException() {
return [
[true, false],
+ [true, null],
[false, true]
];
}