summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-05-07 10:11:44 +0200
committerGitHub <noreply@github.com>2018-05-07 10:11:44 +0200
commit5484260569bb608b2f57ddfb6f13f86e6d245e70 (patch)
tree3169f6e6e3a669c50486a0c54df2d590859eb534
parent0da6f6b35699f85f20a8414da60290ef15b2788c (diff)
parent0ff83f7230a0c16a3ea99390a8e23706adb497c4 (diff)
downloadnextcloud-server-5484260569bb608b2f57ddfb6f13f86e6d245e70.tar.gz
nextcloud-server-5484260569bb608b2f57ddfb6f13f86e6d245e70.zip
Merge pull request #9372 from nextcloud/bugfix/4577
Do not allow folder creation with quota of 0
-rw-r--r--lib/private/Files/Storage/Wrapper/Quota.php8
-rw-r--r--tests/lib/Files/Storage/Wrapper/QuotaTest.php5
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Quota.php b/lib/private/Files/Storage/Wrapper/Quota.php
index 28ae03d604b..a7d5f3101fe 100644
--- a/lib/private/Files/Storage/Wrapper/Quota.php
+++ b/lib/private/Files/Storage/Wrapper/Quota.php
@@ -200,4 +200,12 @@ class Quota extends Wrapper {
return false;
}
}
+
+ public function mkdir($path) {
+ if ($this->quota === 0.0) {
+ return false;
+ }
+
+ return parent::mkdir($path);
+ }
}
diff --git a/tests/lib/Files/Storage/Wrapper/QuotaTest.php b/tests/lib/Files/Storage/Wrapper/QuotaTest.php
index b796e767a7b..546ab69ef6b 100644
--- a/tests/lib/Files/Storage/Wrapper/QuotaTest.php
+++ b/tests/lib/Files/Storage/Wrapper/QuotaTest.php
@@ -208,4 +208,9 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper'));
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota'));
}
+
+ public function testNoMkdirQuotaZero() {
+ $instance = $this->getLimitedStorage(0.0);
+ $this->assertFalse($instance->mkdir('foobar'));
+ }
}