From 27279a62f87b2f8a3cbffb411d9f812e9a5b7a9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Feb 2023 11:01:56 +0100 Subject: [PATCH] FIx #huntrd6cb06dc-5d10-4197-8f89-847c3203d953 --- htdocs/core/class/conf.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 0393803d793..58726c7222f 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -600,7 +600,18 @@ class Conf $this->global->USER_PASSWORD_GENERATED = 'standard'; // Default password generator } if (empty($this->global->MAIN_UMASK)) { - $this->global->MAIN_UMASK = '0664'; // Default mask + $this->global->MAIN_UMASK = '0660'; // Default mask + } else { + // We remove the execute bits on the file umask + $tmpumask = (octdec($this->global->MAIN_UMASK) & 0666); + $tmpumask = decoct($tmpumask); + if (!preg_match('/^0/', $tmpumask)) { + $tmpumask = '0'.$tmpumask; + } + if (empty($tmpumask) || $tmpumask === '0') { + $tmpumask = '0664'; + } + $this->global->MAIN_UMASK = $tmpumask; } // conf->use_javascript_ajax