Project

General

Profile

Actions

Bug #36167

closed

Make sure fixPermissions gets 4 digit string

Added by Christian Kuhn over 12 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2012-04-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Tolleiv Nietsch over 12 years ago

  • Status changed from New to Accepted
  • Assignee set to Tolleiv Nietsch
Actions #2

Updated by Tolleiv Nietsch over 12 years ago

  • 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');
    }
Actions #3

Updated by Mathias Schreiber almost 10 years ago

  • Target version set to 7.5
  • Is Regression set to No
Actions #4

Updated by Benni Mack about 9 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #5

Updated by Christian Kuhn about 9 years ago

i'd suggest to just improve the documentation a bit ... "this is a 4 characters long bitmask, bla bla"

Actions #6

Updated by Gerrit Code Review about 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44430

Actions #7

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44430

Actions #8

Updated by Benni Mack about 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF