[lokisetup] [PATCH] tmp races in makeself

Stephane Peter megastep at megastep.org
Tue Sep 7 15:05:06 EDT 2004


I see your point, but that 1 second granularity can be a possible 
problem for fast machines (or small archives).

What I'm thinking is combining the two approaches... The date command 
is always available to at least separate the directories, and for 
systems that have it, $RANDOM will take care of any other possible 
clashes.


On Sep 7, 2004, at 10:22 AM, Chunky Kibbles wrote:

> On Mon, Sep 06, 2004 at 08:25:56PM +0200, Ludwig Nussel wrote:
>> Stephane Peter wrote:
>>> I have concerns over the usage of $RANDOM though. Isn't that a 
>>> bashism?
>>> I need something that works on all Bourne shells out here.
>>
>> I have no idea but if it's not special then it doesn't harm either.
>> $RANDOM is not required to fix the problem, it just makes collisions
>> more unlikely.
>
> Why not use something like
>
> `date +"%y%m%d%H%M%S"`
>
> ?
>
> I've just tested it on solaris, hpux, linux, aix, sco, irix, and it
> worked fine on all those.
>
> If you already have the PID in the filename, then I imagine this
> renders filenames pretty unique, on the grounds that someone would
> have to start an installation process, finish it, wait for the PIDs to
> roll over, and start again within one second.
>
> $RANDOM is, indeed, a pure bashism, and I'm inclined to say that if
> you're going to try to fix a problem [name clashes], then you may as
> well fix it properly.
>
> Gary (-;
>
--
Stéphane Peter
megastep at megastep.org




More information about the Lokisetup mailing list