From: Scott James Remnant Date: Tue, 3 Feb 2004 22:02:51 +0000 (+0000) Subject: * ltmain.in: Create temporary directory under a strict umask X-Git-Tag: release-1-9b~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21b9758e8c41c7f7638dfe4e8d01bb1d28f73de4;p=thirdparty%2Flibtool.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 413a4b2ac..9389a2b3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-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-01-31 Peter O'Gorman * m4/libtool.m4 (_LT_CONFIG_STATUS_DECLARE): Change `echo to diff --git a/ltmain.in b/ltmain.in index 907e7e126..fffb7b7fe 100644 --- 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