diff options
author | Robin Appelman <robin@icewind.nl> | 2017-05-18 16:38:54 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-05-18 16:38:54 +0200 |
commit | 1f1e1b0d000488ac6a7032ae2ba8ba7e25232b22 (patch) | |
tree | d2836b4168f081a9a682fe59e5ec4821be2198ca /lib | |
parent | cd2b567c21c7329640ff8b819261dec6ee819249 (diff) | |
download | nextcloud-server-1f1e1b0d000488ac6a7032ae2ba8ba7e25232b22.tar.gz nextcloud-server-1f1e1b0d000488ac6a7032ae2ba8ba7e25232b22.zip |
use unmasked permissions during scanning
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Cache/Scanner.php | 3 | ||||
-rw-r--r-- | lib/private/Files/Cache/Wrapper/CachePermissionsMask.php | 1 | ||||
-rw-r--r-- | lib/private/Files/Storage/Wrapper/PermissionsMask.php | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index fe25da6d09a..229c6fc7d66 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -266,6 +266,9 @@ class Scanner extends BasicEmitter implements IScanner { * @return int the id of the added file */ protected function addToCache($path, $data, $fileId = -1) { + if (isset($data['scan_permissions'])) { + $data['permissions'] = $data['scan_permissions']; + } \OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data)); $this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data)); if ($this->cacheActive) { diff --git a/lib/private/Files/Cache/Wrapper/CachePermissionsMask.php b/lib/private/Files/Cache/Wrapper/CachePermissionsMask.php index 83cf01045a7..6125887fb83 100644 --- a/lib/private/Files/Cache/Wrapper/CachePermissionsMask.php +++ b/lib/private/Files/Cache/Wrapper/CachePermissionsMask.php @@ -40,6 +40,7 @@ class CachePermissionsMask extends CacheWrapper { protected function formatCacheEntry($entry) { if (isset($entry['permissions'])) { + $entry['scan_permissions'] = $entry['permissions']; $entry['permissions'] &= $this->mask; } return $entry; diff --git a/lib/private/Files/Storage/Wrapper/PermissionsMask.php b/lib/private/Files/Storage/Wrapper/PermissionsMask.php index 170929aa9fa..1bda92f13aa 100644 --- a/lib/private/Files/Storage/Wrapper/PermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/PermissionsMask.php @@ -143,7 +143,8 @@ class PermissionsMask extends Wrapper { $data = parent::getMetaData($path); if ($data && isset($data['permissions'])) { - $data['permissions'] = $data['permissions'] & $this->mask; + $data['scan_permissions'] = $data['permissions']; + $data['permissions'] &= $this->mask; } return $data; } |