[lokisetup] [PATCH] tmp races in makeself

Chunky Kibbles chunky at icculus.org
Tue Sep 7 13:22:17 EDT 2004


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 (-;



More information about the Lokisetup mailing list