[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: install-sh and $RANDOM
From: |
coypu |
Subject: |
Re: install-sh and $RANDOM |
Date: |
Tue, 18 Oct 2016 04:46:40 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Oct 17, 2016 at 04:56:05PM -0500, Eric Blake wrote:
> Second, your claim that things are "spuriously bad if $RANDOM does not
> exist" is false. Look at the full context:
>
> tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
> trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit
> $ret' 0
I don't mean that it's dangerous to use (endangers the user), but deleting
those directories when $tmpdir is just /tmp/ins- will make this script race
other instances of itself, and delete their work.
(I didn't find the script in automake's git repository, so assumed this
is the place)