wiki.techinc.nl/includes/shell
Brad Jorsch 38bf4c1521 Shell: Set pipes to non-blocking
The select(2) system call only guarantees a "sufficiently small write"
can be made without blocking. It doesn't define what that means.

And on Linux the read might block too in certain cases, although I don't
know if any of them can occur here.

Regardless, set all the pipes to non-blocking, which avoids the blocking
that's behind T184171.

And then, since a non-blocking read might validly return empty-string or
a non-blocking write might validly return 0, use feof() to check for EOF
and actually close the write pipe when it runs out of data.

Bug: T184171
Change-Id: I403235a328630112b6920905730f933777e2d453
2018-02-01 16:04:12 -05:00
..
Command.php Shell: Set pipes to non-blocking 2018-02-01 16:04:12 -05:00
CommandFactory.php shell: Optionally restrict commands' access with firejail 2017-11-28 00:06:40 +00:00
firejail.profile shell: Optionally restrict commands' access with firejail 2017-11-28 00:06:40 +00:00
FirejailCommand.php Merge "shell: Add NO_LOCALSETTINGS restriction" 2017-12-22 01:44:22 +00:00
limit.sh Get rid of $IP in Command 2017-10-06 19:50:45 -07:00
Result.php Improve some parameter docs 2018-01-07 11:39:08 +01:00
Shell.php Allow programmatic input in Command 2018-01-03 19:53:47 +03:00