* 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.
This commit is contained in:
Scott James Remnant 2004-02-03 22:02:51 +00:00
parent 56ffee0e55
commit 21b9758e8c
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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