php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42739 mkdir doesnt like a trailing slash when safe_mode is enabled
Submitted: 2007-09-23 09:36 UTC Modified: 2008-02-26 01:00 UTC
Votes:15
Avg. Score:3.8 ± 1.4
Reproduced:12 of 14 (85.7%)
Same Version:9 (75.0%)
Same OS:5 (41.7%)
From: yurtesen at ispro dot net Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.2.5 OS: FreeBSD 6.2
Private report: No CVE-ID: None
 [2007-09-23 09:36 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-23 15:19 UTC] iliaa@php.net
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.


 [2007-11-27 12:36 UTC] yurtesen at ispro dot net
I see the same error in 5.2.5 release. Are you sure that this is fixed? When you said that it is fixed in CVS it was in September, now 5.2.5 came out and the same bug exists...
 [2008-02-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC