Projects
Kolab:3.4
cyrus-imapd
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 117
View file
cyrus-imapd.spec
Changed
@@ -38,13 +38,13 @@ Name: cyrus-imapd Summary: A high-performance mail server with IMAP, POP3, NNTP and SIEVE support Version: 2.5 -Release: 0.2.dev20141112.git58e1f4b2%{?dist} +Release: 0.2.dev20141112.git7361099c%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.cyrusimap.org # Upstream sources -# From 58e1f4b277586e448f726bdafe6f2e250c9ea5f4 +# From 7361099c548f11f5dff5d65583ba39f150e46938 Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus/%{_name}-%{real_version}%{?dot_snapshot_version}.tar.gz Source1: cyrus-imapd.imap-2.3.x-conf Source2: cyrus-imapd.cvt_cyrusdb_all @@ -68,6 +68,7 @@ ## Patch0001: cyrus-imapd-2.5-ctl_mboxlist-mbtype.patch +Patch0002: cyrus-imapd-2.5-default-skiplist.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -259,6 +260,7 @@ %setup -q -n %{_name}-%{real_version}%{?dot_snapshot_version} %patch0001 -p1 +%patch0002 -p1 %if 0%{?with_bdb} < 1 sed -i -e 's/,berkeley//g' cunit/db.testc
View file
cyrus-imapd-2.5-default-skiplist.patch
Added
@@ -0,0 +1,89 @@ +diff --git a/lib/imapoptions b/lib/imapoptions +index fedc695..597e1c4 100644 +--- a/lib/imapoptions ++++ b/lib/imapoptions +@@ -169,7 +169,7 @@ are listed with ``<none>''. + affect LMTP delivery of messages directly to mailboxes via + plus-addressing. */ + +-{ "annotation_db", "twoskip", STRINGLIST("berkeley", "berkeley-hash", "skiplist", "twoskip")} ++{ "annotation_db", "skiplist", STRINGLIST("berkeley", "berkeley-hash", "skiplist", "twoskip")} + /* The cyrusdb backend to use for mailbox annotations. */ + + { "annotation_db_path", NULL, STRING } +@@ -508,7 +508,7 @@ Blank lines and lines beginning with ``#'' are ignored. + specifies the actual key used for iSchedule DKIM signing within the + domain. */ + +-{ "duplicate_db", "twoskip", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql", "twoskip")} ++{ "duplicate_db", "skiplist", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql", "twoskip")} + /* The cyrusdb backend to use for the duplicate delivery suppression + and sieve. */ + +@@ -1013,10 +1013,10 @@ Blank lines and lines beginning with ``#'' are ignored. + { "maxword", 131072, INT } + /* Maximum size of a single word for the parser. Default 128k */ + +-{ "mboxkey_db", "twoskip", STRINGLIST("berkeley", "skiplist", "twoskip") } ++{ "mboxkey_db", "skiplist", STRINGLIST("berkeley", "skiplist", "twoskip") } + /* The cyrusdb backend to use for mailbox keys. */ + +-{ "mboxlist_db", "twoskip", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "sql", "twoskip")} ++{ "mboxlist_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "sql", "twoskip")} + /* The cyrusdb backend to use for the mailbox list. */ + + { "mboxlist_db_path", NULL, STRING } +@@ -1376,7 +1376,7 @@ If all partitions are over that limit, this feature is not used anymore. + /* Unix domain socket that ptloader listens on. + (defaults to configdir/ptclient/ptsock) */ + +-{ "ptscache_db", "twoskip", STRINGLIST("berkeley", "berkeley-hash", "skiplist", "twoskip")} ++{ "ptscache_db", "skiplist", STRINGLIST("berkeley", "berkeley-hash", "skiplist", "twoskip")} + /* The cyrusdb backend to use for the pts cache. */ + + { "ptscache_db_path", NULL, STRING } +@@ -1401,7 +1401,7 @@ If all partitions are over that limit, this feature is not used anymore. + /* This specifies the Class Selector or Differentiated Services Code Point + designation on IP headers (in the ToS field). */ + +-{ "quota_db", "twoskip", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "sql", "quotalegacy", "twoskip")} ++{ "quota_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "sql", "quotalegacy", "twoskip")} + /* The cyrusdb backend to use for quotas. */ + + { "quota_db_path", NULL, STRING } +@@ -1521,7 +1521,7 @@ If all partitions are over that limit, this feature is not used anymore. + recommended for most cases - it's a good compromise which + keeps words separate. */ + +-{ "seenstate_db", "twoskip", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "twoskip")} ++{ "seenstate_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "twoskip")} + /* The cyrusdb backend to use for the seen state. */ + + { "sendmail", "/usr/lib/sendmail", STRING } +@@ -1715,7 +1715,7 @@ product version in the capabilities */ + { "statuscache", 0, SWITCH } + /* Enable/disable the imap status cache. */ + +-{ "statuscache_db", "twoskip", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql", "twoskip") } ++{ "statuscache_db", "skiplist", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql", "twoskip") } + /* The cyrusdb backend to use for the imap status cache. */ + + { "statuscache_db_path", NULL, STRING } +@@ -1880,7 +1880,7 @@ product version in the capabilities */ + /* File containing the private key belonging to the certificate in + tls_server_cert. */ + +-{ "tls_sessions_db", "twoskip", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql", "twoskip")} ++{ "tls_sessions_db", "skiplist", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql", "twoskip")} + /* The cyrusdb backend to use for the TLS cache. */ + + { "tls_sessions_db_path", NULL, STRING } +@@ -1944,7 +1944,7 @@ product version in the capabilities */ + this user. NOTE: This must be an existing local user name with an + INBOX, NOT an email address! */ + +-{ "zoneinfo_db", "twoskip", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "twoskip")} ++{ "zoneinfo_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "twoskip")} + /* The cyrusdb backend to use for zoneinfo. */ + + { "zoneinfo_db_path", NULL, STRING }
View file
cyrus-imapd-2.5.tar.gz/lib/cyrusdb_skiplist.c
Changed
@@ -399,7 +399,7 @@ case ADD: level = LEVEL_safe(db, ptr); if (!level) { - syslog(LOG_ERR, "IOERROR: skiplist2 RECSIZE_safe not safe %s, offset %u", + syslog(LOG_ERR, "IOERROR: skiplist RECSIZE not safe %s, offset %u", db->fname, (unsigned)(ptr - db->map_base)); return 0; } @@ -413,50 +413,20 @@ break; case DELETE: + if (!is_safe(db, ptr+8)) { + syslog(LOG_ERR, "IOERROR: skiplist RECSIZE not safe %s, offset %u", + db->fname, (unsigned)(ptr - db->map_base)); + return 0; + } ret += 8; break; case COMMIT: - ret += 4; - break; - } - - return ret; -} - -/* how many levels does this record have? */ -static unsigned LEVEL(const char *ptr) -{ - const uint32_t *p, *q; - - assert(TYPE(ptr) == DUMMY || TYPE(ptr) == INORDER || TYPE(ptr) == ADD); - p = q = (uint32_t *) FIRSTPTR(ptr); - while (*p != (uint32_t)-1) p++; - return (p - q); -} - -/* how big is this record? */ -static unsigned RECSIZE(const char *ptr) -{ - int ret = 0; - switch (TYPE(ptr)) { - case DUMMY: - case INORDER: - case ADD: - ret += 4; /* tag */ - ret += 4; /* keylen */ - ret += ROUNDUP(KEYLEN(ptr)); /* key */ - ret += 4; /* datalen */ - ret += ROUNDUP(DATALEN(ptr)); /* data */ - ret += 4 * LEVEL(ptr); /* pointers */ - ret += 4; /* padding */ - break; - - case DELETE: - ret += 8; - break; - - case COMMIT: + if (!is_safe(db, ptr+4)) { + syslog(LOG_ERR, "IOERROR: skiplist RECSIZE not safe %s, offset %u", + db->fname, (unsigned)(ptr - db->map_base)); + return 0; + } ret += 4; break; } @@ -524,7 +494,12 @@ } -#define PADDING(ptr) (ntohl(*((uint32_t *)((ptr) + RECSIZE(ptr) - 4)))) +static unsigned PADDING_safe(struct dbengine *db, const char *ptr) +{ + unsigned size = RECSIZE_safe(db, ptr); + if (!size) return 0; + return ntohl(*((uint32_t *)((ptr) + size - 4))); +} /* given an open, mapped db, read in the header information */ static int read_header(struct dbengine *db) @@ -595,9 +570,9 @@ db->fname); r = CYRUSDB_IOERROR; } - if (!r && LEVEL(dptr) != db->maxlevel) { + if (!r && LEVEL_safe(db, dptr) != db->maxlevel) { syslog(LOG_ERR, "DBERROR: %s: DUMMY level(%d) != db->maxlevel(%d)", - db->fname, LEVEL(dptr), db->maxlevel); + db->fname, LEVEL_safe(db, dptr), db->maxlevel); r = CYRUSDB_IOERROR; } @@ -1306,7 +1281,7 @@ return CYRUSDB_EXISTS; } else { /* replace with an equal height node */ - lvl = LEVEL(ptr); + lvl = LEVEL_safe(db, ptr); /* log a removal */ WRITEV_ADD_TO_IOVEC(iov, num_iov, (char *) &delrectype, 4); @@ -1600,8 +1575,8 @@ /* find the last log entry */ for (offset = tid->logstart, ptr = db->map_base + offset; - offset + RECSIZE(ptr) != (uint32_t) tid->logend; - offset += RECSIZE(ptr), ptr = db->map_base + offset) ; + offset + RECSIZE_safe(db, ptr) != (uint32_t) tid->logend; + offset += RECSIZE_safe(db, ptr), ptr = db->map_base + offset) ; offset = ptr - db->map_base; @@ -1638,7 +1613,7 @@ /* re-add this record. it can't exist right now. */ netnewoffset = *((uint32_t *)(ptr + 4)); q = db->map_base + ntohl(netnewoffset); - lvl = LEVEL(q); + lvl = LEVEL_safe(db, q); (void) find_node(db, KEY(q), KEYLEN(q), updateoffsets); for (i = 0; i < lvl; i++) { /* the current pointers FROM this node are correct, @@ -1653,7 +1628,7 @@ } /* remove looking at this */ - tid->logend -= RECSIZE(ptr); + tid->logend -= RECSIZE_safe(db, ptr); } /* truncate the file to remove log entries */ @@ -1767,13 +1742,13 @@ uint32_t netnewoffset; ptr = db->map_base + offset; - lvl = LEVEL(ptr); + lvl = LEVEL_safe(db, ptr); db->listsize++; num_iov = 0; WRITEV_ADD_TO_IOVEC(iov, num_iov, (char *) &iorectype, 4); /* copy all but the rectype from the record */ - WRITEV_ADD_TO_IOVEC(iov, num_iov, (char *) ptr + 4, RECSIZE(ptr) - 4); + WRITEV_ADD_TO_IOVEC(iov, num_iov, (char *) ptr + 4, RECSIZE_safe(db, ptr) - 4); newoffset = lseek(db->fd, 0, SEEK_END); netnewoffset = htonl(newoffset); @@ -1940,9 +1915,9 @@ case INORDER: case ADD: printf("kl=%d dl=%d lvl=%d\n", - KEYLEN(ptr), DATALEN(ptr), LEVEL(ptr)); + KEYLEN(ptr), DATALEN(ptr), LEVEL_safe(db, ptr)); printf("\t"); - for (i = 0; i < LEVEL(ptr); i++) { + for (i = 0; i < LEVEL_safe(db, ptr); i++) { printf("%04X ", FORWARD(ptr, i)); } printf("\n"); @@ -1957,7 +1932,7 @@ break; } - ptr += RECSIZE(ptr); + ptr += RECSIZE_safe(db, ptr); } unlock(db); @@ -1986,7 +1961,7 @@ ptr = db->map_base + offset; - for (i = 0; i < LEVEL(ptr); i++) { + for (i = 0; i < LEVEL_safe(db, ptr); i++) { offset = FORWARD(ptr, i); if (offset > db->map_size) { @@ -2030,9 +2005,11 @@ static int recovery(struct dbengine *db, int flags) { const char *ptr, *keyptr; + unsigned filesize = db->map_size; unsigned updateoffsets[SKIPLIST_MAXLEVEL+1]; uint32_t offset, offsetnet, myoff = 0; - int r = 0, need_checkpoint = 0; + int r = 0; + int need_checkpoint = libcyrus_config_getswitch(CYRUSOPT_SKIPLIST_ALWAYS_CHECKPOINT); time_t start = time(NULL); unsigned i; @@ -2086,11 +2063,11 @@ } /* pointers for db->maxlevel */ - if (!r && LEVEL(ptr) != db->maxlevel) { + if (!r && LEVEL_safe(db, ptr) != db->maxlevel) { r = CYRUSDB_IOERROR;
View file
cyrus-imapd-2.5.tar.gz/lib/imapoptions
Changed
@@ -1944,7 +1944,7 @@ this user. NOTE: This must be an existing local user name with an INBOX, NOT an email address! */ -{ "zoneinfo_db", "skiplist", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist")} +{ "zoneinfo_db", "twoskip", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "twoskip")} /* The cyrusdb backend to use for zoneinfo. */ { "zoneinfo_db_path", NULL, STRING }
View file
cyrus-imapd.dsc
Changed
@@ -2,7 +2,7 @@ Source: cyrus-imapd Binary: cyrus-imapd Architecture: any -Version: 2.5~dev2014111201-0~kolab1 +Version: 2.5~dev2014111202-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.cyrusimap.org/
View file
debian.changelog
Changed
@@ -1,3 +1,10 @@ +cyrus-imapd (2.5~dev2014111201-0~kolab2) unstable; urgency=low + + * Set the default database format to skiplist + * New snapshot at 7361099c548f11f5dff5d65583ba39f150e46938 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Thu, 12 Nov 2014 11:30:13 +0100 + cyrus-imapd (2.5~dev2014111201-0~kolab1) unstable; urgency=low * Ship a GIT development snapshot from git.cyrusimap.org
View file
debian.series
Changed
@@ -1,2 +1,3 @@ cyrus-imapd-2.5-ctl_mboxlist-mbtype.patch -p1 cyrus-imapd-2.5-openssl-stack.patch -p1 +cyrus-imapd-2.5-default-skiplist.patch -p1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.