summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lua/lua_common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 6c640eec3..baab27226 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -374,6 +374,14 @@ rspamd_lua_init ()
lua_newtable (L);
lua_setglobal (L, "rspamd_plugins");
+ /* Set PRNG */
+ lua_getglobal (L, "math");
+ lua_pushstring (L, "randomseed");
+ lua_gettable (L, -2);
+ lua_pushnumber (L, ottery_rand_uint64 ());
+ lua_pcall (L, 1, 0, 0);
+ lua_pop (L, 1); /* math table */
+
return L;
}