aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs_helper.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-08 00:55:26 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-08 00:55:26 +0000
commit239c4e5d2e8ede4bcdc35058208371e8febaf6c1 (patch)
treec80592a9a7d0f6e153acb4c7f3ccd2f1ee3eb465 /src/hs_helper.c
parentb19163b84133ada0ff04581065905be7a7436d96 (diff)
downloadrspamd-239c4e5d2e8ede4bcdc35058208371e8febaf6c1.tar.gz
rspamd-239c4e5d2e8ede4bcdc35058208371e8febaf6c1.zip
Fix re-using of hyperscan hashes
Diffstat (limited to 'src/hs_helper.c')
-rw-r--r--src/hs_helper.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/hs_helper.c b/src/hs_helper.c
index 220224572..9b0f5b7c8 100644
--- a/src/hs_helper.c
+++ b/src/hs_helper.c
@@ -103,10 +103,13 @@ rspamd_hs_helper_cleanup_dir (struct hs_helper_ctx *ctx)
if ((rc = glob (pattern, GLOB_DOOFFS, NULL, &globbuf)) == 0) {
for (i = 0; i < globbuf.gl_pathc; i++) {
- if (unlink (globbuf.gl_pathv[i]) == -1) {
- msg_err ("cannot unlink %s: %s", globbuf.gl_pathv[i],
- strerror (errno));
- ret = FALSE;
+ if (!rspamd_re_cache_is_valid_hyperscan_file (ctx->cfg->re_cache,
+ globbuf.gl_pathv[i])) {
+ if (unlink (globbuf.gl_pathv[i]) == -1) {
+ msg_err ("cannot unlink %s: %s", globbuf.gl_pathv[i],
+ strerror (errno));
+ ret = FALSE;
+ }
}
}
}