From 5515c7b2c0fd349a3c9bda680030b126ba223b61 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 10 Aug 2017 11:58:01 +0200 Subject: [PATCH 1/2] 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(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 71b453d299..3fe6d43ca3 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 + ); + } } } From b9b88aa666ba8420311b6f6f24b42aadd03eed04 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 10 Aug 2017 12:35:33 +0200 Subject: [PATCH 2/2] 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(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 3fe6d43ca3..7fee0883a2 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; } /**