php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43276 mkdir with trailing slash (still) fails under safe_mode
Submitted: 2007-11-13 12:01 UTC Modified: 2007-11-15 18:58 UTC
From: ajakum at inode dot at Assigned: iliaa (profile)
Status: Closed Package: Directory function related
PHP Version: 5.2CVS-2007-11-13 (snap) OS: Debian Sarge 3.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ajakum at inode dot at
New email:
PHP Version: OS:

 

 [2007-11-13 12:01 UTC] ajakum at inode dot at
Description:
------------
Experienced the same issue as in bug #42739 with the current CVS snapshot php5.2-200711130930 even though it's supposed to be fixed in 5.2.5 according to the changelog.
mkdir() fails under safe_mode conditions if the path ends in a slash.

Fixed temporarily by reverting revision 1.74.2.9.2.33 of TSRM/tsrm_virtual_cwd.c "Consistent handling of trailing slash".

Running on a completely fresh Debian Sarge install with php5.2-200711130930 from snaps.php.net. Only change was activation of safe_mode in order to reproduce the problem.


Reproduce code:
---------------
<?php
  mkdir('myhomefolder/',0770); // does not work
  //mkdir('myhomefolder',0770); // would work
?>


Expected result:
----------------
myhomefolder should get created (=no error)

Actual result:
--------------
Warning: mkdir(): Unable to access myhomefolder/ in /home/foo/test.php on line 2


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-14 23:38 UTC] jani@php.net
Ilia, you claimed to have fixed this? :)
 [2007-11-15 18:58 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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 01 04:01:28 2025 UTC