rspamd — проблемы с патчем для exim-4.84

Итак, с последним обновлением exim в FreeBSD возникла проблемка. Точнее не с самим Exim, а с патчем для интеграции rspamd в Exim. При попытке пропатчить исходники получил вот что: 2 out of 11 hunks failed—saving rejects to src/spam.c.rej
Нагляднее ниже в листинге ….

root@black:/usr/ports/mail/exim# make extract
Exim now drops privileges when alternate configuration
files are used.  You can set make variable TRUSTED_CONFIG_LIST
to specify the list of configuration files for which
root privileges will be retained.

You can whitelist some macros using the make variable
WHITELIST_D_MACROS.  This is useful if you are running
with DISABLE_D_OPT set, but macros whitelisting will be
removed in some future Exim release, so it is better
to use TRUSTED_CONFIG_LIST to set the list of trusted
configuration files.
===>  License GPLv2 accepted by the user
===>  Found saved configuration for exim-4.83
===>   exim-4.84_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by exim-4.84_1 for building
===>  Extracting for exim-4.84_1
=> SHA256 Checksum OK for exim/exim-4.84.tar.bz2.
root@black:/usr/ports/mail/exim# cd work/exim-4.84
root@black:/usr/ports/mail/exim/work/exim-4.84# patch -p2 < /root/patch-exim-src_spam.c.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/OS/os.h-Linux b/src/OS/os.h-Linux
|index 3fead17..03fea75 100644
|--- a/src/OS/os.h-Linux
|+++ b/src/OS/os.h-Linux
--------------------------
Patching file OS/os.h-Linux using Plan A...
Hunk #1 succeeded at 20.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/expand.c b/src/src/expand.c
|index 1da2225..7da567a 100644
|--- a/src/src/expand.c
|+++ b/src/src/expand.c
--------------------------
Patching file src/expand.c using Plan A...
Hunk #1 succeeded at 641 (offset 23 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/globals.c b/src/src/globals.c
|index 74b6edb..e6f02fb 100644
|--- a/src/src/globals.c
|+++ b/src/src/globals.c
--------------------------
Patching file src/globals.c using Plan A...
Hunk #1 succeeded at 1257 (offset 45 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/globals.h b/src/src/globals.h
|index db436c0..fc4d9f6 100644
|--- a/src/src/globals.h
|+++ b/src/src/globals.h
--------------------------
Patching file src/globals.h using Plan A...
Hunk #1 succeeded at 803 (offset 34 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/spam.c b/src/src/spam.c
|index 63395f2..41fd4ac 100644
|--- a/src/src/spam.c
|+++ b/src/src/spam.c
--------------------------
Patching file src/spam.c using Plan A...
Hunk #1 failed at 14.
Hunk #2 succeeded at 39 (offset 2 lines).
Hunk #3 succeeded at 137 (offset 2 lines).
Hunk #4 succeeded at 189 (offset 2 lines).
Hunk #5 succeeded at 226 (offset 2 lines).
Hunk #6 succeeded at 263 (offset 2 lines).
Hunk #7 failed at 335.
Hunk #8 succeeded at 410 (offset 2 lines).
Hunk #9 succeeded at 439 (offset 2 lines).
Hunk #10 succeeded at 551 (offset 2 lines).
Hunk #11 succeeded at 576 (offset 2 lines).
2 out of 11 hunks failed--saving rejects to src/spam.c.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/spam.h b/src/src/spam.h
|index ba700c8..6047c59 100644
|--- a/src/src/spam.h
|+++ b/src/src/spam.h
--------------------------
Patching file src/spam.h using Plan A...
Hunk #1 succeeded at 22.
done
root@black:/usr/ports/mail/exim/work/exim-4.84#

После чего пришлось чуток поковыряться и «родить» новый патч. Демонстрация того что новый патч отрабатывает нормально:

root@black:/usr/ports/mail/exim/work/exim-4.84# cd ../../
root@black:/usr/ports/mail/exim# make clean
===>  Cleaning for exim-4.84_1
root@black:/usr/ports/mail/exim# make extract
Exim now drops privileges when alternate configuration
files are used.  You can set make variable TRUSTED_CONFIG_LIST
to specify the list of configuration files for which
root privileges will be retained.

You can whitelist some macros using the make variable
WHITELIST_D_MACROS.  This is useful if you are running
with DISABLE_D_OPT set, but macros whitelisting will be
removed in some future Exim release, so it is better
to use TRUSTED_CONFIG_LIST to set the list of trusted
configuration files.
===>  License GPLv2 accepted by the user
===>  Found saved configuration for exim-4.83
===>   exim-4.84_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by exim-4.84_1 for building
===>  Extracting for exim-4.84_1
=> SHA256 Checksum OK for exim/exim-4.84.tar.bz2.
root@black:/usr/ports/mail/exim# cd work/exim-4.84/                  
root@black:/usr/ports/mail/exim/work/exim-4.84# patch -p2 < /root/exim_patches/new_patch-exim-src_spam.c.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/OS/os.h-Linux b/src/OS/os.h-Linux
|index 3fead17..03fea75 100644
|--- a/src/OS/os.h-Linux
|+++ b/src/OS/os.h-Linux
--------------------------
Patching file OS/os.h-Linux using Plan A...
Hunk #1 succeeded at 20.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/expand.c b/src/src/expand.c
|index 1da2225..7da567a 100644
|--- a/src/src/expand.c
|+++ b/src/src/expand.c
--------------------------
Patching file src/expand.c using Plan A...
Hunk #1 succeeded at 641 (offset 23 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/globals.c b/src/src/globals.c
|index 74b6edb..e6f02fb 100644
|--- a/src/src/globals.c
|+++ b/src/src/globals.c
--------------------------
Patching file src/globals.c using Plan A...
Hunk #1 succeeded at 1257 (offset 45 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/globals.h b/src/src/globals.h
|index db436c0..fc4d9f6 100644
|--- a/src/src/globals.h
|+++ b/src/src/globals.h
--------------------------
Patching file src/globals.h using Plan A...
Hunk #1 succeeded at 803 (offset 34 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- a/src/src/spam.c   2014-09-20 14:01:42.000000000 +0300
|+++ b/src/src/spam.c   2014-09-20 14:35:21.000000000 +0300
--------------------------
Patching file src/spam.c using Plan A...
Hunk #1 succeeded at 14.
Hunk #2 succeeded at 39 (offset 2 lines).
Hunk #3 succeeded at 137 (offset 2 lines).
Hunk #4 succeeded at 189 (offset 2 lines).
Hunk #5 succeeded at 226 (offset 2 lines).
Hunk #6 succeeded at 263 (offset 2 lines).
Hunk #7 succeeded at 255 (offset -2 lines).
Hunk #8 succeeded at 412 (offset 4 lines).
Hunk #9 succeeded at 435 (offset -2 lines).
Hunk #10 succeeded at 553 (offset 4 lines).
Hunk #11 succeeded at 572 (offset -2 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/src/src/spam.h b/src/src/spam.h
|index ba700c8..6047c59 100644
|--- a/src/src/spam.h
|+++ b/src/src/spam.h
--------------------------
Patching file src/spam.h using Plan A...
Hunk #1 succeeded at 22.
done
root@black:/usr/ports/mail/exim/work/exim-4.84#

Отработал отлично! Дальше собственно сборка и установка Exim … все как обычно:

root@black:/usr/ports/mail/exim# make configure
===>  Patching for exim-4.84_1
===>  Applying FreeBSD patches for exim-4.84_1
===>   exim-4.84_1 depends on file: /usr/local/lib/libcrypto.so.8 - found
===>   exim-4.84_1 depends on file: /usr/local/bin/iconv - found
===>   exim-4.84_1 depends on file: /usr/local/bin/perl5.16.3 - found
===>   exim-4.84_1 depends on shared library: libspf2.so - found (/usr/local/lib/libspf2.so.2.1.0)
===>   exim-4.84_1 depends on shared library: libpcre.so - found (/usr/local/lib/libpcre.so.3)
===>   exim-4.84_1 depends on shared library: libsrs2.so - found (/usr/local/lib/libsrs2.so.0.0.0)
===>   exim-4.84_1 depends on shared library: libmysqlclient.so.18 - found (/usr/local/lib/mysql/libmysqlclient.so.18)
===>  Configuring for exim-4.84_1

>>> Creating links to source files...
>>> Creating lookups/Makefile for building dynamic modules
>>> New Makefile & lookups/Makefile installed
>>> Use "make makefile" if you need to force rebuilding of the makefile
 
root@black:/usr/ports/mail/exim# make
....
.... Длинный выхлоп сборки ....
....
root@black:/usr/ports/mail/exim# make install
===>  Installing for exim-4.84_1
===>   exim-4.84_1 depends on file: /usr/local/lib/libcrypto.so.8 - found
===>   exim-4.84_1 depends on file: /usr/local/bin/perl5.16.3 - found
===>   exim-4.84_1 depends on shared library: libspf2.so - found (/usr/local/lib/libspf2.so.2.1.0)
===>   exim-4.84_1 depends on shared library: libpcre.so - found (/usr/local/lib/libpcre.so.3)
===>   exim-4.84_1 depends on shared library: libsrs2.so - found (/usr/local/lib/libsrs2.so.0.0.0)
===>   exim-4.84_1 depends on shared library: libmysqlclient.so.18 - found (/usr/local/lib/mysql/libmysqlclient.so.18)
===>  Checking if exim already installed
===>   Registering installation for exim-4.84_1
The following documentation has been installed:

  man exim                              -> Exim options (command line)
  /usr/local/share/doc/exim/spec.txt    -> Exim Specification (User Guide)
  /usr/local/share/doc/exim/filter.txt  -> Exim Filter Specification (for end-users)

Postscript, PDF, HTML and texinfo versions of these documents can be
installed via one of the mail/exim-doc-* ports.

An online version as well as a comprehensive FAQ and a mailing list
archive is available at:

  http://www.exim.org/

Descriptions of new features not available it the manual, and a listing
of all changes, including bug fixes are documented in:

  /usr/local/share/doc/exim/NewStuff
  /usr/local/share/doc/exim/ChangeLog

To use Exim instead of sendmail on startup:

*) Clear the sendmail queue and stop the sendmail daemon.
*) Adjust mailer.conf(5) as appropriate.
*) Set the 'sendmail_enable' rc.conf(5) variable to 'NONE'.
*) Set the 'daily_status_include_submit_mailq' and
   'daily_clean_hoststat_enable' periodic.conf(5)
   variables to 'NO'.
*) Consider setting 'daily_queuerun_enable' and
   'daily_submit_queuerun' to "NO" in periodic.conf(5),
   if you intend to manage queue runners / deliveries closely.
*) Set the 'exim_enable' rc.conf(5) variable to 'YES'.
*) Start exim with '/usr/local/etc/rc.d/exim start'.

You may also want to configure newsyslog(8) to rotate Exim log files:

/var/log/exim/mainlog   mailnull:mail 640 7 * @T00 ZN
/var/log/exim/rejectlog mailnull:mail 640 7 * @T00 ZN

NOTE TO OPERATORS UPGRADING FROM exim-3.xx:

There was a big reworking of the way mail routing works for release
4.00. Previously used "directors" were abolished, and all routing is
now done by routers. Policy controls for incoming mail are now done by
Access Control Lists instead of separate options. All this means that
pre-4.00 configuration files have to be massively converted. If you
are coming from a 3.xx release, please read the document in the file
/usr/local/share/doc/exim/Exim4.upgrade, and allow some time to complete
the upgrade.

Additional scripts to help upgrading are installed in:

  /usr/local/share/examples/exim

===> SECURITY REPORT:
      This port has installed the following binaries which execute with
      increased privileges.
/usr/local/sbin/exim

      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/sbin/exim

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/exim

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.exim.org/
root@black:/usr/ports/mail/exim# make clean
===>  Cleaning for exim-4.84_1
root@black:/usr/ports/mail/exim#

Ну вот и все! Патч применяется, сборка проходит нормально, Exim запускается … короче полная идилия! Сам обновленный патч ТУТ!

Enjoy!

  1. Комментов пока нет

  1. Трэкбэков пока нет.

Why ask?