Mercurial > prosody-hg
diff util/random.lua @ 7083:ac920b0f9eae
util.random: Open /dev/urandom read-only, make seed() a noop
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 12 Jan 2016 23:48:16 +0100 |
| parents | ae044691de0f |
| children | 51cf09bb74eb |
line wrap: on
line diff
--- a/util/random.lua Tue Jan 12 23:47:30 2016 +0100 +++ b/util/random.lua Tue Jan 12 23:48:16 2016 +0100 @@ -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)
