]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix lua_parse_symbol_type function logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 1 May 2020 19:13:43 +0000 (20:13 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 1 May 2020 19:14:12 +0000 (20:14 +0100)
src/lua/lua_config.c

index 4d728cf14469f5f418af3c3e22afe11cdbeb5586..fdf87d332403a5ea690377cf4647565c6fca1055 100644 (file)
@@ -1814,17 +1814,23 @@ lua_parse_symbol_type (const gchar *str)
                                str = vec[i];
 
                                if (g_ascii_strcasecmp (str, "virtual") == 0) {
-                                       ret = SYMBOL_TYPE_VIRTUAL;
+                                       ret |= SYMBOL_TYPE_VIRTUAL;
+                                       ret &= ~SYMBOL_TYPE_NORMAL;
+                                       ret &= ~SYMBOL_TYPE_CALLBACK;
                                } else if (g_ascii_strcasecmp (str, "callback") == 0) {
-                                       ret = SYMBOL_TYPE_CALLBACK;
+                                       ret |= SYMBOL_TYPE_CALLBACK;
+                                       ret &= ~SYMBOL_TYPE_NORMAL;
+                                       ret &= ~SYMBOL_TYPE_VIRTUAL;
                                } else if (g_ascii_strcasecmp (str, "normal") == 0) {
-                                       ret = SYMBOL_TYPE_NORMAL;
+                                       ret |= SYMBOL_TYPE_NORMAL;
+                                       ret &= ~SYMBOL_TYPE_CALLBACK;
+                                       ret &= ~SYMBOL_TYPE_VIRTUAL;
                                } else if (g_ascii_strcasecmp (str, "prefilter") == 0) {
-                                       ret = SYMBOL_TYPE_PREFILTER | SYMBOL_TYPE_GHOST;
+                                       ret |= SYMBOL_TYPE_PREFILTER | SYMBOL_TYPE_GHOST;
                                } else if (g_ascii_strcasecmp (str, "postfilter") == 0) {
-                                       ret = SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST;
+                                       ret |= SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST;
                                } else if (g_ascii_strcasecmp (str, "idempotent") == 0) {
-                                       ret = SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST |
+                                       ret |= SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST |
                                                        SYMBOL_TYPE_IDEMPOTENT;
                                } else {
                                        gint fl = 0;