]> source.dussan.org Git - rspamd.git/commit
Fix shm on DragonFly 1315/head
authorMichael Neumann <mneumann@ntecs.de>
Fri, 6 Jan 2017 11:58:18 +0000 (12:58 +0100)
committerMichael Neumann <mneumann@ntecs.de>
Fri, 6 Jan 2017 11:58:18 +0000 (12:58 +0100)
commit223e7817c905d6163aae850e4e47a47324a17345
tree718d0c608bcb894293bceeb48035705fc58d0707
parent348e129aac10e5668aa16d19bffdb95473d52883
Fix shm on DragonFly

Rspamd tried to call shm_open(3) with a path in the root filesystem
(e.g. /rhm.3f0fd440d46fac91e1b4). But DragonFly uses regular files
for shm. Obviously, this fails, because rspamd has no permissions
to create files in the root (/).

Lots of lines like the following were found in
/var/log/rspamd/rspamd.log before this patch:

    rspamd_shmem_mkstemp: /usr/obj/dports/mail/rspamd/rspamd-1.4.1/src
      /libutil/util.c:1970: failed to create temp shmem
      /rhm.3f0fd440d46fac91e1b4: Permission denied

Also, rspamd made the receiving of mail very slow, when used
in the pre-accept rmilter setting, due to these errors. Even
worse, it just didn't filter emails at all.

This patch fixes the problem by creating the shm files in /tmp
for DragonFly. With this patch applied, these lines are gone from
the log and emails now correctly contain the X-Spamd-Result header,
AND receiving mails is now much much faster.

For rspamd 1.4.1, we will fix it in dports:

    https://github.com/DragonFlyBSD/DeltaPorts/pull/727
src/libutil/http.c