From 9cae892974010aa913c1a9a2edd9b4722054d1c4 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(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index bc16511bdab..6d3f2b0ba9f 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1950,11 +1950,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 d25ea6ae1cf6c030429df41f85d1b8037a106117 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(-) diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 6d3f2b0ba9f..da1c67471ab 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -2066,7 +2066,7 @@ class View { return ($pathSegments[2] === 'files') && (count($pathSegments) > 3); } - return true; + return strpos($path, '/appdata_') !== 0; } /** -- cgit v1.2.3