8000 bug #37461 [Process] Fix Permission Denied error when writing sf_proc… · symfony/symfony@c0181c7 · GitHub
[go: up one dir, main page]

Skip to content

Commit c0181c7

Browse files
bug #37461 [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows (JasonStephensTAMU)
This PR was merged into the 3.4 branch. Discussion ---------- [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? |no | Deprecations? | no | Tickets | Fix #37294 | License | MIT | Doc PR | Passes current Process unit tests. On Windows systems, a new set of sf_proc_## files are generated in the system temp directory for each WindowsPipes object. These files are removed when the WindowsPipes object is destroyed. This avoids receiving a permission denied error when attempting to write to sf_proc_## files between multiple sites running as different users, when the users do not have permissions to modify each others files. Changes - [Process] WindowsPipes always creates new sf_proc_## files in constructor - [Process] WindowsPipes removes its sf_proc_## files in destructor Commits ------- 220be89 [Process] Fix Permission Denied error when writing sf_proc_00 lock files on Windows
2 parents 091fd50 + 220be89 commit c0181c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Process/Pipes/WindowsPipes.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public function __construct($input, $haveReadSupport)
5656
$file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name);
5757

5858
if (!$h = fopen($file.'.lock', 'w')) {
59+
if (file_exists($file.'.lock')) {
60+
continue 2;
61+
}
5962
restore_error_handler();
6063
throw new RuntimeException('A temporary file could not be opened to write the process output: '.$lastError);
6164
}

0 commit comments

Comments
 (0)
0