mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
Merge pull request #29476 from nextcloud/backport/29115/stable21
[stable21] Fix permissions when copying from ObjectStorage
This commit is contained in:
commit
373b63ecea
2 changed files with 9 additions and 1 deletions
|
|
@ -1097,7 +1097,7 @@ class Cache implements ICache {
|
|||
* @param ICache $sourceCache
|
||||
* @param ICacheEntry $sourceEntry
|
||||
* @param string $targetPath
|
||||
* @return int fileid of copied entry
|
||||
* @return int fileId of copied entry
|
||||
*/
|
||||
public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int {
|
||||
if ($sourceEntry->getId() < 0) {
|
||||
|
|
|
|||
|
|
@ -540,7 +540,15 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
|
|||
if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class)) {
|
||||
/** @var ObjectStoreStorage $sourceStorage */
|
||||
if ($sourceStorage->getObjectStore()->getStorageId() === $this->getObjectStore()->getStorageId()) {
|
||||
/** @var CacheEntry $sourceEntry */
|
||||
$sourceEntry = $sourceStorage->getCache()->get($sourceInternalPath);
|
||||
$sourceEntryData = $sourceEntry->getData();
|
||||
// $sourceEntry['permissions'] here is the permissions from the jailed storage for the current
|
||||
// user. Instead we use $sourceEntryData['scan_permissions'] that are the permissions from the
|
||||
// unjailed storage.
|
||||
if (is_array($sourceEntryData) && array_key_exists('scan_permissions', $sourceEntryData)) {
|
||||
$sourceEntry['permissions'] = $sourceEntryData['scan_permissions'];
|
||||
}
|
||||
$this->copyInner($sourceEntry, $targetInternalPath);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue