Accepting request 869119 from home:adkorte:branches:server:mail

- 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

OBS-URL: https://build.opensuse.org/request/show/869119
OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot23?expand=0&rev=90
This commit is contained in:
Christian Wittmer 2021-02-05 09:43:05 +00:00 committed by Git OBS Bridge
parent 3d5eb41351
commit 83e56214df
3 changed files with 62 additions and 0 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Feb 4 07:06:00 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- 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 <suse+build@de-korte.org> Mon Jan 4 12:16:00 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>

View File

@ -82,6 +82,7 @@ BuildRequires: libmysqlclient-devel
BuildRequires: mysql-devel BuildRequires: mysql-devel
%endif %endif
BuildRequires: openldap2-devel BuildRequires: openldap2-devel
BuildRequires: openssl-devel >= 1.0.1
BuildRequires: pam-devel BuildRequires: pam-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: postgresql-devel 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 Patch1: dovecot-2.3.0-better_ssl_defaults.patch
# https://github.com/dovecot/core/pull/126 # https://github.com/dovecot/core/pull/126
Patch2: allow-tls1.3-only.patch 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 Summary: IMAP and POP3 Server Written Primarily with Security in Mind
License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT
Group: Productivity/Networking/Email/Servers Group: Productivity/Networking/Email/Servers
@ -329,6 +332,7 @@ dovecot tree.
%patch -p1 %patch -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
gzip -9v ChangeLog gzip -9v ChangeLog
# Fix plugins dir. # 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 sed -i 's|#mail_plugin_dir = /usr/lib/dovecot|mail_plugin_dir = %{_libdir}/dovecot/modules|' doc/example-config/conf.d/10-mail.conf

View File

@ -0,0 +1,49 @@
From 2cc1feca9087651902a5ea3cda021c8a0b3217ce Mon Sep 17 00:00:00 2001
From: Paul Howarth <paul@city-fan.org>
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) {