[php-src] Issue #8240: Misleading error message on popen() when /bin/sh is missing
| From: | dilyanpalauzov | Date: | Fri, 01 Apr 2022 14:14:05 +0000 |
| Subject: | [php-src] Issue #8240: Misleading error message on popen() when /bin/sh is missing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240635@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8240
Comment Author: dilyanpalauzov
My opinion is that when php calls
popen('/bin/sh') and it fails, then php
shall verify if /bin/sh exists and if it does not exist, then report the non-existence. Of course
fixing this in addidion in LIBC is a good idea.
The documentation at https://www.php.net/manual/en/function.popen.php
does not emphasize enough that the popen() call is wrapped by /bin/sh call
and this has the advantage, that < and > redirections are supposed
to work. The disadvantage is, that /bin/sh must exist.
Given the spare documentation, < and > redirections are probably not
needed, and the invocation of /bin/sh can be removed from php’s code.