aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-23 12:35:31 +0100
committerGitHub <noreply@github.com>2019-10-23 12:35:31 +0100
commit9169ffd78cd6fe31d7ddde39f3f9ba251ddd170e (patch)
treea3d45cc86105b81f4d4591362bb395f37cb492ca
parentb2a56e306a69aac37ecbd092706568f27f94282b (diff)
parent66c07a2ac7c9a87561c64a43bc9ae8b64594b321 (diff)
downloadrspamd-9169ffd78cd6fe31d7ddde39f3f9ba251ddd170e.tar.gz
rspamd-9169ffd78cd6fe31d7ddde39f3f9ba251ddd170e.zip
Merge pull request #3112 from denpaforks/p0f-devel
[Minor] Fixes for p0f plugin
-rw-r--r--lualib/lua_scanners/p0f.lua2
-rw-r--r--src/plugins/lua/milter_headers.lua6
2 files changed, 4 insertions, 4 deletions
diff --git a/lualib/lua_scanners/p0f.lua b/lualib/lua_scanners/p0f.lua
index b27a42ef6..056c0ad8b 100644
--- a/lualib/lua_scanners/p0f.lua
+++ b/lualib/lua_scanners/p0f.lua
@@ -117,7 +117,7 @@ local function p0f_check(task, ip, rule)
data = parse_p0f_response(data)
- if rule.redis_params then
+ if rule.redis_params and data then
local key = rule.prefix .. ip:to_string()
local ret = lua_redis.redis_make_request(task,
rule.redis_params,
diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua
index 5d8d24c91..982b07dd0 100644
--- a/src/plugins/lua/milter_headers.lua
+++ b/src/plugins/lua/milter_headers.lua
@@ -422,11 +422,11 @@ local function milter_headers(task)
local os_string, link_type, uptime_min, distance =
task:get_mempool():get_variable('os_fingerprint',
- 'string, string, int, int');
+ 'string, string, double, double');
if not os_string then return end
- local value = string.format('%s, (up: %u min), (distance %i, link: %s)',
+ local value = string.format('%s, (up: %i min), (distance %i, link: %s)',
os_string, uptime_min, distance, link_type)
if settings.routines['x-os-fingerprint'].remove then
@@ -434,7 +434,7 @@ local function milter_headers(task)
= settings.routines['x-os-fingerprint'].remove
end
- add_header(settings.routines['x-os-fingerprint'].header, value)
+ add_header('x-os-fingerprint', value)
end
routines['x-spam-status'] = function()