ID: 32920 Updated by: [EMAIL PROTECTED] Reported By: ben at skiddle dot com -Status: Open +Status: Feedback Bug Type: Filesystem function related Operating System: FreeBSD 5.3 PHP Version: 4.3.11 New Comment:
Any info on how to reproduce it? Previous Comments: ------------------------------------------------------------------------ [2005-05-06 12:34:19] ben at skiddle dot com any luck yet? ------------------------------------------------------------------------ [2005-05-03 02:20:19] ben at skiddle dot com Having run 'echo umask();' again (just refreshing the page) the umask is now 63, and this randomly changes from 18 to 63 and back again when i refresh ------------------------------------------------------------------------ [2005-05-03 02:17:08] ben at skiddle dot com If I echo umask() from php I get '18' ------------------------------------------------------------------------ [2005-05-03 01:40:41] ben at skiddle dot com Description: ------------ I am running PHP as a CGI module with Apache 2.0.52 Apache runs as user 'apache' PHP cgi runs as vhost user 'myuser' (for example) Both users are in groupa I have the following folder: drwxr-wr-w articles myuser groupa When I create a new file in this folder, it is being given permissions rw------- mynewfile.shtml myuser groupa Because of this apache cannot read the file. This file should inherit the parent folders permissions? I am using simple fopen, fwrite, fclose This is either a problem with inheriting permissions, or the system umask has been altered. This has only happened since upgrading from 4.3.10 to 4.3.11 and has broken several script, some using move_uploaded_file also. Reproduce code: --------------- if (!$handle = fopen($longfilename, 'w')) { print "<BR>Cannot open file ($filename)"; return false; } // Write $somecontent to our opened file. if ([EMAIL PROTECTED]($handle, $somecontent)) { print "<BR>Cannot write to file ($filename)"; return false; } fclose($handle); Expected result: ---------------- File created with same permissions as parent folder. (no umask or chmod settings are applied in the php code, or have been altered anywhere) Actual result: -------------- File created with less permissions ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32920&edit=1