If this wasn't in mainstream shtool, then report it there instead. We do NOT start patching this ourselves.

--Jani


On 02/18/2010 02:30 AM, Raphael Geissert wrote:
geissert                                 Thu, 18 Feb 2010 00:30:12 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=295225

Log:
Fix race condition in shtool's mkdir -p implementation (bug #51076)

Bug: http://bugs.php.net/51076 (Open) race condition in shtool's mkdir -p 
implementation

Changed paths:
     U   php/php-src/branches/PHP_5_2/build/shtool
     U   php/php-src/branches/PHP_5_3/build/shtool
     U   php/php-src/trunk/build/shtool

Modified: php/php-src/branches/PHP_5_2/build/shtool
===================================================================
--- php/php-src/branches/PHP_5_2/build/shtool   2010-02-18 00:10:10 UTC (rev 
295224)
+++ php/php-src/branches/PHP_5_2/build/shtool   2010-02-18 00:30:12 UTC (rev 
295225)
@@ -991,7 +991,11 @@
                      if [ ".$opt_t" = .yes ]; then
                          echo "mkdir $pathcomp" 1>&2
                      fi
-                    mkdir $pathcomp || errstatus=$?
+                    mkdir $pathcomp || {
+                        _errstatus=$?
+                        [ -d "$pathcomp" ] || errstatus=${_errstatus}
+                        unset _errstatus
+                    }
                      if [ ".$opt_o" != . ]; then
                          if [ ".$opt_t" = .yes ]; then
                              echo "chown $opt_o $pathcomp" 1>&2

Modified: php/php-src/branches/PHP_5_3/build/shtool
===================================================================
--- php/php-src/branches/PHP_5_3/build/shtool   2010-02-18 00:10:10 UTC (rev 
295224)
+++ php/php-src/branches/PHP_5_3/build/shtool   2010-02-18 00:30:12 UTC (rev 
295225)
@@ -991,7 +991,11 @@
                      if [ ".$opt_t" = .yes ]; then
                          echo "mkdir $pathcomp" 1>&2
                      fi
-                    mkdir $pathcomp || errstatus=$?
+                    mkdir $pathcomp || {
+                        _errstatus=$?
+                        [ -d "$pathcomp" ] || errstatus=${_errstatus}
+                        unset _errstatus
+                    }
                      if [ ".$opt_o" != . ]; then
                          if [ ".$opt_t" = .yes ]; then
                              echo "chown $opt_o $pathcomp" 1>&2

Modified: php/php-src/trunk/build/shtool
===================================================================
--- php/php-src/trunk/build/shtool      2010-02-18 00:10:10 UTC (rev 295224)
+++ php/php-src/trunk/build/shtool      2010-02-18 00:30:12 UTC (rev 295225)
@@ -991,7 +991,11 @@
                      if [ ".$opt_t" = .yes ]; then
                          echo "mkdir $pathcomp" 1>&2
                      fi
-                    mkdir $pathcomp || errstatus=$?
+                    mkdir $pathcomp || {
+                        _errstatus=$?
+                        [ -d "$pathcomp" ] || errstatus=${_errstatus}
+                        unset _errstatus
+                    }
                      if [ ".$opt_o" != . ]; then
                          if [ ".$opt_t" = .yes ]; then
                              echo "chown $opt_o $pathcomp" 1>&2




--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to