Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32530 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2023 invoked by uid 1010); 2 Oct 2007 00:11:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2008 invoked from network); 2 Oct 2007 00:11:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2007 00:11:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=ab5602@wayne.edu; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ab5602@wayne.edu; sender-id=unknown Received-SPF: error (pb1.pair.com: domain wayne.edu from 141.217.1.108 cause and error) X-PHP-List-Original-Sender: ab5602@wayne.edu X-Host-Fingerprint: 141.217.1.108 mirapointmr1.wayne.edu Received: from [141.217.1.108] ([141.217.1.108:11526] helo=mirapointmr1.wayne.edu) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/EB-20520-0CC81074 for ; Mon, 01 Oct 2007 20:11:45 -0400 Received: from ab5602-home.local (ab5602.cc.wayne.edu [141.217.4.107]) by mirapointmr1.wayne.edu (MOS 3.8.5-GA) with ESMTP id EFO03252; Mon, 1 Oct 2007 20:11:41 -0400 (EDT) Message-ID: <47018CBD.4000107@wayne.edu> Date: Mon, 01 Oct 2007 20:11:41 -0400 Organization: Wayne State University User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: internals@lists.php.net X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=10/60, host=mirapointmr1.wayne.edu X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A090208.47018CBD.016F,ss=1,fgs=0, ip=141.217.4.107, so=2007-07-31 18:51:00, dmn=5.4.3/2007-09-06 Subject: Solaris and getcwd() From: ab5602@wayne.edu (Rob Thompson) Hi everyone, I just subscribed to this list in hopes of working out some PHP bugs that have to do with Solaris. 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. Here is what I found out: If you are not root AND you want to get your current working directory that has parents with without 'r' permissions, you must do one of two things: a) Execute a getcwd() program that is suid-root. OR: And this is the strange one... b) Tell Solaris that you already know where you are!! You can accomplish (b) by doing a 'cd /mydir/mysubdir/' where mydir has the permissions (d--x--x--x). Without changing directories with a fully-qualified path, getcwd() will return NULL. Here are my questions for the list: 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? 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? 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? I could try and attempt a fix, but my knowledge of the PHP source is sorely lacking at this time. I'm working on bettering it! Thanks! -Rob