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 | 6d6b3749e5d8c0d189a109e03e465d0b519e143d (patch) | |
tree | 63368e55e6659bb99d4b8866c55af6b81f320c0d | |
parent | 1f11fe617e776a52f05cd637b5fab689c0b10d09 (diff) | |
download | php-git-6d6b3749e5d8c0d189a109e03e465d0b519e143d.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 |