diff --git a/lib/private/Files/Storage/Wrapper/Jail.php b/lib/private/Files/Storage/Wrapper/Jail.php index 65ee6f1181ad7..7f23971b375a8 100644 --- a/lib/private/Files/Storage/Wrapper/Jail.php +++ b/lib/private/Files/Storage/Wrapper/Jail.php @@ -344,6 +344,10 @@ public function free_space($path) { return $this->getWrapperStorage()->free_space($this->getUnjailedPath($path)); } + public function free_space_skip_unjail_path($path) { + return $this->getWrapperStorage()->free_space($path); + } + /** * search for occurrences of $query in file names * diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php index 6bc66bf9c8929..c275c4ef93a2f 100644 --- a/lib/private/Files/Storage/Wrapper/Wrapper.php +++ b/lib/private/Files/Storage/Wrapper/Wrapper.php @@ -334,6 +334,10 @@ public function free_space($path) { return $this->getWrapperStorage()->free_space($path); } + public function free_space_skip_unjail_path($path) { + return $this->getWrapperStorage()->free_space_skip_unjail_path($path); + } + /** * search for occurrences of $query in file names * diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 0d1903007c27e..dfee4839d0a4b 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -517,8 +517,10 @@ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoin $mount = $rootInfo->getMountPoint(); $storage = $mount->getStorage(); $sourceStorage = $storage; + $skipUnjailPath = false; if ($storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) { $includeExtStorage = false; + $skipUnjailPath = true; $internalPath = $storage->getUnjailedPath($rootInfo->getInternalPath()); } else { $internalPath = $rootInfo->getInternalPath(); @@ -545,7 +547,11 @@ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoin $quota = $sourceStorage->getQuota(); } try { - $free = $sourceStorage->free_space($internalPath); + if ($skipUnjailPath === True) { + $free = $sourceStorage->free_space_skip_unjail_path($internalPath); + } else { + $free = $sourceStorage->free_space($internalPath); + } } catch (\Exception $e) { if ($path === "") { throw $e;