Skip to content

Commit 1393de6

Browse files
authored
Return false in isTtySupported() when open_basedir restrictions prevent access to /dev/tty.
If open_basedir restrictions are in effect, checking if the file /dev/tty is writable will prevent setting tty mode on the process, and avoid failing to create a Process.
1 parent cdb1c81 commit 1393de6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Process.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ public static function isTtySupported(): bool
12111211
{
12121212
static $isTtySupported;
12131213

1214-
return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT));
1214+
return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT) && @is_writable('/dev/tty'));
12151215
}
12161216

12171217
/**

0 commit comments

Comments
 (0)