From 7a344e1293ec3ed90b12a2e9753e299262177475 Mon Sep 17 00:00:00 2001 From: Phil Page Date: Sun, 16 Feb 2025 19:40:56 +0000 Subject: [PATCH] Apply correct file permissions after renaming --- lib/internal/Magento/Framework/Filesystem/Driver/File.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index d437070fd2aef..a6740c49d90dd 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -344,7 +344,8 @@ public function rename($oldPath, $newPath, ?DriverInterface $targetDriver = null clearstatcache(true, $this->getScheme() . $oldPath); clearstatcache(true, $newPath); } - $this->changePermissions($newPath, 0777 & ~umask()); + $permissions = $this->isFile($newPath) ? 0666 : 0777; + $this->changePermissions($newPath, $permissions & ~umask()); } else { $content = $this->fileGetContents($oldPath); if (false !== $targetDriver->filePutContents($newPath, $content)) {