From 1b1ef16313c1fca804976ecf77e760807b261fe5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 11 Nov 2021 10:58:06 +0000 Subject: [PATCH] [Fix] Read file maps if they were not pre-read during preload --- src/libserver/maps/map.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c index d30b2b40d..938f4a47f 100644 --- a/src/libserver/maps/map.c +++ b/src/libserver/maps/map.c @@ -2155,6 +2155,15 @@ rspamd_map_watch (struct rspamd_config *cfg, data = bk->data.fd; + if (map->user_data == NULL || *map->user_data == NULL) { + /* Map has not been read, init it's reading if possible */ + struct stat st; + + if (stat (data->filename, &st) != -1) { + data->need_modify = TRUE; + } + } + ev_stat_init (&data->st_ev, rspamd_map_on_stat, data->filename, map->poll_timeout * cfg->map_file_watch_multiplier); data->st_ev.data = map; -- 2.39.5