Bug #55124 [Opn->Csd]: recursive mkdir fails with current (dot) directory in path

From: Date: Tue, 24 Oct 2017 07:58:10 +0000
Subject: Bug #55124 [Opn->Csd]: recursive mkdir fails with current (dot) directory in path
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212193@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55124&edit=1

 ID:                 55124
 Updated by:         requinix@php.net
 Reported by:        cweiske@php.net
 Summary:            recursive mkdir fails with current (dot) directory
                     in path
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Directory function related
 PHP Version:        5.3.6
-Assigned To:        
+Assigned To:        pajoye
 Block user comment: N
 Private report:     N

 New Comment:

Fixed since 5.4.


Previous Comments:
------------------------------------------------------------------------
[2011-07-26 23:58:18] pajoye@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=313753
Log: - news for bug #55124

------------------------------------------------------------------------
[2011-07-26 17:45:23] pajoye@php.net

Fixed in 5.4 and trunk.

5.3 requires more work, can be done later but most probably post 5.3.7.

------------------------------------------------------------------------
[2011-07-26 17:44:21] pajoye@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=313743
Log: - Fixed bug 55124, recursive mkdir fails with current (dot) directory in path

------------------------------------------------------------------------
[2011-07-26 12:57:28] pajoye@php.net

verified in ts mode at least.

------------------------------------------------------------------------
[2011-07-04 02:41:27] cweiske@php.net

Description:
------------
Running recursive mkdir fails when there is a "." directory in the path:

    <?php mkdir('a/./b', 0755, true) ?>
    PHP Warning:  mkdir(): File exists in Command line code on line 1
    Warning: mkdir(): File exists in Command line code on line 1

When a does not exist, "a" is generated, but "b" is not.
When a exists already, everything is fine.

Note that I cannot use realpath() to sanitize the path because the path does not exist yet.

Test script:
---------------



Actual result:
--------------
$ /opt/phpfarm/inst/bin/php-5.3.6 -v
PHP 5.3.6 (cli) (built: Mar 18 2011 09:27:59) (DEBUG)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

$ LC_ALL=C ls a
ls: cannot access a: No such file or directory
 
$ /opt/phpfarm/inst/bin/php-5.3.6 -r 'mkdir("a/./b", 0755, true);'
PHP Warning:  mkdir(): File exists in Command line code on line 1

Warning: mkdir(): File exists in Command line code on line 1


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=55124&edit=1


Thread (5 messages)

« previous php.bugs (#212193) next »