From 935afe650ac597041f8323eebce18eb5465d11be Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 13 Feb 2015 16:10:22 +0100 Subject: [PATCH] [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 --- src/Symfony/Component/Process/Process.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index d7626029251c..0c886d1c0ef6 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -792,6 +792,9 @@ public function setTty($tty) if ('\\' === DIRECTORY_SEPARATOR && $tty) { throw new RuntimeException('TTY mode is not supported on Windows platform.'); } + if ($tty && (!file_exists('/dev/tty') || !is_readable('/dev/tty'))) { + throw new RuntimeException('TTY mode requires /dev/tty to be readable.'); + } $this->tty = (bool) $tty;