summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-11-10 17:02:35 +0100
committerRobin Appelman <robin@icewind.nl>2017-11-28 13:55:42 +0100
commit6d8de960c9773863db0df489028cee4b046c4a1b (patch)
treedaa1c86d79aca62a5bc82f70f032d4cadebfa8cc /lib
parent036eae6956ca4a53c7487be10494574bace0ce79 (diff)
downloadnextcloud-server-6d8de960c9773863db0df489028cee4b046c4a1b.tar.gz
nextcloud-server-6d8de960c9773863db0df489028cee4b046c4a1b.zip
Use the correct root for shared jail when the source storage is also a jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Storage/Wrapper/Jail.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Jail.php b/lib/private/Files/Storage/Wrapper/Jail.php
index 4fa2428c968..d7f244b7d31 100644
--- a/lib/private/Files/Storage/Wrapper/Jail.php
+++ b/lib/private/Files/Storage/Wrapper/Jail.php
@@ -58,6 +58,17 @@ class Jail extends Wrapper {
}
}
+ public function getJailedPath($path) {
+ $root = rtrim($this->rootPath, '/') . '/';
+
+ if (strpos($path, $root) !== 0) {
+ return null;
+ } else {
+ $path = substr($path, strlen($this->rootPath));
+ return trim($path, '/');
+ }
+ }
+
public function getId() {
return parent::getId();
}