Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaus-Justus Heine <himself@claus-justus-heine.de>2022-02-03 11:59:28 +0300
committerVincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com>2022-02-18 18:46:35 +0300
commitc31adf12b97283096c63f40185fa6935c3918a2c (patch)
tree718ff417388e4626d4a12e74b5bc9606f3c2e3ac /lib/private/legacy
parentde9e61ab6593533831b69da275427e26f0b529ff (diff)
Use the unjailed-path in OC_Helper::getStorageInfo() for files located in SharedStorage.
The current implementation already switches the storage-backend to $storage->getSourceStorage(). However, it then calls $rootInfo->getInternalPath() which returns the internal path relative to the storage where the share is mounted. This is wrong, we need also to unjail the path. Compare, e.g., with OCA\Files_Sharing\SharedStorage::file_get/put_contents() for the "logic". Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/OC_Helper.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 52c49f1d795..efb9252e346 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -506,6 +506,9 @@ class OC_Helper {
if ($storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) {
$includeExtStorage = false;
$sourceStorage = $storage->getSourceStorage();
+ $internalPath = $storage->getUnjailedPath($rootInfo->getInternalPath());
+ } else {
+ $internalPath = $rootInfo->getInternalPath();
}
if ($includeExtStorage) {
if ($storage->instanceOfStorage('\OC\Files\Storage\Home')
@@ -528,7 +531,7 @@ class OC_Helper {
/** @var \OC\Files\Storage\Wrapper\Quota $storage */
$quota = $sourceStorage->getQuota();
}
- $free = $sourceStorage->free_space($rootInfo->getInternalPath());
+ $free = $sourceStorage->free_space($internalPath);
if ($free >= 0) {
$total = $free + $used;
} else {