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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php