summaryrefslogtreecommitdiffstats
path: root/src/libutil/multipattern.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-09 13:59:56 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-09 14:06:40 +0100
commit4c2c4f0fdc54f9bdb5371a108c3dc7886e6c81ec (patch)
tree731e32b41934b03c0d7fc802f57e76eb58ea2cb1 /src/libutil/multipattern.c
parent7b0d41173904268944de296ab85f20efef91bde5 (diff)
downloadrspamd-4c2c4f0fdc54f9bdb5371a108c3dc7886e6c81ec.tar.gz
rspamd-4c2c4f0fdc54f9bdb5371a108c3dc7886e6c81ec.zip
[Fix] Allow to follow symlinks when safe
Issue: #1625
Diffstat (limited to 'src/libutil/multipattern.c')
-rw-r--r--src/libutil/multipattern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index 35ef51a70..508ffcda9 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -470,7 +470,7 @@ rspamd_multipattern_try_load_hs (struct rspamd_multipattern *mp,
rspamd_snprintf (fp, sizeof (fp), "%s/%*xs.hsmp", hs_cache_dir,
(gint)rspamd_cryptobox_HASHBYTES / 2, hash);
- if ((map = rspamd_file_xmap (fp, PROT_READ, &len)) != NULL) {
+ if ((map = rspamd_file_xmap (fp, PROT_READ, &len, TRUE)) != NULL) {
if (hs_deserialize_database (map, len, &mp->db) == HS_SUCCESS) {
munmap (map, len);
return TRUE;
@@ -500,7 +500,7 @@ rspamd_multipattern_try_save_hs (struct rspamd_multipattern *mp,
rspamd_snprintf (fp, sizeof (fp), "%s/%*xs.hsmp.tmp", hs_cache_dir,
(gint)rspamd_cryptobox_HASHBYTES / 2, hash);
- if ((fd = rspamd_file_xopen (fp, O_WRONLY|O_CREAT|O_EXCL, 00644)) != -1) {
+ if ((fd = rspamd_file_xopen (fp, O_WRONLY | O_CREAT | O_EXCL, 00644, 0)) != -1) {
if (hs_serialize_database (mp->db, &bytes, &len) == HS_SUCCESS) {
if (write (fd, bytes, len) == -1) {
msg_warn ("cannot write hyperscan cache to %s: %s",