Re: Re: Crypt salts not random.. (fwd)
| From: | Andi Gutmans | Date: | Sun, 29 Apr 2001 12:27:38 +0000 |
| Subject: | Re: Re: Crypt salts not random.. (fwd) | ||
| References: | 1 2 3 4 5 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-52886@lists.php.net to get a copy of this message | ||
At 02:05 PM 4/29/2001 +0300, Zeev Suraski wrote:
At 14:57 29/4/2001, Andi Gutmans wrote:Jani has already moved it to RINIT which is a good beginning. Adding the pid is a good idea. Is there a function which gives us the pid for both threaded and un-threaded modes? Or do we need to use #ifdef ZTS and use the tsrm_thread_id() function in threaded mode and getpid() in non-threaded? AndiAt 01:55 PM 4/29/2001 +0300, Zeev Suraski wrote:In order to avoid this you actually have to call it at completely different times, something you can't really guarantee. We should probably not use the timestamp as the seed (at least not alone), but also take the pid into account.At 13:58 29/4/2001, Andi Gutmans wrote:Well as it was initialized in MINIT it is initialized *exactly* at the same time for all apache children. Therefore, the numbers returned by each child are the same.The seed was initialized in MINIT before the children forked. So what happened was that the children started returning the same random numbers.It doesn't really matter where it was initialized, but rather, when it was initialized...