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-10 17:03:27 +0100
commit56fd462718f2a60d1f9fa2955db28fdc1a5e39b9 (patch)
treeb1e5f33ede62671a46614eb06dcbed611f82764c /lib
parentc7e5bc0f9ab6f58bf9a47dd0c3795e1183419652 (diff)
downloadnextcloud-server-56fd462718f2a60d1f9fa2955db28fdc1a5e39b9.tar.gz
nextcloud-server-56fd462718f2a60d1f9fa2955db28fdc1a5e39b9.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 d477678c277..adee8ced772 100644
--- a/lib/private/Files/Storage/Wrapper/Jail.php
+++ b/lib/private/Files/Storage/Wrapper/Jail.php
@@ -60,6 +60,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();
}