ID: 41822 Comment by: jh at webteam dot at Reported By: ian at onlineloop dot com Status: Assigned Bug Type: *Directory/Filesystem functions Operating System: Solaris 10 PHP Version: 5.2CVS-20070627 Assigned To: tony2001 New Comment:
Could reproduce this bug under Mac OS X 10.4.10 and PHP 5.2.4 (via MacPorts). Previous Comments: ------------------------------------------------------------------------ [2007-10-05 03:29:44] ab5602 at wayne dot edu No, the above NFS issues is a side-effect of: 1) Solaris getcwd() not functioning properly with (--x) directories and 2) PHP not properly allowing relative include()'s when #1 is the case #2 is probably solvable w/ a bug fix, #1 is obviously not. ------------------------------------------------------------------------ [2007-10-02 11:11:49] [EMAIL PROTECTED] So this is only an issue with NFS shares? If so, please indicate that in the summary. ------------------------------------------------------------------------ [2007-10-02 06:54:42] ab5602 at wayne dot edu I figured out what the issue was with the NFS shares and the "permission denied error" in our Solaris environment. It was related to the same (--x) permission issue that you are having. As it turns out, if you mount an NFS share in: /mylocaldir/nfsmount/ The /nfsmount/ directory permissions, *before* you mount the share, need to be (r-x) or better, even though these permissions are hidden after the mount in order to avoid the Solaris+PHP include() bug. Now include() and getcwd() work just fine! It is very clear that this all goes back to two options: 1) Either make all the subdirs underneath (r-x) OR 2) If it is possible (which I'm not yet sure of), the PHP binary needs to "tell" Solaris that it already knows the current path by doing a chdir(/absolute/path/) or the like before trying getcwd() in order to make the "include() cause permission denied error" go away. ------------------------------------------------------------------------ [2007-10-01 23:53:16] ab5602 at wayne dot edu correction: a) Execute a program that implements getcwd() that is suid-root. ------------------------------------------------------------------------ [2007-10-01 23:41:38] ab5602 at wayne dot edu Wow, this is strange. I'm very much closer to seeing what is going on with PHP+Solaris that is causing the issue here Ian. I've tested pwd/getcwd() with every combination I could think of and this is how Solaris feels about permissions: If you are not root AND you want to get your current working directory that has parents with exclusively 'x' permissions, you must do one of two things: a) Execute a getuid() program that is suid-root. OR: And this is the strange one... b) Tell Solaris that you already know where you are!! If it is feasible, I'll see if I can come up with a patch to implement (b) if your architecture is Solaris and send it to the PHP internals list. See below for how this works: ----- # uname -a SunOS opteron 5.10 Generic_118855-14 i86pc i386 i86pc # pwd / # find ./dirtest/ -ls 449393 1 d--x--x--x 3 root root 512 Oct 1 19:29 ./dirtest/ 449394 1 d--x--x--x 2 root root 512 Oct 1 19:29 ./dirtest/dirtest2 # cd /dirtest/dirtest2 # pwd /dirtest/dirtest2 # su nobody # pwd cannot determine current directory # cd /dirtest/dirtest2/ # pwd /dirtest/dirtest2 # ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/41822 -- Edit this bug report at http://bugs.php.net/?id=41822&edit=1