From: Raphael Geissert Date: Thu, 18 Feb 2010 00:30:12 +0000 (+0000) Subject: Fix race condition in shtool's mkdir -p implementation (bug #51076) X-Git-Tag: php-5.4.0alpha1~284 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dcfb8ee366f7993aa3c22a25ba018faa9c5f7cdc;p=php Fix race condition in shtool's mkdir -p implementation (bug #51076) --- diff --git a/build/shtool b/build/shtool index 8d95db5b60..e291c5f76e 100755 --- a/build/shtool +++ b/build/shtool @@ -991,7 +991,11 @@ mkdir ) 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