]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix versions comparison
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Mar 2016 16:01:15 +0000 (16:01 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Mar 2016 16:01:15 +0000 (16:01 +0000)
src/libserver/cfg_rcl.c
src/plugins/lua/rspamd_update.lua

index 497e5cf9be73a55a46a1984f5166e880073ca730..265b14ca4e61d0366516761243c380e40424cd45 100644 (file)
@@ -728,7 +728,7 @@ rspamd_rcl_lua_version_cmp (lua_State *L)
                }
 
                if (components[1]) {
-                       ret = rspamd_rcl_cmp_components (components[1], RSPAMD_VERSION_MAJOR);
+                       ret = rspamd_rcl_cmp_components (components[1], RSPAMD_VERSION_MINOR);
                }
 
                if (ret) {
index 14f9e54b746cf0c09d01df485d66e176fbc96e0f..344f58ebee5a65098a7bcbfd68475b8c5d25cd09 100644 (file)
@@ -60,14 +60,14 @@ local function check_version(obj)
   local ret = true
 
   if obj['min_version'] then
-    if rspamd_version('cmp', obj['min_version']) < 0 then
+    if rspamd_version('cmp', obj['min_version']) > 0 then
       ret = false
       rspamd_logger.errx(rspamd_config, 'updates require at least %s version of rspamd',
         obj['min_version'])
     end
   end
   if obj['max_version'] then
-    if rspamd_version('cmp', obj['max_version']) > 0 then
+    if rspamd_version('cmp', obj['max_version']) < 0 then
       ret = false
       rspamd_logger.errx(rspamd_config, 'updates require maximum %s version of rspamd',
         obj['max_version'])