summaryrefslogtreecommitdiff
path: root/build/shtool
diff options
context:
space:
mode:
authorRaphael Geissert <geissert@php.net>2010-02-18 00:30:12 +0000
committerRaphael Geissert <geissert@php.net>2010-02-18 00:30:12 +0000
commitdee7bf71a6e1e9d6b39451285fba4a6a34ea2c1f (patch)
tree1f09bd04640b1c4f442551cd963bed9ce71c6bd4 /build/shtool
parent63e453a1d4f06339329385ab279c9d91fa92d3ea (diff)
downloadphp-git-dee7bf71a6e1e9d6b39451285fba4a6a34ea2c1f.tar.gz
Fix race condition in shtool's mkdir -p implementation (bug #51076)
Diffstat (limited to 'build/shtool')
-rwxr-xr-xbuild/shtool6
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