From d182043e83a277a7f95e4d689b1e96d7b1b9a6fb Mon Sep 17 00:00:00 2001
From: Robin Appelman <robin@icewind.nl>
Date: Wed, 20 Jan 2021 17:15:57 +0100
Subject: [PATCH] explicitly set permissions on newly created folders

this works around any `umask` that might be set and limiting the folder permissions

Signed-off-by: Robin Appelman <robin@icewind.nl>
---
 lib/private/Files/Storage/Local.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index 81d1d083eb8..944b0b69959 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -86,7 +86,10 @@ class Local extends \OC\Files\Storage\Common {
 	}
 
 	public function mkdir($path) {
-		return @mkdir($this->getSourcePath($path), 0777, true);
+		$sourcePath = $this->getSourcePath($path);
+		$result = @mkdir($sourcePath, 0777, true);
+		chmod($sourcePath, 0755);
+		return $result;
 	}
 
 	public function rmdir($path) {
-- 
GitLab