Stepan Kasal <[EMAIL PROTECTED]> writes:

> All my complaints were considered, and we have Alexandre's approval,
> so I guess you could check it in.

OK, thanks, I did that.

If I understand you and Ralf correctly about race conditions, here is
a proposed patch to should fix the condition on POSIX conforming
hosts.  On older hosts there's no hope that I can see in general, but
it's not worth worrying about these ancient hosts at this point.  I
hope this addresses Ralf's concerns.

2006-04-24  Paul Eggert  <[EMAIL PROTECTED]>

        * lib/install-sh: Close a race condition reported by Ralf
        Wildenhues and Stepan Kasal.  There is still a race condition
        on hosts that predate POSIX 1003.1-1992, but we can't help this.

--- install-sh.~1.31.~  2006-04-24 12:58:37.000000000 -0700
+++ install-sh  2006-04-24 13:34:41.000000000 -0700
@@ -340,13 +340,16 @@ do
 
        pathcomp=$pathcomp$d
        if test ! -d "$pathcomp"; then
-         $mkdirprog "$pathcomp"
+         if $posix_mkdir; then
+           $mkdirprog -m "$mkdir_mode" -p -- "$dstdir" && break
+         else
+           $mkdirprog "$pathcomp" && obsolete_mkdir_used=true
+         fi
          # Don't fail if two instances are running concurrently.
          test -d "$pathcomp" || exit 1
        fi
        pathcomp=$pathcomp/
       done
-      obsolete_mkdir_used=true
     fi
   fi
 


Reply via email to