diff options
author | Raphael Geissert <geissert@php.net> | 2010-02-18 00:30:12 +0000 |
---|---|---|
committer | Raphael Geissert <geissert@php.net> | 2010-02-18 00:30:12 +0000 |
commit | dee7bf71a6e1e9d6b39451285fba4a6a34ea2c1f (patch) | |
tree | 1f09bd04640b1c4f442551cd963bed9ce71c6bd4 | |
parent | 63e453a1d4f06339329385ab279c9d91fa92d3ea (diff) | |
download | php-git-dee7bf71a6e1e9d6b39451285fba4a6a34ea2c1f.tar.gz |
Fix race condition in shtool's mkdir -p implementation (bug #51076)
-rwxr-xr-x | build/shtool | 6 |
1 files changed, 5 insertions, 1 deletions
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 |