Skip to content

Commit 10aab0d

Browse files
icewind1991backportbot[bot]
authored andcommitted
fix: give target file all permissions on copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 751f80c commit 10aab0d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/private/Files/Cache/Cache.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,12 @@ public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, str
11691169
throw new \RuntimeException('Invalid source cache entry on copyFromCache');
11701170
}
11711171
$data = $this->cacheEntryToArray($sourceEntry);
1172+
// since we are essentially creating a new file, we don't have to obey the source permissions
1173+
if ($sourceEntry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE) {
1174+
$data['permissions'] = Constants::PERMISSION_ALL;
1175+
} else {
1176+
$data['permissions'] = Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE;
1177+
}
11721178

11731179
// when moving from an encrypted storage to a non-encrypted storage remove the `encrypted` mark
11741180
if ($sourceCache instanceof Cache && $sourceCache->hasEncryptionWrapper() && !$this->hasEncryptionWrapper()) {

0 commit comments

Comments
 (0)