Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18173 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62366 invoked by uid 1010); 16 Aug 2005 15:32:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62350 invoked from network); 16 Aug 2005 15:32:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2005 15:32:03 -0000 X-Host-Fingerprint: 66.111.4.27 out3.smtp.messagingengine.com Received: from ([66.111.4.27:48102] helo=out3.smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 9A/72-33075-2F602034 for ; Tue, 16 Aug 2005 11:32:02 -0400 Received: from frontend1.internal (frontend1.internal [10.202.2.150]) by frontend1.messagingengine.com (Postfix) with ESMTP id 2AB86CC9B71; Tue, 16 Aug 2005 11:31:57 -0400 (EDT) Received: from web1.messagingengine.com ([10.202.2.210]) by frontend1.internal (MEProxy); Tue, 16 Aug 2005 11:31:57 -0400 Received: by web1.messagingengine.com (Postfix, from userid 99) id 32148C028; Tue, 16 Aug 2005 11:31:57 -0400 (EDT) Message-ID: <1124206317.24293.240801349@webmail.messagingengine.com> X-Sasl-Enc: rQD6LNUW24yiwHf7qaJj4/oGpGm473lVHF/KcRJwuwth 1124206317 To: "Sara Golemon" Cc: internals@lists.php.net Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MIME::Lite 1.5 (F2.73; T1.001; A1.64; B3.05; Q3.03) References: <1123760274.4692.240461014@webmail.messagingengine.com> <002601c59e84$628da990$65d41a44@lighthammer> In-Reply-To: <002601c59e84$628da990$65d41a44@lighthammer> Date: Tue, 16 Aug 2005 21:01:57 +0530 Subject: Re: realpath is not available in all LibCs From: kameshj@fastmail.fm ("Kamesh Jayachandran") Thanks sara for responding. Will write a snippet to address this and get back to you. With regards Kamesh Jayachandran On Thu, 11 Aug 2005 07:52:56 -0700, "Sara Golemon" said: > > Version PHP 5.1 > > file main/php_init.c > > function int php_init_config() uses realpath. > > In NetWare our earlier releases of LibC SDK has no realpath > > implementation. > > > > I could see the following lines in TSRM/tsrm_virtual_cwd.c > > > > #ifndef HAVE_REALPATH > > #define realpath(x,y) strcpy(y,x) > > #endif > > > > Why not this be in TSRM/tsrm_virtual_cwd.h so that it will work in all > > the cases. > > > > Can I go ahead and checkin this? > > > I have two concerns with this "solution" (both here and in TSRM). > > (1) Security: Both internally with checks such as open_basedir and in > userspace when evaluating URL parameters (an all too common practice). > > (2) Functionality: require_once()/include_once() could be fooled into > including the same file twice. > > Granted #2 requires specific circumstances and #1 can be worked around > for > tightly managed systems running no external packages. > > How about a more expensive, but more closely aproximating substitute to > satisfy all of these? > > /* psuedo-code */ > #ifndef HAVE_REALPATH > realpath(...) { > itterate path from root: > if symlink, resolve > if dir, append next portion of remaining path > otherwise, ergh...whatever realpath() would do in this situation... > loop > } > #endif > -- http://www.fastmail.fm - IMAP accessible web-mail