diff --git a/dovecot23.changes b/dovecot23.changes index 8e87a6a..4d2eea4 100644 --- a/dovecot23.changes +++ b/dovecot23.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Feb 4 07:06:00 UTC 2021 - Arjen de Korte + +- add BuildRequires openssl-devel >= 1.0.1 +- add fix-timeval_cmp_margin-for-32bit-systems.patch + Fix timeval_cmp_margin for 32-bit systems + + https://github.com/dovecot/core/pull/149 + ------------------------------------------------------------------- Mon Jan 4 12:16:00 UTC 2021 - Arjen de Korte diff --git a/dovecot23.spec b/dovecot23.spec index 60d2342..2cba14d 100644 --- a/dovecot23.spec +++ b/dovecot23.spec @@ -82,6 +82,7 @@ BuildRequires: libmysqlclient-devel BuildRequires: mysql-devel %endif BuildRequires: openldap2-devel +BuildRequires: openssl-devel >= 1.0.1 BuildRequires: pam-devel BuildRequires: pkgconfig BuildRequires: postgresql-devel @@ -149,6 +150,8 @@ Patch: dovecot-2.3.0-dont_use_etc_ssl_certs.patch Patch1: dovecot-2.3.0-better_ssl_defaults.patch # https://github.com/dovecot/core/pull/126 Patch2: allow-tls1.3-only.patch +# https://github.com/dovecot/core/pull/149 +Patch3: fix-timeval_cmp_margin-for-32bit-systems.patch Summary: IMAP and POP3 Server Written Primarily with Security in Mind License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT Group: Productivity/Networking/Email/Servers @@ -329,6 +332,7 @@ dovecot tree. %patch -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 gzip -9v ChangeLog # Fix plugins dir. sed -i 's|#mail_plugin_dir = /usr/lib/dovecot|mail_plugin_dir = %{_libdir}/dovecot/modules|' doc/example-config/conf.d/10-mail.conf diff --git a/fix-timeval_cmp_margin-for-32bit-systems.patch b/fix-timeval_cmp_margin-for-32bit-systems.patch new file mode 100644 index 0000000..c91273c --- /dev/null +++ b/fix-timeval_cmp_margin-for-32bit-systems.patch @@ -0,0 +1,49 @@ +From 2cc1feca9087651902a5ea3cda021c8a0b3217ce Mon Sep 17 00:00:00 2001 +From: Paul Howarth +Date: Mon, 4 Jan 2021 16:31:03 +0000 +Subject: [PATCH] lib: Fix timeval_cmp_margin for 32-bit systems + +The test suite compares times with seconds values of -INT_MAX and +INT_MAX. The result of this comparison does not fit in a value of +type int and so the test suite fails on 32-bit systems where time_t +is an int. To fix this, calculations on seconds values are done +using long long integers. + +Broken by 16ab5542 +--- + src/lib/time-util.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/src/lib/time-util.c b/src/lib/time-util.c +index 294bb02310..3f4cd01c9e 100644 +--- a/src/lib/time-util.c ++++ b/src/lib/time-util.c +@@ -38,21 +38,23 @@ int timeval_cmp(const struct timeval *tv1, const struct timeval *tv2) + int timeval_cmp_margin(const struct timeval *tv1, const struct timeval *tv2, + unsigned int usec_margin) + { +- long long usecs_diff; ++ long long secs_diff, usecs_diff; + int sec_margin, ret; + + if (tv1->tv_sec < tv2->tv_sec) { + sec_margin = ((int)usec_margin / 1000000) + 1; +- if ((tv2->tv_sec - tv1->tv_sec) > sec_margin) ++ secs_diff = (long long)tv2->tv_sec - (long long)tv1->tv_sec; ++ if (secs_diff > sec_margin) + return -1; +- usecs_diff = (tv2->tv_sec - tv1->tv_sec) * 1000000LL + ++ usecs_diff = secs_diff * 1000000LL + + (tv2->tv_usec - tv1->tv_usec); + ret = -1; + } else if (tv1->tv_sec > tv2->tv_sec) { + sec_margin = ((int)usec_margin / 1000000) + 1; +- if ((tv1->tv_sec - tv2->tv_sec) > sec_margin) ++ secs_diff = (long long)tv1->tv_sec - (long long)tv2->tv_sec; ++ if (secs_diff > sec_margin) + return 1; +- usecs_diff = (tv1->tv_sec - tv2->tv_sec) * 1000000LL + ++ usecs_diff = secs_diff * 1000000LL + + (tv1->tv_usec - tv2->tv_usec); + ret = 1; + } else if (tv1->tv_usec < tv2->tv_usec) {