From:             4u at direct-netware dot de
Operating system: Linux in general
PHP version:      Irrelevant
PHP Bug Type:     Feature/Change Request
Bug description:  Change SAFE MODE behavior for new dirs or files

Description:
------------
Every time a script wants to create a directory and a file in it, it fails
because of SAFE MODE restrictions (uid). Please note, that this is only
true, if uid control is active.

Reproduce code:
---------------
<?php
mkdir ("mydir",0777);
$fp = fopen ("mydir/myfile.php","w");
fclose ($fp);
?>

Expected result:
----------------
a) Directory does not exist
Directory will be created using the UID of the script and afterwards
create the file.

b) Directory does exist
A warning (or notice? or whatever it is) will be printed out because the
directory already exists and afterwards the file will still be created.
Expecting the right UID (same as the script) has created the directory.

I want to request, that files and directories are always have the UID of
the script (and the UID of the "uploader") rather than the UID of the
server which causes many providers to disturb normal PHP file actions.

Actual result:
--------------
a) Directory does not exist
Directory will be created using the server UID and afterwards there will
be an error while creating the file (SAFE MODE ...).

b) Directory does exist
A warning (or notice? or whatever it is) will be printed out because the
directory already exists and afterwards the file will not be created
because the script is not allowed to write in the directory (SAFE MODE ...
UID ...).

-- 
Edit bug report at http://bugs.php.net/?id=25411&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25411&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25411&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25411&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25411&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25411&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25411&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25411&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25411&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25411&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25411&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25411&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25411&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25411&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25411&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25411&r=gnused

Reply via email to