Project

General

Profile

Actions

Bug #17081

closed

t3lib_div::mkdir() resets setgid bit on folder creation

Added by Markus Bertheau over 17 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2007-03-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
5.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

markus@kaiman:.../htdocs/fileadmin$ umask # is the same for apache
0002
markus@kaiman:.../htdocs/fileadmin$ pwd
/home/projects/projectname/htdocs/fileadmin
markus@kaiman:.../htdocs/fileadmin$ ls -lad .
drwxrwsr-x 6 developer projectname 4096 2007-03-06 14:27 .
markus@kaiman:.../htdocs/fileadmin$ grep CreateMask ../typo3conf/localconf.php
$TYPO3_CONF_VARS['BE']['fileCreateMask'] = '0664';
$TYPO3_CONF_VARS['BE']['folderCreateMask'] = '0775';
markus@kaiman:.../htdocs/fileadmin$ ls -lad new_folder # created with Typo3 BE
drwxrwxr-x 2 www-data projectname 4096 2007-03-06 14:28 new_folder

t3lib_div::mkdir() contains the line

chmod($theNewFolder, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask'])); //added this line, because the mode at 'mkdir' has a strange behaviour sometimes

, which unfortunately speaks for the quality of the whole project. "Has a strange behaviour sometimes". How I read this: "But I was too lazy to find out and solve the real problem, instead I put this workaround in without understanding all consequences."

According to svn this bug seems to exist since before SVN was used (i.e. it is present in the earliest revision of class.t3lib_div.php in SVN).

If there was information about which strange behaviour mkdir with mode sometimes exhibits, I could have sent a patch; without this information I can only suggest to remove the chmod() line completely and wait for that issue to come up again. Then one can understand the issue and solve it.

(issue imported from #M5139)

Actions

Also available in: Atom PDF