Compare commits
No commits in common. 'c9' and 'c10-beta' have entirely different histories.
@ -1,4 +1,2 @@
|
||||
616efd5bc85d00486a80c78a4d6cc12ebe07565f SOURCES/cassandane-693da61.tar.gz
|
||||
fd08427d105d2306e95528eff407ab1723b31c69 SOURCES/cassandane-testdata-ca669d4b.tar.gz
|
||||
8edfa3bca1f914ca30856e6f73d07e4de66173ed SOURCES/cyrus-imapd-3.4.1.tar.gz
|
||||
7eefe4d240d7033b1f460f85038f6607154e58f4 SOURCES/cyrus-manpages-3.2.6.tar.gz
|
||||
710d7c1c942240018d0f3693dbfec0a8299a0a5b SOURCES/cyrus-imapd-3.8.3.tar.gz
|
||||
2cb01af57f5e1e2df8fd91aab28e94e7b566194b SOURCES/cyrus-imapd-3.8.3.tar.gz.sig
|
||||
|
@ -1,4 +1,2 @@
|
||||
SOURCES/cassandane-693da61.tar.gz
|
||||
SOURCES/cassandane-testdata-ca669d4b.tar.gz
|
||||
SOURCES/cyrus-imapd-3.4.1.tar.gz
|
||||
SOURCES/cyrus-manpages-3.2.6.tar.gz
|
||||
SOURCES/cyrus-imapd-3.8.3.tar.gz
|
||||
SOURCES/cyrus-imapd-3.8.3.tar.gz.sig
|
||||
|
@ -1,170 +0,0 @@
|
||||
diff --git a/imap/http_dav.c b/imap/http_dav.c
|
||||
index d5f7c114a2..abc6da42ca 100644
|
||||
--- a/imap/http_dav.c
|
||||
+++ b/imap/http_dav.c
|
||||
@@ -6108,7 +6108,7 @@ EXPORTED int meth_propfind(struct transaction_t *txn, void *params)
|
||||
xmlDocPtr indoc = NULL, outdoc = NULL;
|
||||
xmlNodePtr root, cur = NULL, props = NULL;
|
||||
xmlNsPtr ns[NUM_NAMESPACE];
|
||||
- struct hash_table ns_table = { 0, NULL, NULL };
|
||||
+ struct hash_table ns_table = HASH_TABLE_INITIALIZER;
|
||||
struct propfind_ctx fctx;
|
||||
|
||||
memset(&fctx, 0, sizeof(struct propfind_ctx));
|
||||
@@ -8083,7 +8083,7 @@ int meth_report(struct transaction_t *txn, void *params)
|
||||
xmlNodePtr inroot = NULL, outroot = NULL, cur, prop = NULL, props = NULL;
|
||||
const struct report_type_t *report = NULL;
|
||||
xmlNsPtr ns[NUM_NAMESPACE];
|
||||
- struct hash_table ns_table = { 0, NULL, NULL };
|
||||
+ struct hash_table ns_table = HASH_TABLE_INITIALIZER;
|
||||
struct propfind_ctx fctx;
|
||||
|
||||
memset(&fctx, 0, sizeof(struct propfind_ctx));
|
||||
diff --git a/imap/jmap_mail.c b/imap/jmap_mail.c
|
||||
index 7f2d9cb563..84845d273b 100644
|
||||
--- a/imap/jmap_mail.c
|
||||
+++ b/imap/jmap_mail.c
|
||||
@@ -4334,7 +4334,7 @@ static void _email_querychanges_collapsed(jmap_req_t *req,
|
||||
memset(&touched_ids, 0, sizeof(hash_table));
|
||||
construct_hash_table(&touched_ids, mdcount + 1, 0);
|
||||
|
||||
- hashu64_table touched_cids = HASH_TABLE_INITIALIZER;
|
||||
+ hashu64_table touched_cids = HASHU64_TABLE_INITIALIZER;
|
||||
memset(&touched_cids, 0, sizeof(hashu64_table));
|
||||
construct_hashu64_table(&touched_cids, mdcount + 1, 0);
|
||||
|
||||
diff --git a/lib/hash.c b/lib/hash.c
|
||||
index 639b6997e6..593f1bf968 100644
|
||||
--- a/lib/hash.c
|
||||
+++ b/lib/hash.c
|
||||
@@ -43,10 +43,11 @@ EXPORTED hash_table *construct_hash_table(hash_table *table, size_t size, int us
|
||||
assert(table);
|
||||
assert(size);
|
||||
|
||||
- table->size = size;
|
||||
+ table->size = size;
|
||||
+ table->seed = rand(); /* might be zero, that's okay */
|
||||
|
||||
/* Allocate the table -- different for using memory pools and not */
|
||||
- if(use_mpool) {
|
||||
+ if (use_mpool) {
|
||||
/* Allocate an initial memory pool for 32 byte keys + the hash table
|
||||
* + the buckets themselves */
|
||||
table->pool =
|
||||
@@ -72,7 +73,7 @@ EXPORTED hash_table *construct_hash_table(hash_table *table, size_t size, int us
|
||||
|
||||
EXPORTED void *hash_insert(const char *key, void *data, hash_table *table)
|
||||
{
|
||||
- unsigned val = strhash(key) % table->size;
|
||||
+ unsigned val = strhash_seeded(table->seed, key) % table->size;
|
||||
bucket *ptr, *newptr;
|
||||
bucket **prev;
|
||||
|
||||
@@ -159,7 +160,7 @@ EXPORTED void *hash_lookup(const char *key, hash_table *table)
|
||||
if (!table->size)
|
||||
return NULL;
|
||||
|
||||
- val = strhash(key) % table->size;
|
||||
+ val = strhash_seeded(table->seed, key) % table->size;
|
||||
|
||||
if (!(table->table)[val])
|
||||
return NULL;
|
||||
@@ -183,7 +184,7 @@ EXPORTED void *hash_lookup(const char *key, hash_table *table)
|
||||
* since it will leak memory until you get rid of the entire hash table */
|
||||
EXPORTED void *hash_del(const char *key, hash_table *table)
|
||||
{
|
||||
- unsigned val = strhash(key) % table->size;
|
||||
+ unsigned val = strhash_seeded(table->seed, key) % table->size;
|
||||
bucket *ptr, *last = NULL;
|
||||
|
||||
if (!(table->table)[val])
|
||||
diff --git a/lib/hash.h b/lib/hash.h
|
||||
index e49037d614..e476de77da 100644
|
||||
--- a/lib/hash.h
|
||||
+++ b/lib/hash.h
|
||||
@@ -3,10 +3,11 @@
|
||||
#define HASH__H
|
||||
|
||||
#include <stddef.h> /* For size_t */
|
||||
+#include <stdint.h>
|
||||
#include "mpool.h"
|
||||
#include "strarray.h"
|
||||
|
||||
-#define HASH_TABLE_INITIALIZER {0, NULL, NULL}
|
||||
+#define HASH_TABLE_INITIALIZER {0, 0, NULL, NULL}
|
||||
|
||||
/*
|
||||
** A hash table consists of an array of these buckets. Each bucket
|
||||
@@ -32,6 +33,7 @@ typedef struct bucket {
|
||||
|
||||
typedef struct hash_table {
|
||||
size_t size;
|
||||
+ uint32_t seed;
|
||||
bucket **table;
|
||||
struct mpool *pool;
|
||||
} hash_table;
|
||||
diff --git a/lib/strhash.c b/lib/strhash.c
|
||||
index d7c1741d2a..1b3251db73 100644
|
||||
--- a/lib/strhash.c
|
||||
+++ b/lib/strhash.c
|
||||
@@ -42,17 +42,32 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
-EXPORTED unsigned strhash(const char *string)
|
||||
+#include "lib/strhash.h"
|
||||
+
|
||||
+/* The well-known djb2 algorithm (e.g. http://www.cse.yorku.ca/~oz/hash.html),
|
||||
+ * with the addition of an optional seed to limit predictability.
|
||||
+ *
|
||||
+ * XXX return type 'unsigned' for back-compat to previous version, but
|
||||
+ * XXX ought to be 'uint32_t'
|
||||
+ */
|
||||
+EXPORTED unsigned strhash_seeded_djb2(uint32_t seed, const char *string)
|
||||
{
|
||||
- unsigned ret_val = 0;
|
||||
- int i;
|
||||
+ const unsigned char *ustr = (const unsigned char *) string;
|
||||
+ unsigned hash = 5381;
|
||||
+ int c;
|
||||
|
||||
- while (*string)
|
||||
- {
|
||||
- i = (int) *string;
|
||||
- ret_val ^= i;
|
||||
- ret_val <<= 1;
|
||||
- string ++;
|
||||
- }
|
||||
- return ret_val;
|
||||
+ if (seed) {
|
||||
+ /* treat the bytes of the seed as a prefix to the string */
|
||||
+ unsigned i;
|
||||
+ for (i = 0; i < sizeof seed; i++) {
|
||||
+ c = seed & 0xff;
|
||||
+ hash = ((hash << 5) + hash) ^ c;
|
||||
+ seed >>= 8;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ while ((c = *ustr++))
|
||||
+ hash = ((hash << 5) + hash) ^ c;
|
||||
+
|
||||
+ return hash;
|
||||
}
|
||||
diff --git a/lib/strhash.h b/lib/strhash.h
|
||||
index 34533fdffa..27339bb288 100644
|
||||
--- a/lib/strhash.h
|
||||
+++ b/lib/strhash.h
|
||||
@@ -41,7 +41,11 @@
|
||||
*/
|
||||
|
||||
#ifndef _STRHASH_H_
|
||||
+#include <stdint.h>
|
||||
|
||||
-unsigned strhash(const char *string);
|
||||
+unsigned strhash_seeded_djb2(uint32_t seed, const char *string);
|
||||
+
|
||||
+#define strhash(in) strhash_seeded_djb2((0), (in))
|
||||
+#define strhash_seeded(sd, in) strhash_seeded_djb2((sd), (in))
|
||||
|
||||
#endif /* _STRHASH_H_ */
|
@ -1,20 +0,0 @@
|
||||
diff --git a/imap/squatter.c b/imap/squatter.c
|
||||
index 4419379..d00f003 100644
|
||||
--- a/imap/squatter.c
|
||||
+++ b/imap/squatter.c
|
||||
@@ -408,8 +408,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);
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Type Name ID GECOS Home directory Shell
|
||||
g saslauth 76
|
||||
g mail 12
|
||||
u cyrus 76:mail "Cyrus IMAP Server" /var/lib/imap /sbin/nologin
|
||||
m cyrus saslauth
|
||||
|
@ -0,0 +1,17 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQENBFU5pZUBCAC+m05W9nJnBkrfFO9I+iimF1WCsSZNFoASJ3WEeZxIkOQO9BZj
|
||||
aKf8EP/nK7nEfNGZ2m+OrAtQU/+I8Sk1ppHuwZgENLvRzLsBGbv80kDKBw31Nd1f
|
||||
sCpVQs4b8zlohXjq0UN8tT5NcGJnGE7ahoOHzJk/0Ll76oVmOZvSw+WHBp1945m2
|
||||
Q8CbIbfmyuv7NF6GtGDVilPeIPsDnh5w5usjpKsxjYHKpy6Rtf4MbcCLtkRbHFra
|
||||
KJD+xum0PgPdCAEEbQsSXQgwOd0TZ59avRVVef674PjWqIuudUGUhJ/f9OWOj7LG
|
||||
6QgJR6yvCy7Bc2eAN4RnIIzaUZGaJDKDCNozABEBAAG0ImVsbGllIHRpbW9uZXkg
|
||||
PGVsbGllQGZhc3RtYWlsLmNvbT6JATgEEwECACIFAlU5pZUCGwMGCwkIBwMCBhUI
|
||||
AgkKCwQWAgMBAh4BAheAAAoJEFVPBP6zY3jgb9gH/3GPDLGybo7SYZMtBmfe+Udf
|
||||
tcRkTtH+o2pf2rh6KwPhhEDuOXWVCIUPWXsWIVU2K5Y8AdBIHOEoSUp3n8juV57I
|
||||
u9CfDI718/WaHgEpYrq5DqyROAFr+sGahcb6C40+V/CeUSAmKVhFGniuALUSAQ+B
|
||||
XVj/i2EAFNg/5ALkPYDnDYDqm7Ak6odDbktYQz987y38sg3EMC/2wi2EoOG1VWeG
|
||||
twFD8HKmXZw+u6cYtFh9K1hOBZm+PhLHr3h1MHTuWYeBKkT3YqaGtXMwi704LlNr
|
||||
HU8beOHSNBSsVYJ61B4kgBA7p+qnx6xIpU2KfAJl8cgjCYwrq8yo+Lm9TazagfM=
|
||||
=dIwC
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -1,25 +0,0 @@
|
||||
commit a8ccdaf109b85cedfd609678d95f7b7d5fdb91f5
|
||||
Author: ellie timoney <ellie@fastmail.com>
|
||||
Date: Mon Jun 7 12:00:27 2021 +1000
|
||||
|
||||
lmtpd: shared mailboxes don't have conversations to lock
|
||||
|
||||
Fixes #3488
|
||||
|
||||
diff --git a/imap/lmtpd.c b/imap/lmtpd.c
|
||||
index 498bb8765..dc9ca21bc 100644
|
||||
--- a/imap/lmtpd.c
|
||||
+++ b/imap/lmtpd.c
|
||||
@@ -843,8 +843,10 @@ int deliver(message_data_t *msgdata, char *authuser,
|
||||
// lock conversations for the duration of delivery, so nothing else can read
|
||||
// the state of any mailbox while the delivery is half done
|
||||
struct conversations_state *state = NULL;
|
||||
- r = conversations_open_user(mbname_userid(mbname), 0/*shared*/, &state);
|
||||
- if (r) goto setstatus;
|
||||
+ if (mbname_userid(mbname)) {
|
||||
+ r = conversations_open_user(mbname_userid(mbname), 0/*shared*/, &state);
|
||||
+ if (r) goto setstatus;
|
||||
+ }
|
||||
|
||||
/* local mailbox */
|
||||
mydata.cur_rcpt = n;
|
@ -0,0 +1,15 @@
|
||||
diff --git a/cassandane/Cassandane/Instance.pm b/cassandane/Cassandane/Instance.pm
|
||||
index 78e7100..edf6f5d 100644
|
||||
--- a/cassandane/Cassandane/Instance.pm
|
||||
+++ b/cassandane/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 ))
|
@ -0,0 +1,13 @@
|
||||
diff --git a/lib/util.c b/lib/util.c
|
||||
index a2eae15..ef8c25b 100644
|
||||
--- a/lib/util.c
|
||||
+++ b/lib/util.c
|
||||
@@ -1188,7 +1188,7 @@ EXPORTED int buf_getline(struct buf *buf, FILE *fp)
|
||||
|
||||
#ifdef HAVE_DECLARE_OPTIMIZE
|
||||
EXPORTED inline size_t buf_len(const struct buf *buf)
|
||||
- __attribute__((always_inline, optimize("-O3")));
|
||||
+ __attribute__((optimize("-O3")));
|
||||
#endif
|
||||
EXPORTED inline size_t buf_len(const struct buf *buf)
|
||||
{
|
@ -0,0 +1,40 @@
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 71333b0..52317da 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -2092,14 +2092,14 @@ endif
|
||||
## The @$(MKDIR_P) line is added due to a bug in Automake 1.10 and can be removed if using Automake 1.12.
|
||||
@$(MKDIR_P) $(DESTDIR)$(bindir)
|
||||
cd $(DESTDIR)$(bindir) && \
|
||||
- $(LN_S) -f imtest httptest && \
|
||||
- $(LN_S) -f imtest lmtptest && \
|
||||
- $(LN_S) -f imtest mupdatetest && \
|
||||
- $(LN_S) -f imtest nntptest && \
|
||||
- $(LN_S) -f imtest pop3test && \
|
||||
- $(LN_S) -f imtest sivtest && \
|
||||
- $(LN_S) -f imtest smtptest && \
|
||||
- $(LN_S) -f imtest synctest
|
||||
+ $(LN_S) -f cyr_imtest httptest && \
|
||||
+ $(LN_S) -f cyr_imtest lmtptest && \
|
||||
+ $(LN_S) -f cyr_imtest mupdatetest && \
|
||||
+ $(LN_S) -f cyr_imtest nntptest && \
|
||||
+ $(LN_S) -f cyr_imtest pop3test && \
|
||||
+ $(LN_S) -f cyr_imtest sivtest && \
|
||||
+ $(LN_S) -f cyr_imtest smtptest && \
|
||||
+ $(LN_S) -f cyr_imtest synctest
|
||||
|
||||
uninstall-hook: cyrus-makemaker-uninstall-workaround
|
||||
if PERL
|
||||
diff --git a/imtest/imtest.c b/imtest/imtest.c
|
||||
index 725ff62..d9406e1 100644
|
||||
--- a/imtest/imtest.c
|
||||
+++ b/imtest/imtest.c
|
||||
@@ -3040,7 +3040,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (!*prot) {
|
||||
- if (!strcasecmp(prog, "imtest"))
|
||||
+ if (!strcasecmp(prog, "cyr_imtest"))
|
||||
prot = "imap";
|
||||
else if (!strcasecmp(prog, "pop3test"))
|
||||
prot = "pop3";
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue