|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54205 race condition in shtool's mkdir -p implementation. AND shtool 2.0.8
Submitted: 2011-03-09 16:23 UTC Modified: 2013-10-01 12:30 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fviard at lacie dot com Assigned:
Status: Duplicate Package: Compile Failure
PHP Version: trunk-SVN-2011-03-09 (SVN) OS: Linux
Private report: No CVE-ID: None
 [2011-03-09 16:23 UTC] fviard at lacie dot com
Previous bug #51076
was fixed by:
svn commit r295225 ( )

but later, commit r295230 (
updated shtool to version 2.0.8 without backporting the previous patch.
(In upstream, nothing changed regarding mkdir between 2.0.6 and  2.0.8)

And so, the race condition with -j>1 is still there. (In my case, it appeared 
during the "make install" step processing the installation of the extensions)

Error was: "mkdir: cannot create directory ... : File exists"

So, the patch in r295225 should be reapplied to shtool 2.0.8.

In a second time, why not replacing all the mkdir code block of shtool by 
something like:
if opt_p = no:
   mkdir ...
   chmod ...
   chown ...
   chgrp ...
   mkdir -p ...
   chmod -R ...
   chown -R ...
   chgrp -R ...

That would be safer I think ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-01 12:30 UTC]
-Status: Open +Status: Duplicate
 [2013-10-01 12:30 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #51076
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 17:01:30 2024 UTC