summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2017-01-25 12:22:09 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-03-20 01:43:24 -0600
commita4ce4403926fd314a68ec6cd099cfecc54b5ddfc (patch)
treea918de5e42e296314b180630463190d0273787f5 /apps/files_sharing/lib
parent528a903a7b23ea628e6ec2fc9a221821297c0bec (diff)
downloadnextcloud-server-a4ce4403926fd314a68ec6cd099cfecc54b5ddfc.tar.gz
nextcloud-server-a4ce4403926fd314a68ec6cd099cfecc54b5ddfc.zip
Ignore NoUserException for shares from ghosts
Add unit tests for FailedStorage init from SharedStorage Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/SharedStorage.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 888cbfda143..560c195d8ba 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -32,15 +32,14 @@
namespace OCA\Files_Sharing;
use OC\Files\Filesystem;
-use OC\Files\Cache\FailedCache;
use OC\Files\Storage\Wrapper\PermissionsMask;
-use OCA\Files_Sharing\ISharedStorage;
use OC\Files\Storage\FailedStorage;
use OCP\Constants;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorage;
use OCP\Lock\ILockingProvider;
+use OC\User\NoUserException;
/**
* Convert target path to source path and pass the function call to the correct storage provider
@@ -121,6 +120,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
'mask' => $this->superShare->getPermissions()
]);
} catch (NotFoundException $e) {
+ // original file not accessible or deleted, set FailedStorage
+ $this->storage = new FailedStorage(['exception' => $e]);
+ $this->rootPath = '';
+ } catch (NoUserException $e) {
+ // sharer user deleted, set FailedStorage
$this->storage = new FailedStorage(['exception' => $e]);
$this->rootPath = '';
} catch (\Exception $e) {