On 2006-03-14 23:38:45 +0100, Peter J. Holzer wrote:
> On 2006-03-14 16:36:13 -0500, John Peacock wrote:
> > Can we poke a new ID value manually for each fork instance?
> 
> Yes. It's ugly but it works:
> 
>         srand();
>         for (0 .. rand(65536)) {
>             Net::DNS::Header::nextid();
>         }

I see that qpsmtpd-forkserver calls:

    srand( time ^ ($$ + ($$ << 15)) );

Is this wise? According to the manual, the default value

                                   is based on time of day, pro­
               cess ID, and memory allocation, or the /dev/uran­
               dom device, if available.

so just calling srand() should be at least as random as the code above.
(We aren't worried about compatibility with perl 5.003, are we?)

        hp



-- 
   _  | Peter J. Holzer    | Ich sehe nun ein, dass Computer wenig
|_|_) | Sysadmin WSR       | geeignet sind, um sich was zu merken.
| |   | [EMAIL PROTECTED]         |
__/   | http://www.hjp.at/ |    -- Holger Lembke in dan-am

Attachment: pgpXEY2GBURqu.pgp
Description: PGP signature

Reply via email to