Bug #62871 [NEW]: mkdir(): wrong behaviour parsing schema:// in parameters
| From: | php dot net at thermoman dot de | Date: | Mon, 20 Aug 2012 10:42:57 +0000 |
| Subject: | Bug #62871 [NEW]: mkdir(): wrong behaviour parsing schema:// in parameters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-172714@lists.php.net to get a copy of this message | ||
From: php dot net at thermoman dot de
Operating system: Linux 2.6.37.6
PHP version: 5.4.6
Package: Directory function related
Bug Type: Bug
Bug description:mkdir(): wrong behaviour parsing schema:// in parameters
Description:
------------
mkdir does parse :// in argument as schema/protocol and truncates the
string resulting in wrong directory being created.
Possibly more functions affected (fopen, ...).
mkdir("/var/tmp/http://foobar", 0700, true);
mkdir("/var/tmp/abcd://barbaz", 0700, true);
Creates wrong directories.
Test script:
---------------
% find foobar /var/tmp/http:
find: `foobar': No such file or directory
find: `/var/tmp/http:': No such file or directory
% ~/php546/bin/php -r 'var_dump(mkdir("/var/tmp/http://foobar", 0700,
true));'
bool(true)
% find foobar /var/tmp/http:
foobar
find: `/var/tmp/http:': No such file or directory
==> PHP created directory 'foobar' in current working directory
Expected result:
----------------
directory "/var/tmp/http:" is created
directory "/var/tmp/http:/foobar" is created
like gnu mkdir:
% mkdir -p "/var/tmp/http://foobar"
% find /var/tmp/http:
/var/tmp/http:
/var/tmp/http:/foobar
Actual result:
--------------
directory "foobar" is created in current working directory
--
Edit bug report at https://bugs.php.net/bug.php?id=62871&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62871&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62871&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62871&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62871&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62871&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62871&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62871&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62871&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62871&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62871&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62871&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62871&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62871&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62871&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62871&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62871&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62871&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62871&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62871&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62871&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62871&r=mysqlcfg