]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: Create temporary directory under a strict umask
authorScott James Remnant <scott@netsplit.com>
Tue, 3 Feb 2004 22:02:51 +0000 (22:02 +0000)
committerScott James Remnant <scott@netsplit.com>
Tue, 3 Feb 2004 22:02:51 +0000 (22:02 +0000)
rather than running chmod afterwards, preventing a race
condition where the directory could be replaced with a symbolic
link in the time between the two commands.

ChangeLog
ltmain.in

index 413a4b2ac0e8304d9950c1ab52d00d4356341d85..9389a2b3ddae57edfde22abaae00091b801cfe40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-02-03  Scott James Remnant  <scott@netsplit.com>
+
+       * ltmain.in: Create temporary directory under a strict umask
+       rather than running chmod afterwards, preventing a race
+       condition where the directory could be replaced with a symbolic
+       link in the time between the two commands.
+
 2004-01-31  Peter O'Gorman  <peter@pogma.com>
 
        * m4/libtool.m4 (_LT_CONFIG_STATUS_DECLARE): Change `echo to 
index 907e7e12685ce01c88ed82fad9542fc14b13d16f..fffb7b7feeec38a18eed030ade08fdedc3b3f5ee 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -5873,8 +5873,12 @@ relink_command=\"$relink_command\""
              tmpdir="/tmp"
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
              tmpdir="$tmpdir/libtool-$$"
-             if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
+             save_umask=`umask`
+             umask 0077
+             if $mkdir "$tmpdir"; then
+               umask $save_umask
              else
+               umask $save_umask
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
                continue
              fi