]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix loading of file maps
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 May 2016 11:51:17 +0000 (12:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 May 2016 11:51:17 +0000 (12:51 +0100)
src/libutil/map.c

index f99c35784fd205245b3aaf7e435c81ce5c573a89..77c806b1964688c89c24f4e033ff9e288915f9bc 100644 (file)
@@ -1062,6 +1062,7 @@ rspamd_map_parse_backend (struct rspamd_config *cfg, const gchar *map_line)
        /* Now check for each proto separately */
        if (bk->protocol == MAP_PROTO_FILE) {
                fdata = g_slice_alloc0 (sizeof (struct file_map_data));
+               fdata->st.st_mtime = -1;
 
                if (access (bk->uri, R_OK) == -1) {
                        if (errno != ENOENT) {
@@ -1072,11 +1073,6 @@ rspamd_map_parse_backend (struct rspamd_config *cfg, const gchar *map_line)
                        msg_info_config (
                                        "map '%s' is not found, but it can be loaded automatically later",
                                        bk->uri);
-                       /* We still can add this file */
-                       fdata->st.st_mtime = -1;
-               }
-               else {
-                       stat (bk->uri, &fdata->st);
                }
 
                fdata->filename = g_strdup (bk->uri);