From 6d6b3749e5d8c0d189a109e03e465d0b519e143d Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Thu, 18 Feb 2010 00:30:12 +0000 Subject: [PATCH] Fix race condition in shtool's mkdir -p implementation (bug #51076) --- build/shtool | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.50.1