nlopess         Tue Jan  2 15:29:09 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       proc_open.c 
    /php-src    NEWS 
  Log:
  +- Fixed bug #37619 (proc_open() closes stdin on fork() failure).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.36.2.1.2.5&r2=1.36.2.1.2.6&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.36.2.1.2.5 
php-src/ext/standard/proc_open.c:1.36.2.1.2.6
--- php-src/ext/standard/proc_open.c:1.36.2.1.2.5       Mon Jan  1 09:36:08 2007
+++ php-src/ext/standard/proc_open.c    Tue Jan  2 15:29:09 2007
@@ -15,7 +15,7 @@
    | Author: Wez Furlong <[EMAIL PROTECTED]>                           |
    +----------------------------------------------------------------------+
  */
-/* $Id: proc_open.c,v 1.36.2.1.2.5 2007/01/01 09:36:08 sebastian Exp $ */
+/* $Id: proc_open.c,v 1.36.2.1.2.6 2007/01/02 15:29:09 nlopess Exp $ */
 
 #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
 # define _BSD_SOURCE           /* linux wants this when XOPEN mode is on */
@@ -625,8 +625,6 @@
                                        descriptors[ndesc].mode_flags |= 
O_BINARY;
 #endif
 
-                               
-
                        } else if (strcmp(Z_STRVAL_PP(ztype), "file") == 0) {
                                zval **zfile, **zmode;
                                int fd;
@@ -788,7 +786,8 @@
                /* clean up all the descriptors */
                for (i = 0; i < ndesc; i++) {
                        close(descriptors[i].childend);
-                       close(descriptors[i].parentend);
+                       if (descriptors[i].parentend)
+                               close(descriptors[i].parentend);
                }
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "procve failed - 
%s", strerror(errno));
                goto exit_fail;
@@ -855,7 +854,8 @@
                /* clean up all the descriptors */
                for (i = 0; i < ndesc; i++) {
                        close(descriptors[i].childend);
-                       close(descriptors[i].parentend);
+                       if (descriptors[i].parentend)
+                               close(descriptors[i].parentend);
                }
 
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork failed - %s", 
strerror(errno));
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.468&r2=1.2027.2.547.2.469&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.468 php-src/NEWS:1.2027.2.547.2.469
--- php-src/NEWS:1.2027.2.547.2.468     Sun Dec 31 19:22:01 2006
+++ php-src/NEWS        Tue Jan  2 15:29:09 2007
@@ -51,6 +51,8 @@
 - Fixed bugs #39361 & #39400 (mbstring function overloading problem). (Seiji)
 - Fixed bug #38852 (XML-RPC Breaks iconv). (Hannes)
 - Fixed bug #38542 (proc_get_status() returns wrong PID on windows). (Nuno)
+- Fixed bug #37619 (proc_open() closes stdin on fork() failure).
+  (jdolecek at NetBSD dot org, Nuno)
 - Fixed bug #37588 (COM Property propputref converts to PHP function
   and can't be accesed). (Rob)
 - Fixed bug #36427 (proc_open() / proc_close() leak handles on windows).

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to