diff options
-rw-r--r-- | src/libutil/map.c | 6 | ||||
-rw-r--r-- | src/libutil/map_private.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index 439a13e94..22e78c097 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -1453,6 +1453,8 @@ rspamd_map_parse_backend (struct rspamd_config *cfg, const gchar *map_line) bk->data.hd = hdata; } + bk->id = rspamd_random_uint64_fast (); + return bk; err: @@ -1511,7 +1513,7 @@ rspamd_map_add (struct rspamd_config *cfg, map->fin_callback = fin_callback; map->user_data = user_data; map->cfg = cfg; - map->id = g_random_int (); + map->id = rspamd_random_uint64_fast (); map->locked = rspamd_mempool_alloc0_shared (cfg->cfg_pool, sizeof (gint)); map->cache = @@ -1559,7 +1561,7 @@ rspamd_map_add_from_ucl (struct rspamd_config *cfg, map->fin_callback = fin_callback; map->user_data = user_data; map->cfg = cfg; - map->id = g_random_int (); + map->id = rspamd_random_uint64_fast (); map->locked = rspamd_mempool_alloc0_shared (cfg->cfg_pool, sizeof (gint)); map->cache = diff --git a/src/libutil/map_private.h b/src/libutil/map_private.h index 379dc8b50..edd82d855 100644 --- a/src/libutil/map_private.h +++ b/src/libutil/map_private.h @@ -51,6 +51,7 @@ struct rspamd_map_backend { enum fetch_proto protocol; gboolean is_signed; gboolean is_compressed; + guint64 id; struct rspamd_cryptobox_pubkey *trusted_pubkey; union { struct file_map_data *fd; |