#21958 [Com]: fopen fails in safe mode

From: Date: Wed, 23 Apr 2003 18:57:23 +0000
Subject: #21958 [Com]: fopen fails in safe mode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38230@lists.php.net to get a copy of this message
ID: 21958 Comment by: patrick_cossette1 at uqtr dot ca Reported By: ct at swin dot edu dot au Status: Verified Bug Type: Filesystem function related Operating System: Tru64 UNIX 5.1A PHP Version: 4.3.2-dev 5.0.0-dev Assigned To: wez New Comment: With AIX 4.3.3 and PHP 4.3.1. With safe_mode on , I cannot create a file with neither touch nor fopen nor mkdir. (With safe_mode off, the creation works). Apache is running under user "web" and group "web". I have the directory /web/hee_dev whose owner is web.web with permissions rwxr-s--- I have the script testing.php located in that directory: <? $fp=fopen("filetocreate","w+"); ?> If the file "filetocreate" does not already exist, I get the following error while executing the script: Warning: Unable to access filetocreate in /web/hee_dev/testing.php on line 2 Warning: fopen("filetocreate", "w+") - No such file or directory in /web/hee_dev/testing.php on line 2 If the file already exists, I can open it without any problem. I had read somewhere in the bug database that this should be solved by now, but with 4.3.1, it still produces this error. Previous Comments: ------------------------------------------------------------------------ [2003-04-01 11:29:19] ohp at pyrenet dot fr I have the same problem on 4.2.3 and 4.3.1. I noticed that making touch before fopen("xxx","w") creates the file so fopen succeeds. ------------------------------------------------------------------------ [2003-02-26 20:44:34] magnus@php.net Using Tru64 UNIX 5.1. Both 4.3.2-dev and 5.0.0-dev. Tested with safe_mode on and trying to create a file in /tmp ------------------------------------------------------------------------ [2003-02-26 01:06:15] ct at swin dot edu dot au I have noticed that in safe_mode.c after the line that has VCWD_REALPATH(filename, path); (Line 84 from CVS version) the value of path is always NULL in Tru64 UNIX. The same code testing on Linux using CLI SAPI, path = correct value. ------------------------------------------------------------------------ [2003-02-23 23:43:32] ct at swin dot edu dot au The build from php4-STABLE-200302231230 still produces the same error. ------------------------------------------------------------------------ [2003-02-23 05:22:27] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip There have been couple of fixes lately which might fix this as side-effect, please give it a go. ------------------------------------------------------------------------ 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

« previous php.bugs (#38230) next »