Permalink
Browse files

Fix race condition in shtool's mkdir -p implementation (bug #51076)

  • Loading branch information...
1 parent bf7de28 commit dcfb8ee366f7993aa3c22a25ba018faa9c5f7cdc @rgeissert rgeissert committed Feb 18, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 build/shtool
View
@@ -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

0 comments on commit dcfb8ee

Please sign in to comment.