aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2024-04-09 13:18:13 +0200
committerGitHub <noreply@github.com>2024-04-09 13:18:13 +0200
commite0fcf6b700f4233cfd1057e18ad9f3b41e4b9874 (patch)
tree1c83933d2e59c3f41309c66675bc124476fc8841 /lib/private/Files
parenta4de9888cf53352f440efe72bd2e01a1e3cc213a (diff)
parent4910e7e2310502cde223204f4c7488b4b08655fe (diff)
downloadnextcloud-server-e0fcf6b700f4233cfd1057e18ad9f3b41e4b9874.tar.gz
nextcloud-server-e0fcf6b700f4233cfd1057e18ad9f3b41e4b9874.zip
Merge pull request #44294 from nextcloud/fix/storage-mount-owner
fix: Pass the mountpoint target user to storages without owner
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Storage/Common.php13
-rw-r--r--lib/private/Files/Storage/Wrapper/Wrapper.php4
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index c236541390f..fb4aa0a7c3c 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -868,6 +868,19 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
}
/**
+ * Allow setting the storage owner
+ *
+ * This can be used for storages that do not have a dedicated owner, where we want to
+ * pass the user that we setup the mountpoint for along to the storage layer
+ *
+ * @param string|null $user
+ * @return void
+ */
+ public function setOwner(?string $user): void {
+ $this->owner = $user;
+ }
+
+ /**
* @return bool
*/
public function needsPartFile() {
diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php
index 2e96733ec66..9b7ca0214d1 100644
--- a/lib/private/Files/Storage/Wrapper/Wrapper.php
+++ b/lib/private/Files/Storage/Wrapper/Wrapper.php
@@ -674,4 +674,8 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea
}
return false;
}
+
+ public function setOwner(?string $user): void {
+ $this->getWrapperStorage()->setOwner($user);
+ }
}