Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32535 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96439 invoked by uid 1010); 2 Oct 2007 07:52:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96424 invoked from network); 2 Oct 2007 07:52:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2007 07:52:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=tony@daylessday.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tony@daylessday.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain daylessday.org designates 89.208.40.236 as permitted sender) X-PHP-List-Original-Sender: tony@daylessday.org X-Host-Fingerprint: 89.208.40.236 mail.daylessday.org Linux 2.6 Received: from [89.208.40.236] ([89.208.40.236:43616] helo=daylessday.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/08-20520-D98F1074 for ; Tue, 02 Oct 2007 03:51:59 -0400 Received: from [192.168.3.167] (unknown [212.42.62.198]) by daylessday.org (Postfix) with ESMTP id F25186400EF; Tue, 2 Oct 2007 11:51:54 +0400 (MSD) Message-ID: <4701F89D.70700@daylessday.org> Date: Tue, 02 Oct 2007 11:51:57 +0400 User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: Rob Thompson CC: internals@lists.php.net References: <47018CBD.4000107@wayne.edu> In-Reply-To: <47018CBD.4000107@wayne.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Solaris and getcwd() From: tony@daylessday.org (Antony Dovgal) On 02.10.2007 04:11, Rob Thompson wrote: > I've been trying to find out some reason why the getcwd() PHP function > fails under some situations under Solaris. Particularly, when some > component of the file path looks like: d--x--x--x (no read perms). This > appears to be a security feature that Solaris implements that is not > there in Linux. I would not call it a security feature. > a) Execute a getcwd() program that is suid-root. UNpossible. > b) Tell Solaris that you already know where you are!! That's exactly what we're trying to figure out, isn't it? > 1) Is there any way for a running non-root instance of PHP under > Apache or another web server to "know where it is" in the directory tree > already, in hopes of implementing (b) above? To "know where it is" it has to call getcwd(), which doesn't work on Solaris, or do you know any other ways to get current working dir? > 2) I'm assuming that the current functionality of PHP include() > requires stdio's getcwd() in order to function with relative paths. Is > this really the case? Sure. > 3) If #1 is possible and #2 is the case, would it be reasonable to > implement a fix for this with doing a chdir(), followed by a getcwd() if > your architecture is Solaris? chdir() to where? We need to call getcwd() to know where we are to do chdir(there). -- Wbr, Antony Dovgal