On 10/17/2016 11:46 PM, co...@sdf.org wrote:
> 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.

Except that it won't be just /tmp/ins-, but /tmp/ins-$$ (that is, the
pid is encoded into each directory); parallel runs of this script have
different pids and thus different directories.

> (I didn't find the script in automake's git repository, so assumed this
> is the place)


Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to