also apply permissions mask in getMetaData

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-02-10 15:29:48 +01:00
parent b4ade76665
commit f27113a6ee
No known key found for this signature in database
GPG Key ID: CBCA68FBAEBF98C9
2 changed files with 10 additions and 1 deletions

View File

@ -491,7 +491,7 @@ class Scanner extends BasicEmitter implements IScanner {
} else {
$lastPath = null;
while (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) {
$this->runBackgroundScanJob(function() use ($path) {
$this->runBackgroundScanJob(function () use ($path) {
$this->scan($path, self::SCAN_RECURSIVE_INCOMPLETE, self::REUSE_ETAG | self::REUSE_SIZE);
}, $path);
// FIXME: this won't proceed with the next item, needs revamping of getIncomplete()

View File

@ -138,4 +138,13 @@ class PermissionsMask extends Wrapper {
$sourceCache = parent::getCache($path, $storage);
return new CachePermissionsMask($sourceCache, $this->mask);
}
public function getMetaData($path) {
$data = parent::getMetaData($path);
if ($data && isset($data['permissions'])) {
$data['permissions'] = $data['permissions'] & $this->mask;
}
return $data;
}
}