]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Don't disable symbols twice
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Sep 2018 09:58:02 +0000 (10:58 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 25 Sep 2018 09:58:30 +0000 (10:58 +0100)
src/libserver/symbols_cache.c

index 69a1f715868861b3ac9b181d9d9d861d62a06d2f..56b9f86de97df5509ed2c863818da51bf91b7ec9 100644 (file)
@@ -1582,6 +1582,7 @@ rspamd_symbols_cache_process_settings (struct rspamd_task *task,
        struct rspamd_symbols_group *gr;
        GHashTableIter gr_it;
        ucl_object_iter_t it = NULL;
+       gboolean already_disabled = FALSE;
        gpointer k, v;
 
        wl = ucl_object_lookup (task->settings, "whitelist");
@@ -1597,6 +1598,7 @@ rspamd_symbols_cache_process_settings (struct rspamd_task *task,
        if (enabled) {
                /* Disable all symbols but selected */
                rspamd_symbols_cache_disable_all_symbols (task, cache);
+               already_disabled = TRUE;
                it = NULL;
 
                while ((cur = ucl_iterate_object (enabled, &it, true)) != NULL) {
@@ -1610,7 +1612,10 @@ rspamd_symbols_cache_process_settings (struct rspamd_task *task,
 
        if (enabled) {
                it = NULL;
-               rspamd_symbols_cache_disable_all_symbols (task, cache);
+
+               if (!already_disabled) {
+                       rspamd_symbols_cache_disable_all_symbols (task, cache);
+               }
 
                while ((cur = ucl_iterate_object (enabled, &it, true)) != NULL) {
                        if (ucl_object_type (cur) == UCL_STRING) {