GeneralUtility::fixPermissions has a bug if createGroup is set to the id
of the root group (0), and does not set the correct group. This is fixed
with a more sophisticated test in fixPermissions to allow 0 as
valid group. Default for createGroup is empty string, so it is now
checked with isset and strlen > 0 if chgrp() should be applied.
Additionally, the FAL test permissionsAreCorrectlyRetrieved is splitted
to four tests, and two of them are skipped if the test is run on linux
as root.
Change-Id: Icd3bb5808fef195da8394a8fd9c2797f9f01e9aa
Resolves: #40523
Releases: 6.0
Reviewed-on: http://review.typo3.org/14288
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
$result = @chmod($path, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']));
}
// Set createGroup if not empty
- if ($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']) {
+ if (
+ isset($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup'])
+ && strlen($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']) > 0
+ ) {
// "@" is there because file is not necessarily OWNED by the user
$changeGroupResult = @chgrp($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']);
$result = $changeGroupResult ? $result : FALSE;
clearstatcache();
$resultFileGroup = filegroup($filename);
unlink($filename);
- $this->assertEquals($resultFileGroup, $currentGroupId);
+ $this->assertEquals($currentGroupId, $resultFileGroup);
}
/**