cvs commit: qpsmtpd qpsmtpd-forkserver

[email protected] (Robert Spier)
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
cvsuser     04/07/17 18:29:00

  Modified:    .        qpsmtpd-forkserver
  Log:
  Switch to a simpler and known good seeding algorithm
  
  Revision  Changes    Path
  1.8       +4 -6      qpsmtpd/qpsmtpd-forkserver
  
  Index: qpsmtpd-forkserver
  ===================================================================
  RCS file: /cvs/public/qpsmtpd/qpsmtpd-forkserver,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- qpsmtpd-forkserver	17 Jul 2004 08:45:09 -0000	1.7
  +++ qpsmtpd-forkserver	18 Jul 2004 01:29:00 -0000	1.8
  @@ -18,7 +18,7 @@
   
   # Configuration
   my $MAXCONN   = 15;				# max simultaneous connections
  -my $PORT      = 25;				# port number
  +my $PORT      = 2525;				# port number
   my $LOCALADDR = '0.0.0.0';		# ip address to bind to
   my $USER      = 'smtpd';		# user to suid to
   my $MAXCONNIP = 5;              # max simultaneous connections from one IP
  @@ -142,10 +142,8 @@
       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)) );
  +    # all children should have different seeds, to prevent conflicts
  +    srand( time ^ ($$ + ($$ << 15)) );
   
       close($server);
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.