Bug #69290 [Opn->Fbk]: Invalid modes do not trigger errors
| From: | laruence@php.net | Date: | Wed, 25 Mar 2015 09:30:14 +0000 |
| Subject: | Bug #69290 [Opn->Fbk]: Invalid modes do not trigger errors | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191592@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69290&edit=1
ID: 69290
Updated by: laruence@php.net
Reported by: roborg at gmail dot com
Summary: Invalid modes do not trigger errors
-Status: Open
+Status: Feedback
Type: Bug
Package: Program Execution
Operating System: Windows
PHP Version: 5.5.23
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-03-25 09:29:53] laruence@php.net
in proc_open:
if (strncmp(Z_STRVAL_PP(zmode), "w", 1) != 0) {
descriptors[ndesc].parentend = newpipe[1];
descriptors[ndesc].childend = newpipe[0];
descriptors[ndesc].mode |= DESC_PARENT_MODE_WRITE;
} else {
descriptors[ndesc].parentend = newpipe[0];
descriptors[ndesc].childend = newpipe[1];
}
so, it's very clear why no notice was raised(assume "r" by default). considering bc
issue, and not very helpful notices....
maybe change to a doc issue is better.
------------------------------------------------------------------------
[2015-03-24 15:52:53] roborg at gmail dot com
Description:
------------
Valid modes for pipes are "r" and "w" according to the docs.
Though a comment in the docs suggests using "a" for STDERR on Windows, I believe this may
be outdated.
Modes other than "r" and "w" (and possibly "a"?) should trigger an
error, but are silently ignored and the pipe just doesn't work properly.
Test script:
---------------
$descriptors = array(
array('pipe', 'x'),
array('pipe', 'y'),
array('pipe', 'z'),
);
$process = proc_open('ls', $descriptors, $pipes);
proc_close($process);
Expected result:
----------------
Error: proc_open(): x is not a valid descriptor mode
Actual result:
--------------
(nothing)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69290&edit=1