bug-gnulib
[Top][All Lists]
Advanced

[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 11:25:11 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Oct 18, 2016 at 06:24:03AM -0500, Eric Blake wrote:
> On 10/17/2016 11:46 PM, address@hidden 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)
> 
> automake.git/lib/install-sh
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 


Ah!

Sorry for the noise then.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]