Skip to content

Commit c225e63

Browse files
committed
refactor: change mkdir permissions from 0777 to 0755 for better security
1 parent 730d82e commit c225e63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ProgramSaver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function save(array $programs, string $path): void
2929
}
3030

3131
$dir = dirname($path);
32-
if (!is_dir($dir) && !mkdir($dir, 0777, true) && !is_dir($dir)) {
32+
if (!is_dir($dir) && !mkdir($dir, 0755, true) && !is_dir($dir)) {
3333
throw new \RuntimeException("Failed to create directory: {$dir}");
3434
}
3535

tests/ProgramSaverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function setUp(): void
2828
{
2929
parent::setUp();
3030
$this->tempDir = sys_get_temp_dir() . '/program_saver_test_' . uniqid();
31-
mkdir($this->tempDir, 0777, true);
31+
mkdir($this->tempDir, 0755, true);
3232
}
3333

3434
/**

0 commit comments

Comments
 (0)