-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Milestone
Description
https://github.com/kalessil/phpinspectionsea/blob/master/docs/probable-bugs.md#mkdir-race-condition
Extracted from comment:
rbac-php/src/CommonStorage.php
Lines 48 to 62 in cb61807
| if (!is_dir($directory)) { | |
| set_error_handler(static function (int $errorNumber, string $errorString) use ($directory): bool { | |
| // Handle race condition. | |
| // See https://github.com/kalessil/phpinspectionsea/blob/master/docs/probable-bugs.md#mkdir-race-condition | |
| if (!is_dir($directory)) { | |
| throw new RuntimeException( | |
| sprintf('Failed to create directory "%s". ', $directory) . $errorString, | |
| $errorNumber | |
| ); | |
| } | |
| return true; | |
| }); | |
| mkdir($directory, 0775, true); | |
| restore_error_handler(); | |
| } |
Metadata
Metadata
Assignees
Labels
No labels