shlist

share and manage lists between multiple people
Log | Files | Refs

commit 4203872ded00824905be20224e5a9bfcb41013b4
parent c8c06141be731bcf274f5d79a730da30c929f412
Author: kyle <kyle@0x30.net>
Date:   Sun, 27 Dec 2015 23:31:21 -0700

sl: stir arc4random on fork()

Diffstat:
Msl | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sl b/sl @@ -2,7 +2,7 @@ use warnings; use strict; -use BSD::arc4random qw(:all); +use BSD::arc4random qw(arc4random_bytes arc4random_stir); use DBI; use File::Temp; use Digest::SHA qw(sha256_base64); @@ -52,8 +52,9 @@ while (my $client_sock = $listen_sock->accept()) { next; } - # in child: close the listening socket and add ip/port logging prefix + # in child: on linux we must stir the random pool after fork()'s close $listen_sock; + arc4random_stir(); log_set_peer_host_port($client_sock); log_print("new connection (pid = '$$')\n");