Skip to content

Commit 0ca4555

Browse files
committed
Fix umasks in chmod() calls
1 parent 519b595 commit 0ca4555

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function remove($files)
112112
public function chmod($files, $mode, $umask = 0000)
113113
{
114114
foreach ($this->toIterator($files) as $file) {
115-
chmod($file, $mode ^ $umask);
115+
chmod($file, $mode & ~$umask);
116116
}
117117
}
118118

Tests/FilesystemTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ public function testChmodAppliesUmask()
332332
$file = $this->workspace.DIRECTORY_SEPARATOR.'file';
333333
touch($file);
334334

335-
$this->filesystem->chmod($file, 0777, 0022);
336-
$this->assertEquals(755, $this->getFilePermisions($file));
335+
$this->filesystem->chmod($file, 0770, 0022);
336+
$this->assertEquals(750, $this->getFilePermisions($file));
337337
}
338338

339339
public function testChmodChangesModeOfArrayOfFiles()

0 commit comments

Comments
 (0)