Software /
code /
prosody
Changeset
7076:ad9e683b8f0b
util.uuid: Open /dev/urandom read-only, make seed() a noop
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 10 Jan 2016 23:21:34 +0100 |
parents | 7060:eed0632cd636 |
children | 7077:0386ccf20ac7 |
files | util/uuid.lua |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/util/uuid.lua Fri Jan 08 13:01:32 2016 +0000 +++ b/util/uuid.lua Sun Jan 10 23:21:34 2016 +0100 @@ -8,7 +8,7 @@ local error = error; local round_up = math.ceil; -local urandom, urandom_err = io.open("/dev/urandom", "r+"); +local urandom, urandom_err = io.open("/dev/urandom", "r"); module "uuid" @@ -30,9 +30,7 @@ return get_nibbles(8).."-"..get_nibbles(4).."-4"..get_nibbles(3).."-"..(get_twobits())..get_nibbles(3).."-"..get_nibbles(12); end -function seed(x) - urandom:write(x); - urandom:flush(); +function seed() end return _M;