From:             yurtesen at ispro dot net
Operating system: FreeBSD 6.2
PHP version:      5.2.4
PHP Bug Type:     Safe Mode/open_basedir
Bug description:  mkdir doesnt like a trailing slash when safe_mode is enabled

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 bug report at http://bugs.php.net/?id=42739&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42739&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42739&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42739&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42739&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42739&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42739&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42739&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42739&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42739&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42739&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42739&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42739&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42739&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42739&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42739&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42739&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42739&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42739&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42739&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42739&r=mysqlcfg

Reply via email to