diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-10 13:01:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-10 13:01:16 -0500 |
commit | 7ce627c308fc34e38a125847881d917f09dc54aa (patch) | |
tree | 004d7270ef83dd17385e7f2253797a4df6eaa92e | |
parent | 407831ac3e6d6642057ed6bac1d226a19338e385 (diff) | |
parent | 6d5adb8b8f12bbfda71044ede557973fed50b240 (diff) | |
download | nextcloud-server-11.0.3RC1.tar.gz nextcloud-server-11.0.3RC1.zip |
Merge pull request #4278 from nextcloud/permissions-mask-scanner-11v11.0.3RC1
Dont use the permissions mask while scanning
-rw-r--r-- | lib/private/Files/Storage/Wrapper/PermissionsMask.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Wrapper/PermissionsMask.php b/lib/private/Files/Storage/Wrapper/PermissionsMask.php index 239824b67e2..86e3c8595f5 100644 --- a/lib/private/Files/Storage/Wrapper/PermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/PermissionsMask.php @@ -138,4 +138,8 @@ class PermissionsMask extends Wrapper { $sourceCache = parent::getCache($path, $storage); return new CachePermissionsMask($sourceCache, $this->mask); } + + public function getScanner($path = '', $storage = null) { + return parent::getScanner($path, $this->storage); + } } diff --git a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php index 9859915e2cb..d0903ce5f97 100644 --- a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php +++ b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php @@ -10,6 +10,9 @@ namespace Test\Files\Storage\Wrapper; use OCP\Constants; +/** + * @group DB + */ class PermissionsMaskTest extends \Test\Files\Storage\Storage { /** @@ -102,4 +105,13 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage { $storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE); $this->assertFalse($storage->fopen('foo', 'w')); } + + public function testScanNewFiles() { + $storage = $this->getMaskedStorage(Constants::PERMISSION_READ + Constants::PERMISSION_CREATE); + $storage->file_put_contents('foo', 'bar'); + $storage->getScanner()->scan(''); + + $this->assertEquals(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE, $this->sourceStorage->getCache()->get('foo')->getPermissions()); + $this->assertEquals(Constants::PERMISSION_READ, $storage->getCache()->get('foo')->getPermissions()); + } } |