Skip to content

Commit aafa6ea

Browse files
committed
Don't run proc_open_cmd.phpt in parallel with other tests
This test puts a fake cmd.exe in the CWD and removes it only after the test has finished. We need to avoid that other tests are running while that fake cmd.exe is there, because they may use it instead of the proper cmd.exe. We also unlink the fake cmd.exe as soon as possible, regardless of the test result. Fixes GH-17098. Closes GH-17090.
1 parent a57a434 commit aafa6ea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/standard/tests/general_functions/proc_open_cmd.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--TEST--
22
Harden against cmd.exe hijacking
3+
--CONFLICTS--
4+
all
35
--SKIPIF--
46
<?php
57
if (PHP_OS_FAMILY !== "Windows") die("skip only for Windows");
@@ -18,6 +20,7 @@ if (($num = stream_select($read, $write, $except, 1000)) === false) {
1820
fpassthru($stream);
1921
}
2022
}
23+
@unlink("cmd.exe");
2124
?>
2225
--EXPECTF--
2326
resource(%d) of type (process)

0 commit comments

Comments
 (0)