summaryrefslogtreecommitdiff
path: root/build
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
commitdcfb8ee366f7993aa3c22a25ba018faa9c5f7cdc (patch)
tree511faefd0d3d6861e46bd07ce369240d9427cdec /build
parentbf7de28e460534f0037cfa98421010902303987e (diff)
downloadphp-git-dcfb8ee366f7993aa3c22a25ba018faa9c5f7cdc.tar.gz
Fix race condition in shtool's mkdir -p implementation (bug #51076)
Diffstat (limited to 'build')
-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