Initial work for 3.0.6.

I'm committing the initial work to get 3.0.6 built.  Note that this will
build, but one cassandane test will fail.  I'm tracking that down now
but I may have to disable that test until the issue is understood.
O# Please enter the commit message for your changes. Lines starting
This commit is contained in:
Jason Tibbitts 2018-04-30 12:37:09 -05:00
parent 5afdd3d3b2
commit 2bab9a965e
6 changed files with 8 additions and 397 deletions

View File

@ -1,240 +0,0 @@
From 1966c22fc4249a1157a4d4c1224138ce78653514 Mon Sep 17 00:00:00 2001
From: Ken Murchison <murch@andrew.cmu.edu>
Date: Sat, 21 Oct 2017 19:04:08 -0400
Subject: [PATCH] Account for the removal of icaltimetype.is_utc field in
upcoming libical
---
configure.ac | 5 +++++
imap/http_caldav.c | 2 +-
imap/http_caldav_sched.c | 4 ++--
imap/http_tzdist.c | 22 +++++++++++-----------
imap/ical_support.c | 9 +++++++++
imap/ical_support.h | 2 ++
imap/jmap_ical.c | 4 ++--
imap/xcal.c | 4 ++--
8 files changed, 34 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
index b7f2d0da9..8eb11966d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1492,6 +1492,11 @@ dnl
icalrecur_freq_to_string, icalrecur_weekday_to_string],
[], [], [[#include <libical/ical.h>]])
+ AC_CHECK_MEMBER(icaltimetype.is_utc,
+ AC_DEFINE(ICALTIME_HAS_IS_UTC,[],
+ [Does icaltimetype have is_utc field?]),
+ [], [#include <libical/ical.h>])
+
AC_CHECK_LIB(ical, icalproperty_new_acknowledged,
AC_DEFINE(HAVE_VALARM_EXT_PROPS,[],
[Do we have built-in support for VALARM extensions props?]))
diff --git a/imap/http_caldav.c b/imap/http_caldav.c
index eb9d4add1..4cb11d228 100644
--- a/imap/http_caldav.c
+++ b/imap/http_caldav.c
@@ -2391,7 +2391,7 @@ static struct icaltimetype icaltime_from_rfc3339_string(const char *str)
goto fail;
}
- tt.is_utc = 1;
+ icaltime_set_utc(&tt, 1);
return tt;
fail:
diff --git a/imap/http_caldav_sched.c b/imap/http_caldav_sched.c
index 1dc97a501..b896d871a 100644
--- a/imap/http_caldav_sched.c
+++ b/imap/http_caldav_sched.c
@@ -355,7 +355,7 @@ static int imip_send_sendmail(icalcomponent *ical,
cp += sprintf(cp, "%s, %02u %s %04u",
day_of_week[icaltime_day_of_week(start)-1],
start.day, month_of_year[start.month-1], start.year);
- if (!start.is_date) {
+ if (!icaltime_is_date(start)) {
cp += sprintf(cp, " %02u:%02u", start.hour, start.minute);
if (start.second) cp += sprintf(cp, ":%02u", start.second);
strcpy(cp, " UTC");
@@ -370,7 +370,7 @@ static int imip_send_sendmail(icalcomponent *ical,
day_of_week[icaltime_day_of_week(end)-1],
end.day, month_of_year[end.month-1], end.year);
}
- if (!end.is_date) {
+ if (!icaltime_is_date(end)) {
cp += sprintf(cp, " %02u:%02u", end.hour, end.minute);
if (end.second) cp += sprintf(cp, ":%02u", end.second);
strcpy(cp, " UTC");
diff --git a/imap/http_tzdist.c b/imap/http_tzdist.c
index 258440ce9..a88e8bf68 100644
--- a/imap/http_tzdist.c
+++ b/imap/http_tzdist.c
@@ -1376,7 +1376,7 @@ static void truncate_vtimezone(icalcomponent *vtz,
/* Adjust DTSTART observance to UTC */
icaltime_adjust(&obs.onset, 0, 0, 0, -obs.offset_from);
- obs.onset.is_utc = 1;
+ icaltime_set_utc(&obs.onset, 1);
/* Check DTSTART vs window close */
if (!icaltime_is_null_time(end) &&
@@ -1451,7 +1451,7 @@ static void truncate_vtimezone(icalcomponent *vtz,
if (!eternal) {
/* Adjust UNTIL to local time (for iterator) */
icaltime_adjust(&rrule.until, 0, 0, 0, obs.offset_from);
- rrule.until.is_utc = 0;
+ icaltime_set_utc(&rrule.until, 0);
}
if (trunc_dtstart) {
@@ -1475,7 +1475,7 @@ static void truncate_vtimezone(icalcomponent *vtz,
/* Adjust observance to UTC */
icaltime_adjust(&obs.onset, 0, 0, 0, -obs.offset_from);
- obs.onset.is_utc = 1;
+ icaltime_set_utc(&obs.onset, 1);
if (trunc_until && icaltime_compare(obs.onset, end) >= 0) {
/* Observance is on/after window close */
@@ -1580,7 +1580,7 @@ static void truncate_vtimezone(icalcomponent *vtz,
/* Adjust observance to UTC */
icaltime_adjust(&obs.onset, 0, 0, 0, -obs.offset_from);
- obs.onset.is_utc = 1;
+ icaltime_set_utc(&obs.onset, 1);
if (!icaltime_is_null_time(end) &&
icaltime_compare(obs.onset, end) >= 0) {
@@ -1691,7 +1691,7 @@ static void truncate_vtimezone(icalcomponent *vtz,
case ICAL_DTSTART_PROPERTY:
/* Adjust window open to local time */
icaltime_adjust(&start, 0, 0, 0, tombstone.offset_from);
- start.is_utc = 0;
+ icaltime_set_utc(&start, 0);
icalproperty_set_dtstart(prop, start);
break;
@@ -1775,14 +1775,14 @@ static int action_get(struct transaction_t *txn)
/* Sanity check the parameters */
if ((param = hash_lookup("start", &txn->req_qparams))) {
start = icaltime_from_string(param->s);
- if (param->next || !start.is_utc) { /* once only, UTC */
+ if (param->next || !icaltime_is_utc(start)) { /* once only, UTC */
return json_error_response(txn, TZ_INVALID_START, param, &start);
}
}
if ((param = hash_lookup("end", &txn->req_qparams))) {
end = icaltime_from_string(param->s);
- if (param->next || !end.is_utc /* once only, UTC */
+ if (param->next || !icaltime_is_utc(end) /* once only, UTC */
|| icaltime_compare(end, start) <= 0) { /* end MUST be > start */
return json_error_response(txn, TZ_INVALID_END, param, &end);
}
@@ -1956,7 +1956,7 @@ static int action_expand(struct transaction_t *txn)
return json_error_response(txn, TZ_INVALID_START, param, NULL);
start = icaltime_from_string(param->s);
- if (!start.is_utc) /* MUST be UTC */
+ if (!icaltime_is_utc(start)) /* MUST be UTC */
return json_error_response(txn, TZ_INVALID_START, param, &start);
param = hash_lookup("end", &txn->req_qparams);
@@ -1964,7 +1964,7 @@ static int action_expand(struct transaction_t *txn)
return json_error_response(txn, TZ_INVALID_END, param, NULL);
end = icaltime_from_string(param->s);
- if (!end.is_utc /* MUST be UTC */
+ if (!icaltime_is_utc(end) /* MUST be UTC */
|| icaltime_compare(end, start) <= 0) { /* end MUST be > start */
return json_error_response(txn, TZ_INVALID_END, param, &end);
}
@@ -2237,7 +2237,7 @@ static int json_error_response(struct transaction_t *txn, long tz_code,
else if (param->next) fmt = "Multiple %s parameters";
else if (!param->s || !param->s[0]) fmt = "Missing %s value";
else if (!time) fmt = "Invalid %s value";
- else if (!time->is_utc) fmt = "Invalid %s UTC value";
+ else if (!icaltime_is_utc(*time)) fmt = "Invalid %s UTC value";
else fmt = "End date-time <= start date-time";
assert(!buf_len(&txn->buf));
@@ -2500,7 +2500,7 @@ static struct buf *_icaltimezone_as_tzfile(icalcomponent* ical,
for (n = 0; n < obsarray->num_elements; n++) {
long long int t;
unsigned typeidx;
- icaltimetype tt_1601 = { 1601, 1, 1, 0, 0, 0, 1, 0, 0, NULL };
+ icaltimetype tt_1601 = icaltime_from_string("1601-01-01T00:00:00Z");
obs = icalarray_element_at(obsarray, n);
t = icaltime_to_gmtime64(obs->onset);
diff --git a/imap/ical_support.c b/imap/ical_support.c
index 3deb649b1..13861b25a 100644
--- a/imap/ical_support.c
+++ b/imap/ical_support.c
@@ -833,6 +833,15 @@ icalrecurrenceset_get_utc_timespan(icalcomponent *ical,
return span;
}
+EXPORTED void icaltime_set_utc(struct icaltimetype *t, int set)
+{
+#ifdef ICALTIME_HAS_IS_UTC
+ t->is_utc = set;
+#else
+ icaltime_set_timezone(t, set ? icaltimezone_get_utc_timezone() : NULL);
+#endif
+}
+
#ifndef HAVE_TZDIST_PROPS
diff --git a/imap/ical_support.h b/imap/ical_support.h
index 8db35ed1f..0336d59e1 100644
--- a/imap/ical_support.h
+++ b/imap/ical_support.h
@@ -100,6 +100,8 @@ extern struct icalperiodtype icalrecurrenceset_get_utc_timespan(icalcomponent *i
void*),
void *cb_rock);
+extern void icaltime_set_utc(struct icaltimetype *t, int set);
+
/* Functions not declared in in libical < v2.0 */
diff --git a/imap/jmap_ical.c b/imap/jmap_ical.c
index c0d4910f5..dd8460f36 100644
--- a/imap/jmap_ical.c
+++ b/imap/jmap_ical.c
@@ -737,7 +737,7 @@ static const char *tzid_from_icalprop(icalproperty *prop, int guess) {
} else {
icalvalue *val = icalproperty_get_value(prop);
icaltimetype dt = icalvalue_get_datetime(val);
- if (icaltime_is_valid_time(dt) && dt.is_utc) {
+ if (icaltime_is_valid_time(dt) && icaltime_is_utc(dt)) {
tzid = "Etc/UTC";
}
}
@@ -2615,7 +2615,7 @@ static icalproperty *dtprop_to_ical(icalcomponent *comp,
/* Set the new property. */
prop = icalproperty_new(kind);
icalproperty_set_value(prop, val);
- if (tz && !dt.is_utc) {
+ if (tz && !icaltime_is_utc(dt)) {
icalparameter *param = icalproperty_get_first_parameter(prop, ICAL_TZID_PARAMETER);
const char *tzid = icaltimezone_get_location(tz);
if (param) {
diff --git a/imap/xcal.c b/imap/xcal.c
index 27a32d96b..36129fdcc 100644
--- a/imap/xcal.c
+++ b/imap/xcal.c
@@ -115,8 +115,8 @@ const char *icaltime_as_iso_string(const struct icaltimetype tt)
static char str[21];
const char *fmt;
- if (tt.is_date) fmt = "%04d-%02d-%02d";
- else if (tt.is_utc) fmt = "%04d-%02d-%02dT%02d:%02d:%02dZ";
+ if (icaltime_is_date(tt)) fmt = "%04d-%02d-%02d";
+ else if (icaltime_is_utc(tt)) fmt = "%04d-%02d-%02dT%02d:%02d:%02dZ";
else fmt = "%04d-%02d-%02dT%02d:%02d:%02d";
snprintf(str, sizeof(str), fmt, tt.year, tt.month, tt.day,

View File

@ -1,23 +0,0 @@
From 24af24aa77144e0c1ab976657833b470502be7a8 Mon Sep 17 00:00:00 2001
From: Robert Stepanek <rsto@fastmail.com>
Date: Mon, 26 Feb 2018 22:00:34 +0100
Subject: [PATCH] xapian_wrap.cpp: change set_stem_version signature to return
void
---
imap/xapian_wrap.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/imap/xapian_wrap.cpp b/imap/xapian_wrap.cpp
index 0afb73674..ce07cdcf6 100644
--- a/imap/xapian_wrap.cpp
+++ b/imap/xapian_wrap.cpp
@@ -259,7 +259,7 @@ static int stem_version_get(Xapian::Database *database)
return version;
}
-static int stem_version_set(Xapian::WritableDatabase *database, int version)
+static void stem_version_set(Xapian::WritableDatabase *database, int version)
{
std::ostringstream convert;
convert << version;

View File

@ -1,29 +0,0 @@
From 7214a7e3a60c628575a73dab0437e065b9e9a32a Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Tue, 27 Feb 2018 09:48:13 +0100
Subject: [PATCH] Check if mechlist buffer is not empty
Check if mechlist is null is redundant because it's initialized in
ask_capabilities flow. As the result some capabilities may be lost and
reported as not advertised
Keeping (now reduntant) null check to avoid regressions in the future
This is regression in 9fd201ba2b4ab58eda3372fb6765e1d5d8f027b4
Bug-Url: https://bugzilla.redhat.com/1543481
---
imtest/imtest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/imtest/imtest.c b/imtest/imtest.c
index 716e2b252..85f4cc5ce 100644
--- a/imtest/imtest.c
+++ b/imtest/imtest.c
@@ -3084,7 +3084,7 @@ int main(int argc, char **argv)
/* try to get the capabilities from the banner */
mechlist = ask_capability(protocol, servername,
&capabilities, AUTO_BANNER);
- if (!mechlist && !(capabilities & CAPA_STARTTLS)) {
+ if ((!mechlist || !buf_len(mechlist)) && !(capabilities & CAPA_STARTTLS)) {
/* found no capabilities in banner -> get them explicitly */
protocol->banner.is_capa = 0;
}

View File

@ -1,40 +0,0 @@
From 73af8e19546f235f6286cc9147a3ea74bde19ebb Mon Sep 17 00:00:00 2001
From: Ken Murchison <murch@fastmail.com>
Date: Mon, 5 Mar 2018 15:46:01 -0500
Subject: [PATCH] lmtp_sieve.c: sieve scripts are stores WITHOUT '.' -> '^'
translation
---
imap/lmtp_sieve.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/imap/lmtp_sieve.c b/imap/lmtp_sieve.c
index f09ddcefa..af1b3feb8 100644
--- a/imap/lmtp_sieve.c
+++ b/imap/lmtp_sieve.c
@@ -1586,13 +1586,6 @@ sieve_interp_t *setup_sieve(struct sieve_interp_ctx *ctx)
return interp;
}
-static void _rm_dots(char *p)
-{
- for (; *p; p++) {
- if (*p == '.') *p = '^';
- }
-}
-
static int sieve_find_script(const char *user, const char *domain,
const char *script, char *fname, size_t size)
{
@@ -1629,10 +1622,7 @@ static int sieve_find_script(const char *user, const char *domain,
}
else {
char hash = (char) dir_hash_c(user, config_fulldirhash);
- char *usercopy = xstrdup(user); // stupid hashing of names, we SHOULD just allow dots on disk
- _rm_dots(usercopy);
- len += snprintf(fname+len, size-len, "/%c/%s/", hash, usercopy);
- free(usercopy);
+ len += snprintf(fname+len, size-len, "/%c/%s/", hash, user);
if (!script) { /* default script */
char *bc_fname;

View File

@ -1,43 +0,0 @@
From 79244173353d95149ad1944f61cc6bd2e43bd7d4 Mon Sep 17 00:00:00 2001
From: ellie timoney <ellie@fastmail.com>
Date: Tue, 20 Feb 2018 13:17:39 +1100
Subject: [PATCH] master: reject unix domain listen paths that are too long
Fixes #2253
---
master/master.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/master/master.c b/master/master.c
index 325afd42f..a28731fd0 100644
--- a/master/master.c
+++ b/master/master.c
@@ -496,6 +496,12 @@ static void service_create(struct service *s)
EX_SOFTWARE);
if (s->listen[0] == '/') { /* unix socket */
+ if (strlen(s->listen) >= sizeof(sunsock.sun_path)) {
+ syslog(LOG_ERR, "invalid listen '%s' (too long), disabling %s",
+ s->listen, s->name);
+ service_forget_exec(s);
+ return;
+ }
res0_is_local = 1;
res0 = (struct addrinfo *)xzmalloc(sizeof(struct addrinfo));
res0->ai_flags = AI_PASSIVE;
@@ -513,7 +519,14 @@ static void service_create(struct service *s)
sunsock.sun_len = res0->ai_addrlen;
#endif
sunsock.sun_family = AF_UNIX;
- strcpy(sunsock.sun_path, s->listen);
+
+ int r = snprintf(sunsock.sun_path, sizeof(sunsock.sun_path), "%s", s->listen);
+ if (r < 0 || (size_t) r >= sizeof(sunsock.sun_path)) {
+ /* belt and suspenders */
+ fatal("Serious software bug found: "
+ "over-long listen path not detected earlier!",
+ EX_SOFTWARE);
+ }
unlink(s->listen);
} else { /* inet socket */
char *port;

View File

@ -10,8 +10,8 @@
%bcond_without cassandane
Name: cyrus-imapd
Version: 3.0.5
Release: 15%{?dist}
Version: 3.0.6
Release: 1%{?dist}
%define ssl_pem_file /etc/pki/%name/%name.pem
@ -35,28 +35,10 @@ Patch0: patch-cyrus-testsuite-timeout
Patch1: patch-cyrus-managesieve-linking
# Fedora-specific patch for the default configuration file
Patch3: patch-cyrus-default-configs
# Upstream commit which adds libical3 support, picked back from the devel
# branch
Patch4: https://github.com/cyrusimap/cyrus-imapd/commit/1966c22fc4249a1157a4d4c1224138ce78653514.patch
# gcc8 detects a strcpy overflow in master.
Patch5: https://github.com/elliefm/cyrus-imapd/commit/79244173353d95149ad1944f61cc6bd2e43bd7d4.patch
# Fix squatter segfaults seen on rawhide.
Patch6: https://github.com/cyrusimap/cyrus-imapd/commit/24af24aa77144e0c1ab976657833b470502be7a8.patch
# Fix imtest -m gssapi on some servers.
# https://bugzilla.redhat.com/show_bug.cgi?id=1543481
# https://github.com/cyrusimap/cyrus-imapd/pull/2268
Patch7: https://github.com/cyrusimap/cyrus-imapd/commit/7214a7e3a60c628575a73dab0437e065b9e9a32a.patch
Patch2: patch-cyrus-default-configs
# vzic uses an old makefile that needs hacks to use the proper flags
Patch8: patch-vzic-proper-cflags
# Fix issue with seive scripts for usernames containing dots
Patch9: https://github.com/cyrusimap/cyrus-imapd/commit/73af8e19546f235f6286cc9147a3ea74bde19ebb.patch
Patch3: patch-vzic-proper-cflags
Source10: cyrus-imapd.logrotate
Source11: cyrus-imapd.pam-config
@ -631,6 +613,10 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v
%changelog
* Mon Apr 30 2018 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.6-1
- Update to 3.0.6.
- Remove upstreamed patches and renumber the rest.
* Mon Apr 30 2018 Pete Walter <pwalter@fedoraproject.org> - 3.0.5-15
- Rebuild for ICU 61.1