Skip to content

Commit 935afe6

Browse files
staabmfabpot
authored andcommitted
[PROCESS] make sure /dev/tty is readable
When using Process from Web-SAPI it is likely that the webserver user doesn't has rights to use /dev/tty
1 parent cae6de6 commit 935afe6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,9 @@ public function setTty($tty)
792792
if ('\\' === DIRECTORY_SEPARATOR && $tty) {
793793
throw new RuntimeException('TTY mode is not supported on Windows platform.');
794794
}
795+
if ($tty && (!file_exists('/dev/tty') || !is_readable('/dev/tty'))) {
796+
throw new RuntimeException('TTY mode requires /dev/tty to be readable.');
797+
}
795798

796799
$this->tty = (bool) $tty;
797800

0 commit comments

Comments
 (0)