From 5515c7b2c0fd349a3c9bda680030b126ba223b61 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 10 Aug 2017 11:58:01 +0200 Subject: Still throw a locked exception when the path is not relative to $user/files/ Signed-off-by: Joas Schilling --- lib/private/Files/View.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 71b453d299a..3fe6d43ca31 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1941,11 +1941,18 @@ class View { ); } } catch (\OCP\Lock\LockedException $e) { - // rethrow with the a human-readable path - throw new \OCP\Lock\LockedException( - $this->getPathRelativeToFiles($absolutePath), - $e - ); + try { + // rethrow with the a human-readable path + throw new \OCP\Lock\LockedException( + $this->getPathRelativeToFiles($absolutePath), + $e + ); + } catch (\InvalidArgumentException $e) { + throw new \OCP\Lock\LockedException( + $absolutePath, + $e + ); + } } } -- cgit v1.2.3 From b9b88aa666ba8420311b6f6f24b42aadd03eed04 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 10 Aug 2017 12:35:33 +0200 Subject: Don't lock in the appdata_ directory Signed-off-by: Joas Schilling --- lib/private/Files/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 3fe6d43ca31..7fee0883a25 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -2057,7 +2057,7 @@ class View { return ($pathSegments[2] === 'files') && (count($pathSegments) > 3); } - return true; + return strpos($path, '/appdata_') !== 0; } /** -- cgit v1.2.3