Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15908 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28312 invoked by uid 1010); 8 Apr 2005 15:42:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 28280 invoked from network); 8 Apr 2005 15:42:45 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 8 Apr 2005 15:42:45 -0000 X-Host-Fingerprint: 64.233.184.200 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.200:40373] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id 80/0E-19272-476A6524 for ; Fri, 08 Apr 2005 11:42:44 -0400 Received: by wproxy.gmail.com with SMTP id 57so751382wri for ; Fri, 08 Apr 2005 08:42:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=d9Q6W2G3moKb9tOEh2Y1InhtgLhfkl2fHyUA5+85Kl9weK26shuyVNE221ITEAfz5a5R4toC+v4xk9z9sgVOdezOzc0a8hoi+Z8FlgNzS0bV9eLAkd/WitXxSf2ViXV69+r9vfqHvjdS4xCYBdZ+zU6fWVqVytabtSdwkfcBRWs= Received: by 10.54.38.54 with SMTP id l54mr10447wrl; Fri, 08 Apr 2005 08:42:41 -0700 (PDT) Received: by 10.54.77.4 with HTTP; Fri, 8 Apr 2005 08:42:41 -0700 (PDT) Message-ID: <4e89b426050408084210eb1c26@mail.gmail.com> Date: Fri, 8 Apr 2005 11:42:41 -0400 Reply-To: Wez Furlong To: Uwe Schindler Cc: internals@lists.php.net In-Reply-To: <6.2.0.14.0.20050408165118.03859cd0@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <6.2.0.14.0.20050407093245.0385c520@127.0.0.1> <6.2.0.14.0.20050408165118.03859cd0@127.0.0.1> Subject: Re: [PHP-DEV] [PATCH] fix crash in solaris when fdopen() fails From: kingwez@gmail.com (Wez Furlong) Yeah, popen is tricky to replace. A workaround for solaris is to use proc_open() in the scripts instead. Other extensions that might have issues are those that will accept a stream to use as a source for data. Off the top of my head, you'll want to check the PDFlib and ming extensions. Actually, you be able to grep the php source to see where the php_stream_cast function is called; that'll highlight problem areas pretty easily I should think. --Wez. On Apr 8, 2005 10:58 AM, Uwe Schindler wrote: > OK - I found out that the fdopen() code is never called in the PHP > environment, so patch is not needed (PHP sets zend_file_handle always to > STREAM). But I still want to know for what extensions/functions the casts > from posix to stdio are needed- Will casting appear somewhere when the user > calls the userlevel-file-functions starting with fopen()?. It is hard work > to find out with simple search through CVS. > The only position I know is because of popen() etc. in the exec functions > which are stdio (posix variants are more complicated), which is the cause > for the bug report I mentioned. > > At 09:40 07.04.2005, Uwe Schindler wrote: > >I am fixing bug #32614: Problem, on the solaris platform fdopen() can fail > >even if fd is a correct file descriptor, when fd>255 (the well-known > >solaris stdio problem). The webserver of the user crashes because the > >return value of fdopen() is not checked for NULL when casting a stream > >from posix to stdio. After this fd==-1 and fp==NULL ==> further calls to > >fread/fwrite with this fp segfault. > >I committed the patches for PHP but I have no karme for "ZendEngine2". Can > >someone with karma submit this patch? > > > >According to this it would be interesting, WHEN some PHP/Zend code tries > >to cast a POSIX stream to stdio? In which extension/functions? Can this be > >fixed to only use posix IO? The zend engine itself should be safe since > >4.3.3 and since PHP5. > > > >Does stream casts apply if a user uses the PHP user functions fopen, > >fread, fwrite? Since Saschas fix in PHP4 there this does not happen. What > >about PHP5? > > > >I would try to fix this everywhere in the future. > > > >----- > >Uwe Schindler > >thetaphi@php.net - http://www.php.net > >NSAPI SAPI developer > >Erlangen, Germany > > > > > > > >-- > >PHP Internals - PHP Runtime Development Mailing List > >To unsubscribe, visit: http://www.php.net/unsub.php > > ----- > Uwe Schindler > thetaphi@php.net - http://www.php.net > NSAPI SAPI developer > Bremen, Germany > >