diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-01 20:13:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-05-01 20:14:12 +0100 |
commit | c1bd3f81f3fba86a22bb5ed95563b8370e07d111 (patch) | |
tree | b49e62b60a0e0b9d8231043a0a3ec572d660e672 /src/lua | |
parent | d92cf02cf31a0e4ed7f9efda02c2bcce59613882 (diff) | |
download | rspamd-c1bd3f81f3fba86a22bb5ed95563b8370e07d111.tar.gz rspamd-c1bd3f81f3fba86a22bb5ed95563b8370e07d111.zip |
[Fix] Fix lua_parse_symbol_type function logic
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_config.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 4d728cf14..fdf87d332 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -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; |