Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2012 11:50:34 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r308601 - in head/mail/cyrus-imapd24: . files
Message-ID:  <201212101150.qBABoY0g003490@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Mon Dec 10 11:50:33 2012
New Revision: 308601
URL: http://svnweb.freebsd.org/changeset/ports/308601

Log:
  don't segfault on mailbox close with no user.
  
  Obtained from:	http://git.cyrusimap.org/cyrus-imapd/commit/?h=cyrus-imapd-2.4&id=1661683d453ea444aae5832b4a2cb7fd54489672

Added:
  head/mail/cyrus-imapd24/files/patch-imap__statuscache_db.c   (contents, props changed)
Modified:
  head/mail/cyrus-imapd24/Makefile

Modified: head/mail/cyrus-imapd24/Makefile
==============================================================================
--- head/mail/cyrus-imapd24/Makefile	Mon Dec 10 11:25:27 2012	(r308600)
+++ head/mail/cyrus-imapd24/Makefile	Mon Dec 10 11:50:33 2012	(r308601)
@@ -2,7 +2,7 @@
 
 PORTNAME=	cyrus-imapd
 PORTVERSION=	2.4.17
-#PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	mail ipv6
 MASTER_SITES=	ftp://ftp.cyrusimap.org/cyrus-imapd/ \
 		http://cyrusimap.org/releases/

Added: head/mail/cyrus-imapd24/files/patch-imap__statuscache_db.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/cyrus-imapd24/files/patch-imap__statuscache_db.c	Mon Dec 10 11:50:33 2012	(r308601)
@@ -0,0 +1,31 @@
+Index: imap/statuscache_db.c
+diff -u -p imap/statuscache_db.c.orig imap/statuscache_db.c
+--- imap/statuscache_db.c.orig	2012-12-02 04:57:54.000000000 +0900
++++ imap/statuscache_db.c	2012-12-10 13:17:11.621360294 +0900
+@@ -150,9 +150,11 @@ static char *statuscache_buildkey(const 
+ 
+     /* Build statuscache key */
+     len = strlcpy(key, mailboxname, sizeof(key));
++    /* double % is a safe separator, it can't exist in a mailboxname */
+     key[len++] = '%';
+     key[len++] = '%';
+-    len += strlcpy(key + len, userid, sizeof(key) - len);
++    if (userid)
++	len += strlcpy(key + len, userid, sizeof(key) - len);
+ 
+     *keylen = len;
+ 
+@@ -410,11 +412,9 @@ int statuscache_invalidate(const char *m
+     drock.db = statuscachedb;
+     drock.tid = NULL;
+ 
+-    key = statuscache_buildkey(mboxname, "", &keylen);
++    key = statuscache_buildkey(mboxname, /*userid*/NULL, &keylen);
+ 
+-    /* strip off the second NULL that buildkey added, so we match 
+-     * the entires for all users */
+-    r = DB->foreach(drock.db, key, keylen - 1, NULL, delete_cb,
++    r = DB->foreach(drock.db, key, keylen, NULL, delete_cb,
+ 		    &drock, &drock.tid);
+     if (r != CYRUSDB_OK) {
+ 	syslog(LOG_ERR, "DBERROR: error invalidating: %s (%s)",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212101150.qBABoY0g003490>