srand after the fork.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@272 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
96ec52d088
commit
ce59fc98b6
@ -142,6 +142,11 @@ while (1) {
|
|||||||
die "fork: $!" unless defined $pid; # failure
|
die "fork: $!" unless defined $pid; # failure
|
||||||
# otherwise child
|
# 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);
|
close($server);
|
||||||
|
|
||||||
$SIG{$_} = 'DEFAULT' for keys %SIG;
|
$SIG{$_} = 'DEFAULT' for keys %SIG;
|
||||||
|
Loading…
Reference in New Issue
Block a user