Bug #36167
closed
Make sure fixPermissions gets 4 digit string
Added by Christian Kuhn over 12 years ago.
Updated about 7 years ago.
Description
print_r(octdec(0660) . "\n");
print_r(octdec(660));
are different (same if string, though) ... this should probably be sanitized in fixPermissions to circumvent a nasty configuration problem.
- Status changed from New to Accepted
- Assignee set to Tolleiv Nietsch
- Assignee deleted (
Tolleiv Nietsch)
A possible test for this - haven't figured out how to solve it yet:
/**
* @test
*/
public function fixPermissionsUsesProperPermissionString() {
if (TYPO3_OS == 'WIN') {
$this->markTestSkipped('fixPermissions() tests not available on Windows');
}
// Create and prepare test file
$filename = PATH_site . 'typo3temp/' . uniqid('test_');
t3lib_div::writeFileToTypo3tempDir($filename, '42');
chmod($filename, 0742);
// Set target permissions and run method
$GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'] = 0660;
$fixPermissionsResult = t3lib_div::fixPermissions($filename);
// Get actual permissions and clean up
clearstatcache();
debug(decoct(fileperms($filename)));
$resultFilePermissions = substr(decoct(fileperms($filename)), 2);
unlink($filename);
// Test if everything was ok
$this->assertTrue($fixPermissionsResult);
$this->assertEquals($resultFilePermissions, '0660');
}
- Target version set to 7.5
- Is Regression set to No
- Target version changed from 7.5 to 7 LTS
i'd suggest to just improve the documentation a bit ... "this is a 4 characters long bitmask, bla bla"
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF