Projects
Kolab:3.4
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 112
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.dev20141030.git8f15dcd0%{?dist} +Release: 0.2.dev20141105.git2941de13%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.cyrusimap.org # Upstream sources -# From 8f15dcd0c71aff01f6d30e83644e9efcb5855b87 +# From 2941de1350adf7f0d99443ace884f40c754df193 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
View file
cyrus-imapd-2.5.tar.gz/imap/tls.c
Changed
@@ -753,8 +753,7 @@ // Just a warning since this is only necessary for client auth. syslog( LOG_WARNING, - "TLS server engine: Failed loading client CA " - "data, cert auth disabled." + "TLS server engine: Failed loading client CA data, cert auth disabled." ); use_client_certs = 0; @@ -774,7 +773,6 @@ } else { // (tls_client_certs != IMAP_ENUM_TLS_CLIENT_CERTS_OFF) // The use of client certificates is turned off. use_client_certs = 0; - syslog(LOG_DEBUG, "%s:%d", __FILE__, __LINE__); } server_ca_file = config_getstring(IMAPOPT_TLS_SERVER_CA_FILE); @@ -829,7 +827,7 @@ } if (!set_cert_stuff(s_ctx, server_cert_file, server_key_file)) { - syslog(LOG_ERR, "TLS server engine: cannot load server cert/key data"); + syslog(LOG_ERR, "TLS server engine: cannot load server cert/key data."); return (-1); } @@ -863,9 +861,10 @@ STACK_OF(X509_NAME) *CAnames = SSL_load_client_CA_file(client_ca_file); if (!CAnames || sk_num((_STACK *)CAnames) < 1) { - syslog(LOG_ERR, - "TLS server engine: No client CA certs specified. " - "Client side certs may not work"); + syslog( + LOG_ERR, + "TLS server engine: No client CA certs specified. Client side certs may not work" + ); } else { if (askcert || tls_client_certs)
View file
cyrus-imapd-2.5.tar.gz/master/masterconf.c
Changed
@@ -96,9 +96,11 @@ config_ident = ident; config_read(alt_config, 0); + setlogmask(~LOG_MASK(LOG_DEBUG)); + prefix = config_getstring(IMAPOPT_SYSLOG_PREFIX); - if(prefix) { + if (prefix) { int size = strlen(prefix) + 1 + strlen(ident) + 1; buf = xmalloc(size); strlcpy(buf, prefix, size); @@ -110,6 +112,9 @@ openlog(buf, LOG_PID, SYSLOG_FACILITY); /* don't free the openlog() string! */ + } else { + closelog(); + openlog(ident, LOG_PID, SYSLOG_FACILITY); } /* drop debug messages locally */
View file
cyrus-imapd-2.5.tar.gz/sieve/bc_eval.c
Changed
@@ -345,7 +345,7 @@ /* Evaluate a bytecode test */ static int eval_bc_test(sieve_interp_t *interp, void* m, bytecode_input_t * bc, int * ip, - strarray_t *workingflags) + strarray_t *workingflags, int version) { int res=0; int i=*ip; @@ -370,7 +370,7 @@ case BC_NOT:/*2*/ i+=1; - res = eval_bc_test(interp, m, bc, &i, workingflags); + res = eval_bc_test(interp, m, bc, &i, workingflags, version); if(res >= 0) res = !res; /* Only invert in non-error case */ break; @@ -429,7 +429,7 @@ * in the right place */ for (x=0; x<list_len && !res; x++) { int tmp; - tmp = eval_bc_test(interp, m, bc, &i, workingflags); + tmp = eval_bc_test(interp, m, bc, &i, workingflags, version); if(tmp < 0) { res = tmp; break; @@ -449,7 +449,7 @@ /* return 1 unless you find one that isn't true, then return 0 */ for (x=0; x<list_len && res; x++) { int tmp; - tmp = eval_bc_test(interp, m, bc, &i, workingflags); + tmp = eval_bc_test(interp, m, bc, &i, workingflags, version); if(tmp < 0) { res = tmp; break; @@ -465,14 +465,15 @@ /* fall through */ case BC_ADDRESS_PRE_INDEX:/*7*/ address=1; - if (BC_ADDRESS_PRE_INDEX == op) { + if (0x07 == version && BC_ADDRESS_PRE_INDEX == op) { /* There was a version of the bytecode that had the index extension * but did not update the bytecode codepoints, nor did it increment * the bytecode version number. This tests if the index extension * was in the bytecode based on the position of the match-type * argument. + * We test for the applicable version number explicitly. */ - switch (bc[i+2].value) { + switch (ntohl(bc[i+2].value)) { case B_IS: case B_CONTAINS: case B_MATCHES: @@ -480,6 +481,7 @@ case B_COUNT: case B_VALUE: has_index = 1; + break; default: has_index = 0; } @@ -692,12 +694,13 @@ has_index=1; /* fall through */ case BC_HEADER_PRE_INDEX:/*9*/ - if (BC_HEADER_PRE_INDEX == op) { + if (0x07 == version && BC_HEADER_PRE_INDEX == op) { /* There was a version of the bytecode that had the index extension * but did not update the bytecode codepoints, nor did it increment * the bytecode version number. This tests if the index extension * was in the bytecode based on the position of the match-type * argument. + * We test for the applicable version number explicitly. */ switch (ntohl(bc[i+2].value)) { case B_IS: @@ -707,6 +710,7 @@ case B_COUNT: case B_VALUE: has_index = 1; + break; default: has_index = 0; } @@ -1087,7 +1091,7 @@ case BC_DATE:/*11*/ has_index=1; case BC_CURRENTDATE:/*12*/ - if (BC_CURRENTDATE/*12*/ == op || BC_DATE/*11*/ == op) { + if (0x07 == version) { /* There was a version of the bytecode that had the index extension * but did not update the bytecode codepoints, nor did it increment * the bytecode version number. This tests if the index extension @@ -1098,30 +1102,59 @@ * B_ORIGINALZONE). * There was also an unnumbered version of BC_CURRENTDATE that did * allow :index. This also covers that case. + * We test for the applicable version number explicitly. */ switch (ntohl(bc[i+4].value)) { + /* if the 4th parameter is a comparator, we have neither :index nor + * :zone tags. B_ORIGINALZONE is the first parameter. + */ case B_ASCIICASEMAP: case B_OCTET: case B_ASCIINUMERIC: has_index = 0; break; default: - if (B_TIMEZONE == ntohl(bc[i+1].value) && - B_ORIGINALZONE != ntohl(bc[i+2].value)) { - switch (ntohl(bc[i+3].value)) { - case B_IS: - case B_CONTAINS: - case B_MATCHES: - case B_REGEX: - case B_COUNT: - case B_VALUE: + /* otherwise, we either have a :zone tag, an :index tag, or + * both + */ + switch (ntohl(bc[i+5].value)) { + /* if the 5th paramater is a comparator, we have either :index + * or :zone, but not both. + */ + case B_ASCIICASEMAP: + case B_OCTET: + case B_ASCIINUMERIC: + /* The ambiguous case is B_TIMEZONE as 1st parameter and + * B_ORIGINALZONE as second parameter, which could mean + * either ':index 60 :originalzone' or ':zone "+0101"' + */ + if (B_TIMEZONE == ntohl(bc[i+1].value) && + B_ORIGINALZONE == ntohl(bc[i+2].value)) { + /* This is the ambiguous case. Resolve the ambiguity + * by assuming that there is no :index tag since the + * unnumbered bytecode that shipped with Kolab + * Groupware 3.3 included support for the date + * extension, but not for the index extension. + */ has_index = 0; - break; - default: - has_index = 1; + } else if (B_TIMEZONE == ntohl(bc[i+1].value)) { + /* if the first parameter is B_TIMEZONE, and the above + * test was false, it must be a :zone tag, and we + * don't have :index. + */ + has_index = 0; + } else { + /* if the first parameter is not B_TIMEZONE, it must + * be an :index tag, and we don't have :zone. + */ + has_index = 1; } - } else { + break; + default: + /* if the 5th parameter is not a comparator, the 6th is, + * and we have both :index and :zone + */ has_index = 1; } } @@ -1428,15 +1461,18 @@ #endif for(ip++; ip<ip_max; ) { - /* In this loop, each case must increment ip for the next iteration. - * The when the case is jumped to initially, ip points to the opcode. - * This should probably change to point to the first parameter to - * support future extensions. + /* In this loop, when a case is switch'ed to, ip points to the first + * parameter of the action. This makes it easier to add future + * extensions. Extensions that change an existing action should add + * any new parameters to the beginning of the particular action's + * bytecode. This will allow the new code to fall through to the + * older code, which will then parse the older parameters and should + * require only a minimal set of changes to support any new extension. */ int copy = 0; strarray_t *actionflags = NULL; - op=ntohl(bc[ip].op); + op=ntohl(bc[ip++].op); switch(op) { case B_STOP:/*0*/ res=1; @@ -1445,9 +1481,9 @@ case B_KEEP:/*22*/ { int x; - int list_len=ntohl(bc[ip+1].len); + int list_len=ntohl(bc[ip].len); - ip+=3; /* skip opcode, list_len, and list data len */ + ip+=2; /* skip opcode, list_len, and list data len */ if (list_len) { actionflags = (varlist_extend(flagvars))->var; @@ -1460,7 +1496,7 @@ } } } - copy = ntohl(bc[ip].value); + copy = ntohl(bc[ip++].value); /* fall through */ case B_KEEP_ORIG:/*1*/ res = do_keep(actions, !copy, @@ -1468,16 +1504,14 @@ if (res == SIEVE_RUN_ERROR) *errmsg = "Keep can not be used with Reject"; actionflags = NULL; - ip++; break; case B_DISCARD:/*2*/ res=do_discard(actions); - ip++; break; case B_REJECT:/*3*/ - ip = unwrap_string(bc, ip+1, &data, NULL); + ip = unwrap_string(bc, ip, &data, NULL); res = do_reject(actions, data); @@ -1489,9 +1523,9 @@ case B_FILEINTO:/*23*/ { int x; - int list_len=ntohl(bc[ip+1].len); + int list_len=ntohl(bc[ip].len); - ip+=3; /* skip opcode, list_len, and list data len */ + ip+=2; /* skip opcode, list_len, and list data len */ if (list_len) { actionflags = (varlist_extend(flagvars))->var; @@ -1525,13 +1559,13 @@ } case B_REDIRECT:/*20*/ - copy = ntohl(bc[ip+1].value); + copy = ntohl(bc[ip].value); ip+=1; /* fall through */ case B_REDIRECT_ORIG:/*5*/ { - ip = unwrap_string(bc, ip+1, &data, NULL); + ip = unwrap_string(bc, ip, &data, NULL); res = do_redirect(actions, data, !copy); @@ -1543,11 +1577,11 @@ case B_IF:/*6*/ { - int testend=ntohl(bc[ip+1].value); + int testend=ntohl(bc[ip].value); int result; - ip+=2; - result=eval_bc_test(i, m, bc, &ip, workingvars->var); + ip+=1; + result=eval_bc_test(i, m, bc, &ip, workingvars->var, version); if (result<0) { *errmsg = "Invalid test"; @@ -1569,7 +1603,6 @@ strarray_add_case(workingvars->var, i->markflags->data[--n]); } } - ip++; break; case B_UNMARK:/*8*/ @@ -1581,15 +1614,14 @@ i->markflags->data[--n]); } } - ip++; break; case B_ADDFLAG:/*9*/ { int x; - int list_len=ntohl(bc[ip+1].len); + int list_len=ntohl(bc[ip].len); - ip+=3; /* skip opcode, list_len, and list data len */ + ip+=2; /* skip opcode, list_len, and list data len */ for (x=0; x<list_len; x++) { ip = unwrap_string(bc, ip, &data, NULL); @@ -1606,9 +1638,9 @@ case B_SETFLAG:/*10*/ { int x; - int list_len=ntohl(bc[ip+1].len); + int list_len=ntohl(bc[ip].len); - ip+=3; /* skip opcode, list_len, and list data len */ + ip+=2; /* skip opcode, list_len, and list data len */ res = do_setflag(actions); @@ -1635,9 +1667,9 @@ case B_REMOVEFLAG:/*11*/ { int x; - int list_len=ntohl(bc[ip+1].len); + int list_len=ntohl(bc[ip].len); - ip+=3; /* skip opcode, list_len, and list data len */ + ip+=2; /* skip opcode, list_len, and list data len */ for (x=0; x<list_len; x++) { ip = unwrap_string(bc, ip, &data, NULL); @@ -1660,8 +1692,6 @@ const char * message; int pri; - ip++; - /* method */ ip = unwrap_string(bc, ip, &method, NULL); @@ -1721,7 +1751,6 @@ int comparator; int pri; - ip++; pri=ntohl(bc[ip].value); ip++; @@ -1797,8 +1826,6 @@ char subject[1024]; int x; - ip++; - x = ntohl(bc[ip].len); respond = shouldRespond(m, i, x, bc, ip+2, @@ -1879,21 +1906,20 @@ break; } case B_NULL:/*15*/ - ip++; break; case B_JUMP:/*16*/ - ip= ntohl(bc[ip+1].jump); + ip= ntohl(bc[ip].jump); break; case B_INCLUDE:/*17*/ { - int isglobal = (ntohl(bc[ip+1].value) & 63) == B_GLOBAL; - int once = ntohl(bc[ip+1].value) & 64 ? 1 : 0; - int isoptional = ntohl(bc[ip+1].value) & 128 ? 1 : 0; + int isglobal = (ntohl(bc[ip].value) & 63) == B_GLOBAL; + int once = ntohl(bc[ip].value) & 64 ? 1 : 0; + int isoptional = ntohl(bc[ip].value) & 128 ? 1 : 0; char fpath[4096]; - ip = unwrap_string(bc, ip+2, &data, NULL); + ip = unwrap_string(bc, ip+1, &data, NULL); res = i->getinclude(sc, data, isglobal, fpath, sizeof(fpath)); if (res != SIEVE_OK) {
View file
cyrus-imapd-2.5.tar.gz/sieve/sieved.c
Changed
@@ -62,7 +62,7 @@ #include "map.h" static void dump2(bytecode_input_t *d, int len); -static int dump2_test(bytecode_input_t * d, int i); +static int dump2_test(bytecode_input_t * d, int i, int version); /* from bc_eval.c */ int unwrap_string(bytecode_input_t *bc, int pos, const char **str, int *len); @@ -198,7 +198,7 @@ } -static int dump2_test(bytecode_input_t * d, int i) +static int dump2_test(bytecode_input_t * d, int i, int version) { int l,x,index; int opcode; @@ -220,7 +220,7 @@ no idea what it does, but it isn't carried to here... see bytecodee.c */ printf(" not("); - i=dump2_test(d, i+1); + i=dump2_test(d, i+1, version); printf(")\n"); break; case BC_EXISTS: @@ -245,7 +245,7 @@ for (x=0; x<l; x++) { - i=dump2_test(d,i); + i=dump2_test(d, i, version); if((x+1)<l) printf(" OR "); } @@ -259,7 +259,7 @@ for (x=0; x<l; x++) { - i=dump2_test(d,i); + i=dump2_test(d, i, version); if((x+1)<l) printf(" AND "); } @@ -270,14 +270,15 @@ has_index=1; /*fall-through*/ case BC_ADDRESS_PRE_INDEX:/*7*/ - if (BC_ADDRESS_PRE_INDEX == opcode) { + if (0x07 == version && BC_ADDRESS_PRE_INDEX == opcode) { /* There was a version of the bytecode that had the index extension * but did not update the bytecode codepoints, nor did it increment * the bytecode version number. This tests if the index extension * was in the bytecode based on the position of the match-type * argument. + * We test for the applicable version number explicitly. */ - switch (d[i+2].value) { + switch (ntohl(d[i+2].value)) { case B_IS: case B_CONTAINS: case B_MATCHES: @@ -285,6 +286,7 @@ case B_COUNT: case B_VALUE: has_index = 1; + break; default: has_index = 0; } @@ -334,12 +336,13 @@ has_index=1; /*fall-through*/ case BC_HEADER_PRE_INDEX:/*9*/ - if (BC_HEADER_PRE_INDEX == opcode) { + if (0x07 == version && BC_HEADER_PRE_INDEX == opcode) { /* There was a version of the bytecode that had the index extension * but did not update the bytecode codepoints, nor did it increment * the bytecode version number. This tests if the index extension * was in the bytecode based on the position of the match-type * argument. + * We test for the applicable version number explicitly. */ switch (ntohl(d[i+2].value)) { case B_IS: @@ -349,6 +352,7 @@ case B_COUNT: case B_VALUE: has_index = 1; + break; default: has_index = 0; } @@ -395,7 +399,7 @@ case BC_DATE:/*11*/ has_index=1; case BC_CURRENTDATE:/*12*/ - if (BC_CURRENTDATE/*12*/ == opcode || BC_DATE/*11*/ == opcode) { + if (0x07 == version) { /* There was a version of the bytecode that had the index extension * but did not update the bytecode codepoints, nor did it increment * the bytecode version number. This tests if the index extension @@ -406,30 +410,59 @@ * B_ORIGINALZONE). * There was also an unnumbered version of BC_CURRENTDATE that did * allow :index. This also covers that case. + * We test for the applicable version number explicitly. */ switch (ntohl(d[i+4].value)) { + /* if the 4th parameter is a comparator, we have neither :index nor + * :zone tags. B_ORIGINALZONE is the first parameter. + */ case B_ASCIICASEMAP: case B_OCTET: case B_ASCIINUMERIC: has_index = 0; break; default: - if (B_TIMEZONE == ntohl(d[i+1].value) && - B_ORIGINALZONE != ntohl(d[i+2].value)) { - switch (ntohl(d[i+3].value)) { - case B_IS: - case B_CONTAINS: - case B_MATCHES: - case B_REGEX: - case B_COUNT: - case B_VALUE: + /* otherwise, we either have a :zone tag, an :index tag, or + * both + */ + switch (ntohl(d[i+5].value)) { + /* if the 5th paramater is a comparator, we have either :index + * or :zone, but not both. + */ + case B_ASCIICASEMAP: + case B_OCTET: + case B_ASCIINUMERIC: + /* The ambiguous case is B_TIMEZONE as 1st parameter and + * B_ORIGINALZONE as second parameter, which could mean + * either ':index 60 :originalzone' or ':zone "+0101"' + */ + if (B_TIMEZONE == ntohl(d[i+1].value) && + B_ORIGINALZONE == ntohl(d[i+2].value)) { + /* This is the ambiguous case. Resolve the ambiguity + * by assuming that there is no :index tag since the + * unnumbered bytecode that shipped with Kolab + * Groupware 3.3 included support for the date + * extension, but not for the index extension. + */ has_index = 0; - break; - default: - has_index = 1; + } else if (B_TIMEZONE == ntohl(d[i+1].value)) { + /* if the first parameter is B_TIMEZONE, and the above + * test was false, it must be a :zone tag, and we + * don't have :index. + */ + has_index = 0; + } else { + /* if the first parameter is not B_TIMEZONE, it must + * be an :index tag, and we don't have :zone. + */ + has_index = 1; } - } else { + break; + default: + /* if the 5th parameter is not a comparator, the 6th is, + * and we have both :index and :zone + */ has_index = 1; } } @@ -589,7 +622,7 @@ printf("IF (ends at %d)", ntohl(d[i].value)); /* there is no short circuiting involved here*/ - i = dump2_test(d,i+1); + i = dump2_test(d, i+1, version); printf("\n"); break;
View file
cyrus-imapd-2.5.tar.gz/sieve/test.c
Changed
@@ -524,6 +524,9 @@ static strarray_t mark = STRARRAY_INITIALIZER; static strarray_t e_from = STRARRAY_INITIALIZER; static strarray_t e_to = STRARRAY_INITIALIZER; + /* prevent crashes if -e or -t aren't specified */ + strarray_append(&e_from, ""); + strarray_append(&e_to, ""); while ((c = getopt(argc, argv, "v:fe:t:r:")) != EOF) switch (c) { @@ -534,9 +537,11 @@ force_fail = 1; break; case 'e': + strarray_fini(&e_from); strarray_append(&e_from, optarg); break; case 't': + strarray_fini(&e_to); strarray_append(&e_to, optarg); break; case 'r':
View file
cyrus-imapd.dsc
Changed
@@ -2,7 +2,7 @@ Source: cyrus-imapd Binary: cyrus-imapd Architecture: any -Version: 2.5~dev2014103002-0~kolab1 +Version: 2.5~dev2014110501-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~dev2014110501-0~kolab1) unstable; urgency=low + + * Ship a GIT development snapshot from git.cyrusimap.org + 2941de1350adf7f0d99443ace884f40c754df193 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Wed, 5 Nov 2014 11:30:13 +0100 + cyrus-imapd (2.5~dev2014103002-0~kolab1) unstable; urgency=low * Ship a GIT development snapshot from git.cyrusimap.org
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
.