Skip to content

Commit

Permalink
[PROCESS] make sure /dev/tty is readable
Browse files Browse the repository at this point in the history
When using Process from Web-SAPI it is likely that the webserver user
doesn't has rights to use /dev/tty
  • Loading branch information
staabm authored and fabpot committed Feb 24, 2015
1 parent cae6de6 commit 935afe6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Symfony/Component/Process/Process.php
Expand Up @@ -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;

Expand Down

0 comments on commit 935afe6

Please sign in to comment.