8000 Revert "bug #24105 [Filesystem] check permissions if dump target dir … · symfony/symfony@7793b79 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7793b79

Browse files
committed
Revert "bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)"
This reverts commit d74144f, reversing changes made to 2b79f48.
1 parent 3145006 commit 7793b79

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -532,16 +532,6 @@ public function dumpFile($filename, $content, $mode = 0666)
532532
$dir = dirname($filename);
533533

534534
if (!is_dir($dir)) {
535-
$oldCwd = getcwd();
536-
537-
if (!@chdir(dirname($dir))) {
538-
// When the parent directory misses the executable permission bit, we are unable to enter it and thus
539-
// cannot check if the target directory exists.
540-
throw new IOException(sprintf('Unable to detect if the target directory "%s" exists.', $dir));
541-
}
542-
543-
chdir($oldCwd);
544-
545535
$this->mkdir($dir);
546536
}
547537

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,26 +1102,6 @@ public function testDumpKeepsExistingPermissionsWhenOverwritingAnExistingFile()
11021102
$this->assertFilePermissions(745, $filename);
11031103
}
11041104

1105-
/**
1106-
* @expectedException \Symfony\Component\Filesystem\Exception\IOException
1107-
* @expectedExceptionMessageRegExp /^Unable to detect if the target directory ".*" exists\.$/
1108-
*/
1109-
public function testDumpFailsWithExceptionIfExecutablePermissionsForTheParentDirectoryAreMissing()
1110-
{
1111-
$this->markAsSkippedIfChmodIsMissing();
1112-
1113-
$target = $this->workspace.DIRECTORY_SEPARATOR.'foo';
1114-
$file = $target.DIRECTORY_SEPARATOR.'foobar';
1115-
mkdir($target);
1116-
chmod($this->workspace, 0666);
1117-
1118-
if (false !== @chdir($this->workspace)) {
1119-
$this->markTestSkipped('Test skipped as the used PHP version does not prevent entering directories without the required permissions.');
1120-
}
1121-
1122-
$this->filesystem->dumpFile($file, 'baz');
1123-
}
1124-
11251105
public function testCopyShouldKeepExecutionPermission()
11261106
{
11271107
$this->markAsSkippedIfChmodIsMissing();

src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ protected function tearDown()
6161
$this->longPathNamesWindows = array();
6262
}
6363

64-
chmod($this->workspace, 0777);
6564
$this->filesystem->remove($this->workspace);
6665
umask($this->umask);
6766
}

0 commit comments

Comments
 (0)
0