cvs commit: qpsmtpd qpsmtpd-forkserver

[email protected] (Matt Sergeant)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     04/07/17 01:45:09

  Modified:    .        qpsmtpd-forkserver
  Log:
  srand after the fork.
  
  Revision  Changes    Path
  1.7       +5 -0      qpsmtpd/qpsmtpd-forkserver
  
  Index: qpsmtpd-forkserver
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/qpsmtpd-forkserver,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- qpsmtpd-forkserver	5 Jul 2004 19:20:15 -0000	1.6
  +++ qpsmtpd-forkserver	17 Jul 2004 08:45:09 -0000	1.7
  @@ -142,6 +142,11 @@
       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);
   
       $SIG{$_} = 'DEFAULT' for keys %SIG;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.