Re: com php-src: port proc_open to windows (untested yet): ext/standard/proc_open.c
| From: | Dmitry Stogov | Date: | Tue, 13 May 2014 05:43:57 +0000 |
| Subject: | Re: com php-src: port proc_open to windows (untested yet): ext/standard/proc_open.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-78302@lists.php.net to get a copy of this message | ||
Hi Pierre,
In hash operation now we use real string length (without trailing zero).
So you might need to change sizeof("bypass_shell") into
sizeof("bypass_shell")-1.
Thanks. Dmitry.
On Tue, May 13, 2014 at 8:50 AM, Pierre Joye <pajoye@php.net> wrote:
> Commit: dbc6d0df844fc72c8bc44cc1b639d105619d5131
> Author: Pierre Joye <pierre.php@gmail.com> Tue, 13 May 2014
> 06:50:20 +0200
> Parents: 7a74d779aa86a1d95692b145a60f6befccfa9c5a
> Branches: phpng
>
> Link:
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=dbc6d0df844fc72c8bc44cc1b639d105619d5131
>
> Log:
> port proc_open to windows (untested yet)
>
> Changed paths:
> M ext/standard/proc_open.c
>
>
> Diff:
> diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
> index 39dab20..4185da9 100644
> --- a/ext/standard/proc_open.c
> +++ b/ext/standard/proc_open.c
> @@ -469,16 +469,16 @@ PHP_FUNCTION(proc_open)
>
> #ifdef PHP_WIN32
> if (other_options) {
> - zval **item;
> - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(other_options),
> "suppress_errors", sizeof("suppress_errors"), (void**)&item)) {
> - if ((Z_TYPE_PP(item) == IS_BOOL || Z_TYPE_PP(item)
> == IS_LONG) &&
> - Z_LVAL_PP(item)) {
> + zval *item = zend_hash_str_find(Z_ARRVAL_P(other_options),
> "suppress_errors", sizeof("suppress_errors"));
> + if (item != NULL) {
> + if (Z_TYPE_P(item) == IS_TRUE || ((Z_TYPE_P(item)
> == IS_LONG) && Z_LVAL_P(item))) {
> suppress_errors = 1;
> }
> }
> - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(other_options),
> "bypass_shell", sizeof("bypass_shell"), (void**)&item)) {
> - if ((Z_TYPE_PP(item) == IS_BOOL || Z_TYPE_PP(item)
> == IS_LONG) &&
> - Z_LVAL_PP(item)) {
> +
> + item = zend_hash_str_find(Z_ARRVAL_P(other_options),
> "bypass_shell", sizeof("bypass_shell"));
> + if (item != NULL) {
> + if (Z_TYPE_P(item) == IS_TRUE || ((Z_TYPE_P(item)
> == IS_LONG) && Z_LVAL_P(item))) {
> bypass_shell = 1;
> }
> }
> @@ -626,7 +626,7 @@ PHP_FUNCTION(proc_open)
>
> /* simulate the append mode by fseeking to
> the end of the file
> this introduces a potential
> race-condition, but it is the best we can do, though */
> - if (strchr(Z_STRVAL_PP(zmode), 'a')) {
> + if (strchr(Z_STRVAL_P(zmode), 'a')) {
>
> SetFilePointer(descriptors[ndesc].childend, 0, NULL, FILE_END);
> }
> #else
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>