#42739 [Opn->Csd]: mkdir doesnt like a trailing slash when safe_mode is enabled
| From: | iliaa@php.net | Date: | Sun, 23 Sep 2007 15:19:27 +0000 |
| Subject: | #42739 [Opn->Csd]: mkdir doesnt like a trailing slash when safe_mode is enabled | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117784@lists.php.net to get a copy of this message | ||
ID: 42739
Updated by: iliaa@php.net
Reported By: yurtesen at ispro dot net
-Status: Open
+Status: Closed
Bug Type: Safe Mode/open_basedir
Operating System: FreeBSD 6.2
PHP Version: 5.2.4
New Comment:
This bug has been fixed in CVS.
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/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-09-23 09:36:31] yurtesen at ispro dot net
Description:
------------
When safe_mode is enabled mkdir('newdir/',0770); doesnt function. When
safe_mode is disabled it functions fine. Sure, there shouldnt be a
trailing slash there perhaps but most PHP software uses paths similar to
'/home/user/domain/test/' so this is a problem.
This appeared in 5.2.3 or 5.2.4 I am not so sure.
This is not a permissions based problem as the folder is created when
backslash is not used in safe_mode, and it is created when backslash is
used and NOT in safe_mode
It seems to be the same bug with(perhaps somehow reintroduced?):
http://bugs.php.net/bug.php?id=16638
Reproduce code:
---------------
<?php
mkdir('myhomefolder/',0770);
//mkdir('myhomefolder',0770);
?>
The problem is the trailing slash and safe_mode...
Expected result:
----------------
myhomefolder should get created.
Actual result:
--------------
Warning: mkdir(): Unable to access myhomefolder/ in
/home/user/domain/test.php on line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42739&edit=1