[packaging] Branch 'el5/feature-kolab-2.4' - cyrus-imapd-2.4.8-0001-seen-fix-seen_db-related-crash.patch cyrus-imapd-2.4.8-0002-seen-and-another-site.patch cyrus-imapd-2.4.8-0003-mboxlist-remove-unused-_std-names.patch cyrus-imapd-2.4.8-0004-Bug-3453-use-direct-access-to-subs-DB.patch cyrus-imapd-2.4.8-0005-Bug-3442-add-disable-pcre-option-to-configure.patch cyrus-imapd-2.4.8-0006-Bug-3443-fix-LSUB-response-where-sub-folders-are-sub.patch cyrus-imapd-2.4.8-0007-Bug-3448-don-t-break-protocol-if-there-s-an-error-du.patch cyrus-imapd-2.4.8-0008-Bug-3437-fix-quotaroot-on-rename.patch cyrus-imapd-2.4.8-0009-list_response-fix-LSUB-where-the-deleted-folder-has-.patch cyrus-imapd-2.4.8-0010-Bug-3456-fix-rename-to-self-without-partition.patch cyrus-imapd-2.4.8-0011-Update-support-url.patch cyrus-imapd.spec

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Sun May 8 18:40:39 CEST 2011


 cyrus-imapd-2.4.8-0001-seen-fix-seen_db-related-crash.patch                       |   39 +
 cyrus-imapd-2.4.8-0002-seen-and-another-site.patch                                |   25 +
 cyrus-imapd-2.4.8-0003-mboxlist-remove-unused-_std-names.patch                    |   38 +
 cyrus-imapd-2.4.8-0004-Bug-3453-use-direct-access-to-subs-DB.patch                |  218 ++++++++++
 cyrus-imapd-2.4.8-0005-Bug-3442-add-disable-pcre-option-to-configure.patch        |   64 ++
 cyrus-imapd-2.4.8-0006-Bug-3443-fix-LSUB-response-where-sub-folders-are-sub.patch |   60 ++
 cyrus-imapd-2.4.8-0007-Bug-3448-don-t-break-protocol-if-there-s-an-error-du.patch |   29 +
 cyrus-imapd-2.4.8-0008-Bug-3437-fix-quotaroot-on-rename.patch                     |   56 ++
 cyrus-imapd-2.4.8-0009-list_response-fix-LSUB-where-the-deleted-folder-has-.patch |   70 +++
 cyrus-imapd-2.4.8-0010-Bug-3456-fix-rename-to-self-without-partition.patch        |   29 +
 cyrus-imapd-2.4.8-0011-Update-support-url.patch                                   |   25 +
 cyrus-imapd.spec                                                                  |   31 +
 12 files changed, 683 insertions(+), 1 deletion(-)

New commits:
commit 7a7a93ffdc083e225759ba547e260f5b997d4593
Author: Jeroen van Meeuwen (Ergo Project) <jeroen.van.meeuwen at ergo-project.org>
Date:   Sun May 8 12:39:21 2011 -0400

    Add in the patches from the cyrus-imapd-2.4 branch post 2.4.8

diff --git a/cyrus-imapd-2.4.8-0001-seen-fix-seen_db-related-crash.patch b/cyrus-imapd-2.4.8-0001-seen-fix-seen_db-related-crash.patch
new file mode 100644
index 0000000..273ae11
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0001-seen-fix-seen_db-related-crash.patch
@@ -0,0 +1,39 @@
+From 1cc3c05701178e4e78b4a0089b17405144cb768e Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Thu, 31 Mar 2011 07:03:10 +0200
+Subject: [PATCH 01/11] seen: fix seen_db related crash
+
+---
+ imap/sync_client.c |    8 ++------
+ 1 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/imap/sync_client.c b/imap/sync_client.c
+index a6ceb5c..7e1fe06 100644
+--- a/imap/sync_client.c
++++ b/imap/sync_client.c
+@@ -1423,7 +1423,7 @@ static int update_seen_work(const char *user, const char *uniqueid,
+ static int do_seen(char *user, char *uniqueid)
+ {
+     int r = 0;
+-    struct seen *seendb;
++    struct seen *seendb = NULL;
+     struct seendata sd;
+ 
+     if (verbose) 
+@@ -1437,12 +1437,8 @@ static int do_seen(char *user, char *uniqueid)
+     if (r) return 0;
+ 
+     r = seen_read(seendb, uniqueid, &sd);
+-    if (r) {
+-	seen_close(&seendb);
+-	return 0;
+-    }
+ 
+-    r = update_seen_work(user, uniqueid, &sd);
++    if (!r) r = update_seen_work(user, uniqueid, &sd);
+ 
+     seen_close(&seendb);
+     seen_freedata(&sd);
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0002-seen-and-another-site.patch b/cyrus-imapd-2.4.8-0002-seen-and-another-site.patch
new file mode 100644
index 0000000..bae8284
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0002-seen-and-another-site.patch
@@ -0,0 +1,25 @@
+From db0ec8825a963a4882cab84c5a7b11be8fb27374 Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Mon, 4 Apr 2011 06:42:42 +0200
+Subject: [PATCH 02/11] seen: and another site!
+
+---
+ imap/sync_client.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/imap/sync_client.c b/imap/sync_client.c
+index 7e1fe06..f0fd98d 100644
+--- a/imap/sync_client.c
++++ b/imap/sync_client.c
+@@ -1872,7 +1872,7 @@ static int do_user_seen(char *user, struct sync_seen_list *replica_seen)
+ {
+     int r;
+     struct sync_seen *mseen, *rseen;
+-    struct seen *seendb;
++    struct seen *seendb = NULL;
+     struct sync_seen_list *list;
+ 
+     /* silently ignore errors */
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0003-mboxlist-remove-unused-_std-names.patch b/cyrus-imapd-2.4.8-0003-mboxlist-remove-unused-_std-names.patch
new file mode 100644
index 0000000..986940d
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0003-mboxlist-remove-unused-_std-names.patch
@@ -0,0 +1,38 @@
+From 176db06f7a5ebf18ed12c12441bc6329d4f80fd5 Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Fri, 22 Apr 2011 00:09:07 +0200
+Subject: [PATCH 03/11] mboxlist: remove unused _std names
+
+---
+ imap/mboxlist.h |    8 --------
+ 1 files changed, 0 insertions(+), 8 deletions(-)
+
+diff --git a/imap/mboxlist.h b/imap/mboxlist.h
+index 60064d3..289cd77 100644
+--- a/imap/mboxlist.h
++++ b/imap/mboxlist.h
+@@ -155,10 +155,6 @@ int mboxlist_sync_setacls(const char *name, const char *acl);
+ int mboxlist_findall(struct namespace *namespace,
+ 		     const char *pattern, int isadmin, const char *userid, 
+ 		     struct auth_state *auth_state, int (*proc)(), void *rock);
+-int mboxlist_findall_std(struct namespace *namespace,
+-			 const char *pattern, int isadmin, const char *userid, 
+-			 struct auth_state *auth_state, int (*proc)(),
+-			 void *rock);
+ int mboxlist_findall_alt(struct namespace *namespace,
+ 			 const char *pattern, int isadmin, const char *userid, 
+ 			 struct auth_state *auth_state, int (*proc)(),
+@@ -169,10 +165,6 @@ int mboxlist_findsub(struct namespace *namespace,
+ 		     const char *pattern, int isadmin, const char *userid, 
+ 		     struct auth_state *auth_state, int (*proc)(), void *rock,
+ 		     int force);
+-int mboxlist_findsub_std(struct namespace *namespace,
+-			 const char *pattern, int isadmin, const char *userid, 
+-			 struct auth_state *auth_state, int (*proc)(),
+-			 void *rock, int force);
+ int mboxlist_findsub_alt(struct namespace *namespace,
+ 			 const char *pattern, int isadmin, char const *userid, 
+ 			 struct auth_state *auth_state, int (*proc)(),
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0004-Bug-3453-use-direct-access-to-subs-DB.patch b/cyrus-imapd-2.4.8-0004-Bug-3453-use-direct-access-to-subs-DB.patch
new file mode 100644
index 0000000..e7dfeb5
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0004-Bug-3453-use-direct-access-to-subs-DB.patch
@@ -0,0 +1,218 @@
+From 39ca72628bef72755c579732ddaf8f4681987960 Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Fri, 22 Apr 2011 00:30:19 +0200
+Subject: [PATCH 04/11] Bug #3453: use direct access to subs DB
+
+This is instead of the super-buggy dance from internal namespace
+to external and then back again which you get using mboxlist_findsub.
+
+Adds a new API "mboxlist_allsubs" which takes a userid.  I'm seriously
+tempted to add the same API for the mailboxes as used by sync_client -u,
+but not just yet.
+---
+ imap/mboxlist.c     |   16 ++++++++++++++++
+ imap/mboxlist.h     |    3 +++
+ imap/sync_client.c  |   21 ++++++---------------
+ imap/sync_server.c  |   31 +++++++------------------------
+ imap/sync_support.c |   10 ++++++----
+ imap/sync_support.h |    4 +++-
+ 6 files changed, 41 insertions(+), 44 deletions(-)
+
+diff --git a/imap/mboxlist.c b/imap/mboxlist.c
+index 34c610e..f6be810 100644
+--- a/imap/mboxlist.c
++++ b/imap/mboxlist.c
+@@ -2687,6 +2687,22 @@ int mboxlist_findsub(struct namespace *namespace __attribute__((unused)),
+     return r;
+ }
+ 
++int mboxlist_allsubs(const char *userid, foreach_cb *proc, void *rock)
++{
++    struct db *subs = NULL;
++    int r;
++
++    /* open subs DB */
++    r = mboxlist_opensubs(userid, &subs);
++    if (r) return r;
++
++    r = SUBDB->foreach(subs, "", 0, NULL, proc, rock, 0);
++
++    mboxlist_closesubs(subs);
++
++    return r;
++}
++
+ int mboxlist_findsub_alt(struct namespace *namespace,
+ 			 const char *pattern, int isadmin __attribute__((unused)),
+ 			 const char *userid, struct auth_state *auth_state, 
+diff --git a/imap/mboxlist.h b/imap/mboxlist.h
+index 289cd77..0e3332d 100644
+--- a/imap/mboxlist.h
++++ b/imap/mboxlist.h
+@@ -160,6 +160,9 @@ int mboxlist_findall_alt(struct namespace *namespace,
+ 			 struct auth_state *auth_state, int (*proc)(),
+ 			 void *rock);
+ 
++/* direct access to subs DB */
++int mboxlist_allsubs(const char *userid, foreach_cb *proc, void *rock);
++
+ /* Find subscribed mailboxes that match 'pattern'. */
+ int mboxlist_findsub(struct namespace *namespace,
+ 		     const char *pattern, int isadmin, const char *userid, 
+diff --git a/imap/sync_client.c b/imap/sync_client.c
+index f0fd98d..147c7a3 100644
+--- a/imap/sync_client.c
++++ b/imap/sync_client.c
+@@ -1816,32 +1816,23 @@ int do_user_main(char *user, struct sync_folder_list *replica_folders,
+ 
+ int do_user_sub(const char *userid, struct sync_name_list *replica_subs)
+ {
+-    char buf[MAX_MAILBOX_BUFFER];
+     struct sync_name_list *master_subs = sync_name_list_create();
+     struct sync_name *msubs, *rsubs;
+-    int r;
++    int r = 0;
+ 
+     /* Includes subsiduary nodes automatically */
+-    r = (sync_namespace.mboxlist_findsub)(&sync_namespace, "*", 1,
+-                                          userid, NULL, addmbox_sub,
+-                                          master_subs, 1);
+-    if (r) {
+-	syslog(LOG_ERR, "IOERROR: %s", error_message(r));
+-	goto bail;
+-    }
++    r = mboxlist_allsubs(userid, addmbox_sub, master_subs);
++    if (r) goto bail;
+ 
+     /* add any folders that need adding, and mark any which
+      * still exist */
+     for (msubs = master_subs->head; msubs; msubs = msubs->next) {
+-	r = (sync_namespace.mboxname_tointernal)(&sync_namespace, msubs->name,
+-						 userid, buf);
+-	if (r) continue; /* just ignore invalid subs */
+-	rsubs = sync_name_lookup(replica_subs, buf);
++	rsubs = sync_name_lookup(replica_subs, msubs->name);
+ 	if (rsubs) {
+ 	    rsubs->mark = 1;
+ 	    continue;
+ 	}
+-	r = set_sub(userid, buf, 1);
++	r = set_sub(userid, msubs->name, 1);
+ 	if (r) goto bail;
+     }
+ 
+@@ -1855,7 +1846,7 @@ int do_user_sub(const char *userid, struct sync_name_list *replica_subs)
+ 
+  bail:
+     sync_name_list_free(&master_subs);
+-    return(r);
++    return r;
+ }
+ 
+ static int get_seen(const char *uniqueid, struct seendata *sd, void *rock)
+diff --git a/imap/sync_server.c b/imap/sync_server.c
+index dcd3422..1473484 100644
+--- a/imap/sync_server.c
++++ b/imap/sync_server.c
+@@ -1545,25 +1545,15 @@ static int user_seen(const char *userid)
+ 
+ static int user_sub(const char *userid)
+ {
+-    char buf[MAX_MAILBOX_BUFFER];
+-    struct sync_name_list *list = NULL;
++    struct sync_name_list *list = sync_name_list_create();
+     struct sync_name *item;
+     struct dlist *kl;
+-    int r;
+-
+-    list = sync_name_list_create();
+ 
+-    ((*sync_namespacep).mboxlist_findsub)(sync_namespacep, "*",
+-					  sync_userisadmin,
+-					  (char *)userid, sync_authstate,
+-					  addmbox_sub, list, 1);
++    mboxlist_allsubs(userid, addmbox_sub, list);
+ 
+     kl = dlist_list(NULL, "LSUB");
+     for (item = list->head; item; item = item->next) {
+-	r = (sync_namespacep->mboxname_tointernal)(sync_namespacep, item->name,
+-						   userid, buf);
+-        if (r) continue;
+-	dlist_atom(kl, "MBOXNAME", buf);
++	dlist_atom(kl, "MBOXNAME", item->name);
+     }
+     if (kl->head)
+ 	sync_send_response(kl, sync_out);
+@@ -1866,25 +1856,18 @@ static int do_seen(struct dlist *kin)
+ 
+ static int do_unuser(struct dlist *kin)
+ {
+-    struct sync_name_list *list = NULL;
++    struct sync_name_list *list = sync_name_list_create();
+     struct sync_name *item;
+-    char buf[MAX_MAILBOX_BUFFER];
+     const char *userid = kin->sval;
++    char buf[MAX_MAILBOX_NAME];
+     int r = 0;
+ 
+     /* Nuke subscriptions */
+-    list = sync_name_list_create();
+-    r = (sync_namespacep->mboxlist_findsub)(sync_namespacep, "*",
+-					    sync_userisadmin,
+-                                            (char *)userid, sync_authstate,
+-					    addmbox_sub, (void *)list, 1);
+-    if (r) goto fail;
++    mboxlist_allsubs(userid, addmbox_sub, list);
+ 
+     /* ignore failures here - the subs file gets deleted soon anyway */
+     for (item = list->head; item; item = item->next) {
+-	r = (sync_namespacep->mboxname_tointernal)(sync_namespacep, item->name,
+-						   userid, buf);
+-        if (!r) r = mboxlist_changesub(buf, userid, sync_authstate, 0, 0);
++        mboxlist_changesub(item->name, userid, sync_authstate, 0, 0);
+     }
+     sync_name_list_free(&list);
+ 
+diff --git a/imap/sync_support.c b/imap/sync_support.c
+index 3c348fc..e4ea5db 100644
+--- a/imap/sync_support.c
++++ b/imap/sync_support.c
+@@ -1279,14 +1279,16 @@ int addmbox(char *name,
+     return 0;
+ }
+ 
+-int addmbox_sub(char *name,
+-		int matchlen __attribute__((unused)),
+-		int maycreate __attribute__((unused)),
+-		void *rock)
++int addmbox_sub(void *rock, const char *key, int keylen,
++		const char *data __attribute__((unused)),
++		int datalen __attribute__((unused)))
+ {
+     struct sync_name_list *list = (struct sync_name_list *) rock;
+ 
++    /* XXX - double malloc because of list_add, clean up later */
++    char *name = xstrndup(key, keylen);
+     sync_name_list_add(list, name);
++    free(name);
+ 
+     return 0;
+ }
+diff --git a/imap/sync_support.h b/imap/sync_support.h
+index ac2e8dc..879c2d0 100644
+--- a/imap/sync_support.h
++++ b/imap/sync_support.h
+@@ -386,7 +386,9 @@ struct dlist *sync_parseline(struct protstream *in);
+ /* ====================================================================== */
+ 
+ int addmbox(char *name, int matchlen, int maycreate, void *rock);
+-int addmbox_sub(char *name, int matchlen, int maycreate, void *rock);
++int addmbox_sub(void *rockp, const char *key, int keylen,
++		const char *data __attribute__((unused)),
++		int datalen __attribute__((unused)));
+ 
+ int sync_mailbox(struct mailbox *mailbox,
+ 		 struct sync_folder *remote,
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0005-Bug-3442-add-disable-pcre-option-to-configure.patch b/cyrus-imapd-2.4.8-0005-Bug-3442-add-disable-pcre-option-to-configure.patch
new file mode 100644
index 0000000..77a8327
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0005-Bug-3442-add-disable-pcre-option-to-configure.patch
@@ -0,0 +1,64 @@
+From e3a7b5f1eb752244c85051552eed3d60dd04317b Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Fri, 22 Apr 2011 21:58:18 +0200
+Subject: [PATCH 05/11] Bug #3442 - add "--disable-pcre" option to configure
+
+Better would be actually testing the functionality we need, and
+refusing to use pcre unless that functionality works, but I don't
+really know autoconf well enough to write this, so I'm avoiding
+it for now.  At lesat we have something we can point to :)
+---
+ configure.in |   26 ++++++++++++++++++--------
+ 1 files changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index c449073..e7e424a 100644
+--- a/configure.in
++++ b/configure.in
+@@ -377,7 +377,14 @@ sievedir="sieve"
+ AC_ARG_ENABLE(sieve,
+         [  --disable-sieve         disable Sieve support],
+ 	if test "$enableval" = no; then
+- 		sievedir="no"
++		sievedir="no"
++	fi)
++
++testpcre="yes"
++AC_ARG_ENABLE(pcre,
++		[  --disable-pcre      disable PCRE library],
++	if test "$enableval" = no; then
++		testpcre="no"
+ 	fi)
+ 
+ if test "$sievedir" != "no"; then
+@@ -394,17 +401,20 @@ if test "$sievedir" != "no"; then
+ 	AC_PROG_LEX
+ 	AC_CHECK_LIB(fl,main)
+ 
+-	AC_CHECK_HEADER(pcreposix.h)
+-	if test "$ac_cv_header_pcreposix_h" == "yes"; then
+-		AC_MSG_CHECKING(for utf8 enabled pcre)
+-		AC_CACHE_VAL(cyrus_cv_pcre_utf8, AC_TRY_CPP([#include <pcreposix.h>
++	if test "$testpcre" != "no"; then
++	    AC_CHECK_HEADER(pcreposix.h)
++	    if test "$ac_cv_header_pcreposix_h" == "yes"; then
++		    AC_MSG_CHECKING(for utf8 enabled pcre)
++		    AC_CACHE_VAL(cyrus_cv_pcre_utf8, AC_TRY_CPP([#include <pcreposix.h>
+ #ifndef REG_UTF8
+ #include </nonexistent>
+ #endif],cyrus_cv_pcre_utf8=yes,cyrus_cv_pcre_utf8=no))
+-		AC_MSG_RESULT($cyrus_cv_pcre_utf8)
+-	else
+-		cyrus_cv_pcre_utf8="no"
++		    AC_MSG_RESULT($cyrus_cv_pcre_utf8)
++	    else
++		    cyrus_cv_pcre_utf8="no"
++	    fi
+ 	fi
++
+ 	if test "$cyrus_cv_pcre_utf8" == "yes"; then
+ 		LIBS="$LIBS -lpcre -lpcreposix";
+ 		AC_DEFINE(ENABLE_REGEX, [], [Do we have a regex library?])
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0006-Bug-3443-fix-LSUB-response-where-sub-folders-are-sub.patch b/cyrus-imapd-2.4.8-0006-Bug-3443-fix-LSUB-response-where-sub-folders-are-sub.patch
new file mode 100644
index 0000000..534dd56
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0006-Bug-3443-fix-LSUB-response-where-sub-folders-are-sub.patch
@@ -0,0 +1,60 @@
+From b0a8f49f48023dc60d93e132910bae33926b3e86 Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Fri, 22 Apr 2011 23:53:26 +0200
+Subject: [PATCH 06/11] Bug #3443 - fix LSUB response where sub folders are
+ subscribed
+
+---
+ imap/imapd.c |   29 +++++++++++++++++------------
+ 1 files changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/imap/imapd.c b/imap/imapd.c
+index 29cd44c..26ae6dc 100644
+--- a/imap/imapd.c
++++ b/imap/imapd.c
+@@ -9910,7 +9910,7 @@ static void list_response(char *name, int attributes,
+ 	/* \Noselect has a special second meaning with (R)LSUB */
+ 	if ( !(attributes & MBOX_ATTRIBUTE_SUBSCRIBED)
+ 	     && attributes & MBOX_ATTRIBUTE_CHILDINFO_SUBSCRIBED)
+-	    attributes |= MBOX_ATTRIBUTE_NOSELECT;
++	    attributes |= MBOX_ATTRIBUTE_NOSELECT | MBOX_ATTRIBUTE_HASCHILDREN;
+ 	attributes &= ~MBOX_ATTRIBUTE_SUBSCRIBED;
+     }
+ 
+@@ -9925,17 +9925,22 @@ static void list_response(char *name, int attributes,
+     }
+ 
+     if (attributes & (MBOX_ATTRIBUTE_NONEXISTENT | MBOX_ATTRIBUTE_NOSELECT)) {
+-	/* if mupdate isn't configured we can drop out now, otherwise
+-	 * we might be a backend and need to report folders that don't
+-	 * exist on this backend - this is awful and complex and brittle
+-	 * and should be changed, but we're stuck with it for now */
+-	if (listargs->cmd & LIST_CMD_LSUB) {
+-	    if (!config_mupdate_server) return;
+-	}
+-	else {
+-	    if (!(attributes & MBOX_ATTRIBUTE_HASCHILDREN))
+-		return;
+-	}
++	int keep = 0;
++	/* we have to mention this, it has children */
++	if (attributes & MBOX_ATTRIBUTE_HASCHILDREN)
++	    keep = 1;
++	else if (listargs->cmd & LIST_CMD_LSUB) {
++	    /* subscribed children need a mention */
++	    if (attributes & MBOX_ATTRIBUTE_CHILDINFO_SUBSCRIBED)
++		keep = 1;
++	    /* if mupdate is configured we can't drop out, we might
++	     * be a backend and need to report folders that don't
++	     * exist on this backend - this is awful and complex
++	     * and brittle and should be changed */
++	    if (config_mupdate_server)
++		keep = 1;
++	}
++	if (!keep) return;
+     }
+ 
+     switch (listargs->cmd) {
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0007-Bug-3448-don-t-break-protocol-if-there-s-an-error-du.patch b/cyrus-imapd-2.4.8-0007-Bug-3448-don-t-break-protocol-if-there-s-an-error-du.patch
new file mode 100644
index 0000000..77b8cb8
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0007-Bug-3448-don-t-break-protocol-if-there-s-an-error-du.patch
@@ -0,0 +1,29 @@
+From a15da390af7235b0c057d2fa3607b49a6592c3ce Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Sat, 23 Apr 2011 00:09:21 +0200
+Subject: [PATCH 07/11] Bug #3448 - don't break protocol if there's an error
+ during XFER
+
+---
+ imap/mbdump.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/imap/mbdump.c b/imap/mbdump.c
+index 1aa6956..131f535 100644
+--- a/imap/mbdump.c
++++ b/imap/mbdump.c
+@@ -646,9 +646,10 @@ int dump_mailbox(const char *tag, struct mailbox *mailbox, uint32_t uid_start,
+ 	    
+     } /* end if user INBOX */
+ 
++ done:
++
+     prot_printf(pout,")\r\n");
+ 
+- done:
+     prot_flush(pout);
+ 
+     if (mbdir) closedir(mbdir);
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0008-Bug-3437-fix-quotaroot-on-rename.patch b/cyrus-imapd-2.4.8-0008-Bug-3437-fix-quotaroot-on-rename.patch
new file mode 100644
index 0000000..34f254d
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0008-Bug-3437-fix-quotaroot-on-rename.patch
@@ -0,0 +1,56 @@
+From cb52baa651fc0f18a19190908eaca8a89c036219 Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Tue, 26 Apr 2011 16:22:21 +0200
+Subject: [PATCH 08/11] Bug #3437 - fix quotaroot on rename
+
+---
+ imap/mailbox.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/imap/mailbox.c b/imap/mailbox.c
+index 8fb7a70..79cec32 100644
+--- a/imap/mailbox.c
++++ b/imap/mailbox.c
+@@ -3062,6 +3062,7 @@ int mailbox_rename_copy(struct mailbox *oldmailbox,
+ {
+     int r;
+     struct mailbox *newmailbox = NULL;
++    char *newquotaroot = NULL;
+ 
+     assert(mailbox_index_islocked(oldmailbox, 1));
+ 
+@@ -3091,6 +3092,7 @@ int mailbox_rename_copy(struct mailbox *oldmailbox,
+ 	if (r && r != IMAP_QUOTAROOT_NONEXISTENT)
+ 	    goto fail;
+     }
++    if (newmailbox->quotaroot) newquotaroot = xstrdup(newmailbox->quotaroot);
+ 
+     r = mailbox_copy_files(oldmailbox, newpartition, newname);
+     if (r) goto fail;
+@@ -3117,6 +3119,7 @@ int mailbox_rename_copy(struct mailbox *oldmailbox,
+     if (r) goto fail;
+ 
+     /* mark the "used" back to zero, so it updates the new quota! */
++    mailbox_set_quotaroot(newmailbox, newquotaroot);
+     mailbox_quota_dirty(newmailbox);
+     newmailbox->quota_previously_used = 0;
+ 
+@@ -3132,6 +3135,7 @@ int mailbox_rename_copy(struct mailbox *oldmailbox,
+ 
+     if (newmailboxptr) *newmailboxptr = newmailbox;
+     else mailbox_close(&newmailbox);
++    free(newquotaroot);
+ 
+     return 0;
+ 
+@@ -3140,6 +3144,7 @@ fail:
+     /* XXX - per file paths, need to clean up individual filenames */
+     mailbox_delete_cleanup(newmailbox->part, newmailbox->name);
+     mailbox_close(&newmailbox);
++    free(newquotaroot);
+ 
+     return r;
+ }
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0009-list_response-fix-LSUB-where-the-deleted-folder-has-.patch b/cyrus-imapd-2.4.8-0009-list_response-fix-LSUB-where-the-deleted-folder-has-.patch
new file mode 100644
index 0000000..b78cd6f
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0009-list_response-fix-LSUB-where-the-deleted-folder-has-.patch
@@ -0,0 +1,70 @@
+From cf2facd349fd2f2619dbbabb29b1f5471536f0a6 Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Thu, 28 Apr 2011 12:15:09 +0200
+Subject: [PATCH 09/11] list_response: fix LSUB where the deleted folder has
+ children
+
+---
+ imap/imapd.c |   39 ++++++++++++++++++++-------------------
+ 1 files changed, 20 insertions(+), 19 deletions(-)
+
+diff --git a/imap/imapd.c b/imap/imapd.c
+index 26ae6dc..89a8dc6 100644
+--- a/imap/imapd.c
++++ b/imap/imapd.c
+@@ -9906,6 +9906,26 @@ static void list_response(char *name, int attributes,
+ 	    attributes |= MBOX_ATTRIBUTE_HASNOCHILDREN;
+     }
+ 
++    if (attributes & (MBOX_ATTRIBUTE_NONEXISTENT | MBOX_ATTRIBUTE_NOSELECT)) {
++	int keep = 0;
++	/* we have to mention this, it has children */
++	if (listargs->cmd & LIST_CMD_LSUB) {
++	    /* subscribed children need a mention */
++	    if (attributes & MBOX_ATTRIBUTE_CHILDINFO_SUBSCRIBED)
++		keep = 1;
++	    /* if mupdate is configured we can't drop out, we might
++	     * be a backend and need to report folders that don't
++	     * exist on this backend - this is awful and complex
++	     * and brittle and should be changed */
++	    if (config_mupdate_server)
++		keep = 1;
++	}
++	else if (attributes & MBOX_ATTRIBUTE_HASCHILDREN)
++	    keep = 1;
++
++	if (!keep) return;
++    }
++
+     if (listargs->cmd & LIST_CMD_LSUB) {
+ 	/* \Noselect has a special second meaning with (R)LSUB */
+ 	if ( !(attributes & MBOX_ATTRIBUTE_SUBSCRIBED)
+@@ -9924,25 +9944,6 @@ static void list_response(char *name, int attributes,
+ 	    attributes &= ~MBOX_ATTRIBUTE_NOSELECT;
+     }
+ 
+-    if (attributes & (MBOX_ATTRIBUTE_NONEXISTENT | MBOX_ATTRIBUTE_NOSELECT)) {
+-	int keep = 0;
+-	/* we have to mention this, it has children */
+-	if (attributes & MBOX_ATTRIBUTE_HASCHILDREN)
+-	    keep = 1;
+-	else if (listargs->cmd & LIST_CMD_LSUB) {
+-	    /* subscribed children need a mention */
+-	    if (attributes & MBOX_ATTRIBUTE_CHILDINFO_SUBSCRIBED)
+-		keep = 1;
+-	    /* if mupdate is configured we can't drop out, we might
+-	     * be a backend and need to report folders that don't
+-	     * exist on this backend - this is awful and complex
+-	     * and brittle and should be changed */
+-	    if (config_mupdate_server)
+-		keep = 1;
+-	}
+-	if (!keep) return;
+-    }
+-
+     switch (listargs->cmd) {
+     case LIST_CMD_LSUB:
+ 	cmd = "LSUB";
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0010-Bug-3456-fix-rename-to-self-without-partition.patch b/cyrus-imapd-2.4.8-0010-Bug-3456-fix-rename-to-self-without-partition.patch
new file mode 100644
index 0000000..9afcc26
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0010-Bug-3456-fix-rename-to-self-without-partition.patch
@@ -0,0 +1,29 @@
+From 275ab3ecad0225ffa36fa9a466e43f48da074b25 Mon Sep 17 00:00:00 2001
+From: Bron Gondwana <brong at opera.com>
+Date: Tue, 3 May 2011 13:31:12 +0200
+Subject: [PATCH 10/11] Bug #3456 - fix rename to self without partition
+
+---
+ imap/mboxlist.c |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/imap/mboxlist.c b/imap/mboxlist.c
+index f6be810..78317c9 100644
+--- a/imap/mboxlist.c
++++ b/imap/mboxlist.c
+@@ -1012,6 +1012,12 @@ int mboxlist_renamemailbox(const char *oldname, const char *newname,
+ 	    goto done;
+ 	}
+ 
++	/* No partition, we're definitely not moving anywhere */
++	if (!partition) {
++	    r = IMAP_MAILBOX_EXISTS;
++	    goto done;
++	}
++
+ 	partitionmove = 1;
+ 	/* this is OK because it uses a different static buffer */
+ 	root = config_partitiondir(partition);
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd-2.4.8-0011-Update-support-url.patch b/cyrus-imapd-2.4.8-0011-Update-support-url.patch
new file mode 100644
index 0000000..6835ff7
--- /dev/null
+++ b/cyrus-imapd-2.4.8-0011-Update-support-url.patch
@@ -0,0 +1,25 @@
+From b236f35553db4e2e7a447468b491065ee1eb3b5e Mon Sep 17 00:00:00 2001
+From: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
+Date: Sat, 7 May 2011 16:38:09 -0400
+Subject: [PATCH 11/11] Update support-url
+
+---
+ imap/version.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/imap/version.c b/imap/version.c
+index 203fda5..7e83401 100644
+--- a/imap/version.c
++++ b/imap/version.c
+@@ -117,7 +117,7 @@ void id_response(struct protstream *pout)
+ 		"\"name\" \"Cyrus IMAPD\""
+ 		" \"version\" \"%s %s\""
+ 		" \"vendor\" \"Project Cyrus\""
+-		" \"support-url\" \"http://cyrusimap.web.cmu.edu\"",
++		" \"support-url\" \"http://www.cyrusimap.org\"",
+ 		CYRUS_VERSION, CYRUS_GITVERSION);
+ 
+     /* add the os info */
+-- 
+1.7.4.4
+
diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec
index b2a4384..06d058a 100644
--- a/cyrus-imapd.spec
+++ b/cyrus-imapd.spec
@@ -14,7 +14,7 @@
 Name:               cyrus-imapd
 Summary:            A high-performance mail server with IMAP, POP3, NNTP and SIEVE support
 Version:            2.4.8
-Release:            2%{?dist}
+Release:            3%{?dist}
 License:            BSD
 Group:              System Environment/Daemons
 URL:                http://www.cyrusimap.org
@@ -60,6 +60,19 @@ Patch002:           %{name}-2.3.16-002-strip-out-krb4.patch
 # https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=3184
 #Patch004:           %{name}-2.3.16-004-qosmarking-rfc4594.patch
 
+# From 2.4 stable, post .8 release
+Patch005:           cyrus-imapd-2.4.8-0001-seen-fix-seen_db-related-crash.patch
+Patch006:           cyrus-imapd-2.4.8-0002-seen-and-another-site.patch
+Patch007:           cyrus-imapd-2.4.8-0003-mboxlist-remove-unused-_std-names.patch
+Patch008:           cyrus-imapd-2.4.8-0004-Bug-3453-use-direct-access-to-subs-DB.patch
+Patch009:           cyrus-imapd-2.4.8-0005-Bug-3442-add-disable-pcre-option-to-configure.patch
+Patch010:           cyrus-imapd-2.4.8-0006-Bug-3443-fix-LSUB-response-where-sub-folders-are-sub.patch
+Patch011:           cyrus-imapd-2.4.8-0007-Bug-3448-don-t-break-protocol-if-there-s-an-error-du.patch
+Patch012:           cyrus-imapd-2.4.8-0008-Bug-3437-fix-quotaroot-on-rename.patch
+Patch013:           cyrus-imapd-2.4.8-0009-list_response-fix-LSUB-where-the-deleted-folder-has-.patch
+Patch014:           cyrus-imapd-2.4.8-0010-Bug-3456-fix-rename-to-self-without-partition.patch
+Patch015:           cyrus-imapd-2.4.8-0011-Update-support-url.patch
+
 # Generally accepted patches
 #Patch101:           %{name}-2.3.16-101-autocreate-0.10.0.patch
 #Patch102:           %{name}-2.3.16-102-autosieve-0.6.0.patch
@@ -169,6 +182,19 @@ one running the server.
 %prep
 %setup -q -n %{_name}-%{version}
 %patch002 -p1
+
+%patch005 -p1
+%patch006 -p1
+%patch007 -p1
+%patch008 -p1
+%patch009 -p1
+%patch010 -p1
+%patch011 -p1
+%patch012 -p1
+%patch013 -p1
+%patch014 -p1
+%patch015 -p1
+
 %patch903 -p1
 
 # add additional sources
@@ -540,6 +566,9 @@ fi
 %{_mandir}/man1/*
 
 %changelog
+* Sun May 08 2011 Jeroen van Meeuwen <vanmeeuwen at kolabsys.com> - 2.4.8-3
+- Add in the post 2.4.8 patches from the cyrus-imapd-2.4 branch
+
 * Sun May 01 2011 Jeroen van Meeuwen <vanmeeuwen at kolabsys.com> - 2.4.8-2
 - Add QUICK setting to sysconfig and make init.d honor it
 - Fix pam to include system-auth rather then password-auth




More information about the packaging-commits mailing list