diff options
author | Kim Alvefur <zash@zash.se> | 2016-01-10 23:21:34 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-01-10 23:21:34 +0100 |
commit | b46dc8fc37e92651098c72fefa6fc64a29691f16 (patch) | |
tree | 9405b7afb98f9d82f7d5dc3c3030af2e32172f84 /util/uuid.lua | |
parent | 6c58bce213b8c782a8c767a523cae9facab3d195 (diff) | |
download | prosody-b46dc8fc37e92651098c72fefa6fc64a29691f16.tar.gz prosody-b46dc8fc37e92651098c72fefa6fc64a29691f16.zip |
util.uuid: Open /dev/urandom read-only, make seed() a noop
Diffstat (limited to 'util/uuid.lua')
-rw-r--r-- | util/uuid.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/util/uuid.lua b/util/uuid.lua index 58f792fd..3576be8f 100644 --- a/util/uuid.lua +++ b/util/uuid.lua @@ -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 @@ function generate() 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; |