From 2fae967e16f362cf385961c7db0db0e103285bf5 Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Tue, 3 Feb 2004 21:59:38 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ ltmain.in | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e2d1ed1e7..3ac407be1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-02-03 Scott James Remnant + + * 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-02-03 Paul Eggert Scott James Remnant diff --git a/ltmain.in b/ltmain.in index cd9d2a8d5..2f09745a6 100644 --- a/ltmain.in +++ b/ltmain.in @@ -5673,8 +5673,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 -- 2.47.3