New version 3.4.3

This commit is contained in:
Martin Osvald 2022-06-09 16:52:51 +02:00
parent 72db4437bd
commit e61c8307b8
8 changed files with 144 additions and 53 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
/cyrus-imapd-3.2.4.tar.gz
/cassandane-8d3fced.tar.gz
/cyrus-imapd-3.2.6.tar.gz
/cyrus-imapd-3.4.3.tar.gz

View File

@ -1,20 +1,12 @@
%define scmt(l:) %(c=%1; echo ${c:0:%{-l:%{-l*}}%{!-l:7}})
# Cassandane commit hash. Cassandane doesn't have releases often, but it
# receives constant development. This was fetched on 20180518.
%global cocas 8d3fced95e77ba2e4d3b9f1f3c75f180d9abe444
%global cocas_short %(echo %{cocas} | cut -c -8)
%global testdata_commit ca669d4b76c71cbeb4fa840e263e2c031e19ea88
%global testdata_short %(echo %{testdata_commit} | cut -c -8)
# Cassandane run by default. '--without cassandane' disables.
%bcond_without cassandane
# Cassandane was split into separate CI test, run '--with cassandane' to enable it.
%bcond_with cassandane
Name: cyrus-imapd
Version: 3.2.6
Release: 10%{?dist}
Version: 3.4.3
Release: 1%{?dist}
%define ssl_pem_file_prefix /etc/pki/%name/%name
@ -45,13 +37,18 @@ Patch1: patch-cyrus-default-configs
# place in the source must be patched to match.
Patch2: patch-cyrus-rename-quota
# Workaround for some compiled Perl modules not being linked against
# libpcreposix, which causes them to fail to load.
# https://bugzilla.redhat.com/show_bug.cgi?id=1668723
# https://github.com/cyrusimap/cyrus-imapd/issues/2629#issuecomment-456925909
Patch4: patch-cyrus-perl-linking
# https://github.com/cyrusimap/cyrus-imapd/issues/4123
Patch5: patch-cyrus-perl-assert
# https://github.com/cyrusimap/cyrus-imapd/pull/3892
Patch6: patch-cyrus-squatter-assert-crash
Source10: cyrus-imapd.logrotate
Source11: cyrus-imapd.pam-config
@ -65,11 +62,10 @@ Source17: cyrus-imapd-init.service
Source18: cyrus-imapd.tmpfiles.conf
# Source files for running the Cassandane test suite at build time.
Source80: https://github.com/cyrusimap/cassandane/archive/%cocas/cassandane-${cocas_short}.tar.gz#/cassandane-%{scmt %cocas}.tar.gz
Source81: https://github.com/brong/Net-CalDAVTalk/archive/%{testdata_commit}/cassandane-testdata-%{testdata_short}.tar.gz
Source80: https://github.com/brong/Net-CalDAVTalk/archive/%{testdata_commit}/cassandane-testdata-%{testdata_short}.tar.gz
# A template config file for cassandane; we will substitute in varions values.
Source82: cassandane.ini
Source81: cassandane.ini
# These are source files and not patches because you can't use autosetup to
# apply patches to secondary unpacked source files.
@ -81,10 +77,15 @@ Source91: patch-cassandane-no-syslog
# Upstream ticket https://github.com/cyrusimap/cyrus-imapd/issues/1995
Source92: patch-cassandane-fix-annotator
Source93: cyrus-imapd-annotator.patch
# TODO libexec/cyrus-imapd path element got into upstream:
# https://github.com/cyrusimap/cyrus-imapd/commit/9233f70bf7a2872ab0b456ea294ce36e0e01e182
# try to get fixed the below upstream to work on Fedora:
# https://github.com/cyrusimap/cyrus-imapd/commit/f10eee167313418d84e63d215310477d4fe68e94
Source93: patch-cassandane-xapian-delve-path
BuildRequires: autoconf automake bison flex gcc gcc-c++ git glibc-langpack-en
BuildRequires: groff libtool pkgconfig rsync systemd transfig
BuildRequires: groff libtool make pkgconfig rsync systemd transfig
BuildRequires: perl-devel perl-generators perl(ExtUtils::MakeMaker)
BuildRequires: perl(Pod::Html)
@ -136,7 +137,7 @@ BuildRequires: perl(XML::Generator) perl(XML::Spice)
BuildRequires: clamav-data perl(Unix::Syslog)
BuildRequires: perl(HTTP::Daemon) perl(DBI) perl(Net::LDAP::Constant)
BuildRequires: perl(Net::LDAP::Server)
BuildRequires: make
BuildRequires: perl(Module::Load::Conditional)
# These were only for JMAP-Tester
# perl(Moo), perl(Moose), perl(MooseX::Role::Parameterized) perl(Throwable), perl(Safe::Isa)
@ -239,18 +240,16 @@ echo %version > VERSION
# Install the Fedora-specific documentation file
install -m 644 %SOURCE15 doc/
# Unpack and prepare cassandane
tar xf %SOURCE80
ln -s cassandane-%cocas cassandane
%if %{with cassandane}
pushd cassandane
mkdir work
tar xf %SOURCE81
tar xf %SOURCE80
patch -p1 < %SOURCE91
patch -p1 < %SOURCE92
patch -p1 < %SOURCE93
cp %SOURCE82 cassandane.ini
cp %SOURCE81 cassandane.ini
# RF rpm-buildroot-usage
sed -i \
-e "s!CASSDIR!$(pwd)!" \
@ -258,6 +257,7 @@ sed -i \
cassandane.ini
popd
%endif
# The pm files have shebang lines for some reason
sed -i -e '1{/usr.bin.perl/d}' perl/annotator/{Message,Daemon}.pm
@ -271,14 +271,29 @@ sed -i -e '1i#!/usr/bin/perl' -e '1d' tools/rehash
# case.
sed -i \
-e '1i#!/usr/bin/perl -w' \
-e '/^#!\/usr\/bin\/perl/d' \
-e '/^exec perl/d' \
-e '/^#!perl -w/d' \
-e '/^#!perl/d' \
-e '/^#!\/bin\/sh/d' \
-e '/^#! \/bin\/sh/d' \
snmp/snmpgen perl/sieve/scripts/installsieve.pl \
perl/sieve/scripts/installsieve.pl \
perl/sieve/scripts/sieveshell.pl perl/imap/cyradm.sh tools/config2header \
tools/masssievec tools/config2rst tools/mknewsgroups tools/config2sample \
tools/mkimap tools/translatesieve
# UPDATE: as of 3.4.2 most of the above files got the shabang fixed. Leaving
# the fixed files and this memo here temporarily:
# cyrus-imapd-*/nmp/snmpgen - no longer exists
# cyrus-imapd-*/perl/sieve/scripts/installsieve.pl - still contains shabang
# cyrus-imapd-*/perl/sieve/scripts/sieveshell.pl - fixed
# cyrus-imapd-*/perl/imap/cyradm.sh - still contains shabang
# cyrus-imapd-*/tools/config2header - fixed
# cyrus-imapd-*/tools/masssievec - fixed
# cyrus-imapd-*/tools/config2rst - fixed
# cyrus-imapd-*/tools/mknewsgroups - fixed
# cyrus-imapd-*/tools/config2sample - fixed
# cyrus-imapd-*/tools/mkimap - fixed
# cyrus-imapd-*/tools/translatesieve - still contains shabang
%build
@ -287,6 +302,7 @@ sed -i \
# because the configure macro puts some hardening flags into the environment.
%if %{with cassandane}
pushd cassandane
export NOCYRUS=1
make
popd
%endif
@ -477,7 +493,10 @@ chmod -x %buildroot/%perl_vendorlib/Cyrus/Annotator/Daemon.pm
export LD_LIBRARY_PATH=%buildroot/%_libdir
export CYRUS_USER=$USER
# TODO: The mime_boundary_extended cunit test fails due to LTO on ppc64le, skip it for now:
%ifnarch ppc64le
make %{?_smp_mflags} check || exit 1
%endif
%ifarch %{ix86} armv7hl
exit 0
@ -511,6 +530,16 @@ tests=(
Rename.intermediate_cleanup
# TODO check this one
Cyrus::List.no_tombstones
# TODO run tests outside the build process:
# https://bugzilla.redhat.com/show_bug.cgi?id=1887674
# The below tests try to search in syslog file which we don't allow due to mock,
# happenes for:
# $ grep -R "assert.*@lines" cyrus-imapd-*/cassandane/
Reconstruct.reconstruct_snoozed
SearchSquat.simple
SearchSquat.skip_unmodified
)
for i in ${tests[@]}; do exclude+=("!$i"); done
@ -528,10 +557,14 @@ exclude+=("!Master.maxforkrate")
%pre
# /bin/sh does not declare it before the first use
PIPESTATUS=( 0 )
# Create 'cyrus' user on target host
getent group saslauth >/dev/null || /usr/sbin/groupadd -g %gid -r saslauth
getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /var/lib/imap -g %cyrusgroup \
-G saslauth -s /sbin/nologin -u %uid -r %cyrususer
-G saslauth -s /sbin/nologin -u %uid -r %cyrususer 2>&1 | grep -v 'outside of the SYS_UID_MIN' | tee
# exit if useradd fails
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi
%post
%systemd_post cyrus-imapd.service
@ -644,6 +677,9 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v
%changelog
* Thu Jun 09 2022 Martin Osvald <mosvald@redhat.com> - 3.4.3-1
- New version 3.4.3
* Wed Jun 01 2022 Jitka Plesnikova <jplesnik@redhat.com> - 3.2.6-10
- Perl 5.36 rebuild

View File

@ -1,30 +1,8 @@
diff --git a/Cassandane/Util/Log.pm b/Cassandane/Util/Log.pm
index 17d2cc7..11b747f 100644
--- a/Cassandane/Util/Log.pm
+++ b/Cassandane/Util/Log.pm
@@ -51,9 +51,6 @@ our @EXPORT = qw(
my $verbose = 0;
-openlog('cassandane', '', LOG_LOCAL6)
- or die "Cannot openlog";
-
sub xlog
{
my $id;
@@ -70,7 +67,6 @@ sub xlog
$msg .= "($id) " if $id;
$msg .= join(' ', @_);
print STDERR "$msg\n";
- syslog(LOG_ERR, "$msg");
}
sub set_verbose
diff --git a/Cassandane/Instance.pm b/Cassandane/Instance.pm
index bdfa44f..e852599 100644
index fb36b8f..78e7100 100644
--- a/Cassandane/Instance.pm
+++ b/Cassandane/Instance.pm
@@ -2030,12 +2030,8 @@ sub setup_syslog_replacement
@@ -2146,12 +2146,8 @@ sub setup_syslog_replacement
{
my ($self) = @_;
@ -39,3 +17,25 @@ index bdfa44f..e852599 100644
$self->{syslog_fname} = "$self->{basedir}/conf/log/syslog";
$self->{have_syslog_replacement} = 1;
diff --git a/Cassandane/Util/Log.pm b/Cassandane/Util/Log.pm
index 7c17f0c..9eb07ad 100644
--- a/Cassandane/Util/Log.pm
+++ b/Cassandane/Util/Log.pm
@@ -51,9 +51,6 @@ our @EXPORT = qw(
my $verbose = 0;
-openlog('cassandane', '', LOG_LOCAL6)
- or die "Cannot openlog";
-
sub xlog
{
my $id;
@@ -74,7 +71,6 @@ sub xlog
$msg .= "($id) " if $id;
$msg .= join(' ', @_);
print STDERR "$msg\n";
- syslog(LOG_ERR, "$msg");
}
sub set_verbose

View File

@ -0,0 +1,15 @@
diff --git a/Cassandane/Instance.pm b/Cassandane/Instance.pm
index 78e7100..edf6f5d 100644
--- a/Cassandane/Instance.pm
+++ b/Cassandane/Instance.pm
@@ -492,9 +492,7 @@ sub _find_binary
my $base = $self->{cyrus_destdir} . $self->{cyrus_prefix};
if ($name eq 'delve') {
- my $lib = `ldd $base/libexec/imapd` || die "can't ldd imapd";
- $lib =~ m{(/\S+)/lib/libxapian-([0-9.]+)\.so};
- return "$1/bin/xapian-delve-$2";
+ return "/bin/xapian-delve";
}
foreach (qw( bin sbin libexec libexec/cyrus-imapd lib cyrus/bin ))

20
patch-cyrus-perl-assert Normal file
View File

@ -0,0 +1,20 @@
diff --git a/lib/assert.h b/lib/assert.h
index d7e2512..ddf316b 100644
--- a/lib/assert.h
+++ b/lib/assert.h
@@ -43,6 +43,8 @@
#ifndef INCLUDED_ASSERT_H
#define INCLUDED_ASSERT_H
+#ifndef PERL_POLLUTE
+
#ifdef __STDC__
#define assert(ex) {if (!(ex))assertionfailed(__FILE__, __LINE__, #ex);}
void assertionfailed(const char *file, int line, const char *expr);
@@ -50,4 +52,6 @@ void assertionfailed(const char *file, int line, const char *expr);
#define assert(ex) {if (!(ex))assertionfailed(__FILE__, __LINE__, (char*)0);}
#endif
+#endif
+
#endif /* INCLUDED_ASSERT_H */

View File

@ -0,0 +1,20 @@
diff --git a/imap/squatter.c b/imap/squatter.c
index 6a7accf1b..0c2de4d7a 100644
--- a/imap/squatter.c
+++ b/imap/squatter.c
@@ -427,8 +427,13 @@ static void expand_mboxnames(strarray_t *sa, int nmboxnames,
else {
/* Translate any separators in mailboxname */
char *intname = mboxname_from_external(mboxnames[i], &squat_namespace, NULL);
- int flags = recursive_flag ? 0 : MBOXTREE_SKIP_CHILDREN;
- mboxlist_mboxtree(intname, addmbox, sa, flags);
+ if (!intname || *intname == '\0') {
+ fprintf(stderr, "Mailbox %s: %s\n",
+ mboxnames[i], error_message(IMAP_MAILBOX_BADNAME));
+ } else {
+ int flags = recursive_flag ? 0 : MBOXTREE_SKIP_CHILDREN;
+ mboxlist_mboxtree(intname, addmbox, sa, flags);
+ }
free(intname);
}

View File

@ -7,7 +7,7 @@ index 46dc358..ca37f22 100644
/* Each test gets a maximum of 20 seconds. */
-#define TEST_TIMEOUT_MS (20*1000)
+#define TEST_TIMEOUT_MS (30*1000)
+#define TEST_TIMEOUT_MS (300*1000)
static jmp_buf jbuf;
static const char *code;

View File

@ -1,3 +1,2 @@
SHA512 (cassandane-8d3fced.tar.gz) = b276a100a32f7348e7a07c30d1d6592ddc189fa0ce4f23d51b2f189da16c1c8e8b7ceab48281e2f284e199346bc6b508366131c285d4caf084b3ce922b2d4787
SHA512 (cyrus-imapd-3.4.3.tar.gz) = 5c4db2a0c26d2323332c1ba67f7b207acfad15f0442f20c6c8a205b5423498465524398315946213c8168bc7eba1fd9f7dc573a91efac6708bfbaf2cb57e9276
SHA512 (cassandane-testdata-ca669d4b.tar.gz) = c153ab0a57d04d9deeabc5ef724eaecc05030c23b170abaa44eaea2e7df409efcdeb24871f7896759e85d64193fb9f289a470b0af9a593a740ffcc45c80033ff
SHA512 (cyrus-imapd-3.2.6.tar.gz) = b9760aac7ce6f39c183204764270867702d59d8f2afc50d4c782b5232c4ea95e79dee608e957098a49bd6473042e0ff0512929a482edd2c63e1f125cc108df36