php.net |  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
Votes:2
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
Description:
------------
Previous bug #51076
http://bugs.php.net/bug.php?id=51076
was fixed by:
svn commit r295225 ( http://svn.php.net/viewvc?view=revision&revision=295225 )

but later, commit r295230 ( http://svn.php.net/viewvc?
view=revision&revision=295230)
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 ...
   ...
else:
   mkdir -p ...
   chmod -R ...
   chown -R ...
   chgrp -R ...
   ...

That would be safer I think ...




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-01 12:30 UTC] mike@php.net
-Status: Open +Status: Duplicate
 [2013-10-01 12:30 UTC] mike@php.net
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: Wed Dec 11 22:01:27 2024 UTC