ID: 21958 Comment by: henrypijames at mailcity dot com Reported By: ct at swin dot edu dot au Status: Closed Bug Type: Filesystem function related Operating System: Tru64 UNIX 5.1A PHP Version: 4.3.3-dev Assigned To: iliaa New Comment:
It looks like this bug isn't closed at all, at least not in PHP 4.3.6 on HP-UX B.10.20: <?php $fname = "/home/xyz/public_html/test/file.txt"; $filePtr = fopen($fname, "w"); ?> drwxrwxrwx 2 xyz xyz 80 May 11 03:00 test Warning: fopen(): SAFE MODE Restriction in effect. The script running as uid 600 is not allowed to write to directory /home/xyz/public_html/test owned by uid 1234 in /home/xyz/public_html/test.php on line 3 Warning: fopen(/home/xyz/public_html/test/file.txt): failed to open stream: No such file or directory in /home/xyz/public_html/test.php on line 3 Previous Comments: ------------------------------------------------------------------------ [2003-08-07 10:36:23] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2003-06-19 10:22:55] ohp at pyrenet dot fr Would you please send the patch (on the list or to me) I don't have the realpath source handy and would love to give your patch a try. Regards ------------------------------------------------------------------------ [2003-06-04 18:17:32] ct at swin dot edu dot au I suspect some implementations of realpath will not touch the resolved path if the filename does not exist. This would explain why your patch works on some systems. On Tru64 realpath will set the resolved path to NULL if the file does not exist. As such, setting path in the strcpy before VCWD_REALPATH doesn't fix the problem, at least on Tru64. PHP is making some assumptions about the behaviour of realpath, but there are differences in the way vendors handle the case of a non existent file. I have got around this problem by using the realpath function from the BSD source. ------------------------------------------------------------------------ [2003-06-04 06:24:04] ohp at pyrenet dot fr Hi, Glad to see my patch works on AIX, not so glad it fails with TRU64 UNIX Did you test with the same script/environment you wrote on Jan 30? Did you try to log the value of path after each VCWD_REALPATH. AFAICS, the whole bug comes from realpath doing nasty things when path is NULL hence the strcopy I added. Feel free to email directly. I'm not a PHP developper (I'd love the help of one on this one) but I want to get rid of this bug. Regards Olivier ------------------------------------------------------------------------ [2003-06-01 23:54:24] ct at swin dot edu dot au Patch makes no difference with Tru64 UNIX 5.1A and PHP 4.3.2. ------------------------------------------------------------------------ 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/21958 -- Edit this bug report at http://bugs.php.net/?id=21958&edit=1