diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-11-22 19:15:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-22 19:15:50 +0300 |
commit | f118ac6e3783218d4d942c96a37ee06c9593bacf (patch) | |
tree | 3016ebdbb9dfba2b28d18e3c8b2ab83d69ff0ac3 /lib | |
parent | d886da7a68321e699bb22a38ec9748b983ef290e (diff) | |
parent | 8d6a7b756ba5dd8dc7379589962d6fbd8231ee90 (diff) |
Merge pull request #26600 from owncloud/stable9.1-d1c844093539a2d0bf89fd5068e85448c11a8be9
[stable9.1] Skip local shares in bkg scan and occ files:scan (#26590)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index 0fbe0967877..21d567db5db 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -117,14 +117,19 @@ class Scanner extends PublicEmitter { public function backgroundScan($dir) { $mounts = $this->getMounts($dir); foreach ($mounts as $mount) { - if (is_null($mount->getStorage())) { + $storage = $mount->getStorage(); + if (is_null($storage)) { continue; } // don't scan the root storage - if ($mount->getStorage()->instanceOfStorage('\OC\Files\Storage\Local') && $mount->getMountPoint() === '/') { + if ($storage->instanceOfStorage('\OC\Files\Storage\Local') && $mount->getMountPoint() === '/') { + continue; + } + + // don't scan received local shares, these can be scanned when scanning the owner's storage + if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) { continue; } - $storage = $mount->getStorage(); $scanner = $storage->getScanner(); $this->attachListener($mount); @@ -155,10 +160,10 @@ class Scanner extends PublicEmitter { } $mounts = $this->getMounts($dir); foreach ($mounts as $mount) { - if (is_null($mount->getStorage())) { + $storage = $mount->getStorage(); + if (is_null($storage)) { continue; } - $storage = $mount->getStorage(); // if the home storage isn't writable then the scanner is run as the wrong user if ($storage->instanceOfStorage('\OC\Files\Storage\Home') and (!$storage->isCreatable('') or !$storage->isCreatable('files')) @@ -170,6 +175,11 @@ class Scanner extends PublicEmitter { } } + + // don't scan received local shares, these can be scanned when scanning the owner's storage + if ($storage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) { + continue; + } $relativePath = $mount->getInternalPath($dir); $scanner = $storage->getScanner(); $scanner->setUseTransactions(false); |