Re: RFC/PATCH: Random pid generation (2nd try) - sorry

From: Riley Williams (rhw@MemAlpha.CX)
Date: Wed Jan 12 2000 - 06:10:25 EST


Hi Alan, Marek.

>> More and more programs (eg CGI-Scripts) use the PID as
>> pseudo-random number. As this isn't really random and easily
>> guessed from the outside (esp. with daemons loaded while
>> booting) it's a little bit troublesome.

One simple fix I've seen (and used myself on occasion) is to do the
following in a bash CGI script - this was to generate a number in the
range 1 to 75:

 Q> SEED=`date "+75%S $PID*75%%p" | dc`

Whilst the individual components may be simple to guess, the result
usually isn't.

Best wishes from Riley.

 * Copyright (C) 1999, Memory Alpha Systems.
 * All rights and wrongs reserved.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
 * http://www.memalpha.cx/Linux/Kernel/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:20 EST