From f1d3d688b0104093cbee37b089a193753275b40d Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Tue, 12 Jan 2016 23:48:16 +0100
Subject: util.random: Open /dev/urandom read-only, make seed() a noop

---
 util/random.lua | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'util')

diff --git a/util/random.lua b/util/random.lua
index 4963e98c..05f36aba 100644
--- a/util/random.lua
+++ b/util/random.lua
@@ -6,11 +6,9 @@
 -- COPYING file in the source package for more information.
 --
 
-local urandom = assert(io.open("/dev/urandom", "r+"));
+local urandom = assert(io.open("/dev/urandom", "r"));
 
-local function seed(x)
-	urandom:write(x);
-	urandom:flush();
+local function seed()
 end
 
 local function bytes(n)
-- 
cgit v1.2.3