From ce59fc98b67b4c8e91543967a4c7d0d20875b223 Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Sat, 17 Jul 2004 08:45:09 +0000 Subject: [PATCH] srand after the fork. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@272 958fd67b-6ff1-0310-b445-bb7760255be9 --- qpsmtpd-forkserver | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qpsmtpd-forkserver b/qpsmtpd-forkserver index 06cffe4..ab65e32 100755 --- a/qpsmtpd-forkserver +++ b/qpsmtpd-forkserver @@ -141,6 +141,11 @@ while (1) { } die "fork: $!" unless defined $pid; # failure # otherwise child + + ## call srand(), else we will have (e.g.) the same tempfile in + ## _all_ children + ## i.e. after 'use File::Temp; ($fh,$name)=tempfile();' in a plugin + srand( ($$ ^ $port) ^ (time ^ unpack("C*", $iaddr)) ); close($server);