Projects
Kolab:16:Testing
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
cyrus-imapd.spec
Changed
@@ -20,8 +20,8 @@ %global _cyrusgroup mail %global _cyrexecdir %{_exec_prefix}/lib/%{_name} -%global real_version 2.5.7 -#%%global snapshot_version 7 +%global real_version 2.5.8 +%global snapshot_version 12 %global dot_snapshot_version %{?snapshot_version:.%{snapshot_version}} ## @@ -34,6 +34,7 @@ %global with_dav 0 %global with_tcpwrap 0 +%global with_zlib 0 Name: cyrus-imapd Summary: A high-performance mail server with IMAP, POP3, NNTP and SIEVE support @@ -329,6 +330,9 @@ %if 0%{?with_tcpwrap} < 1 --without-wrap \ %endif +%if 0%{?with_zlib} < 1 + --without-zlib \ +%endif %if 0%{?with_dav} --with-http \ %endif @@ -748,6 +752,21 @@ %{_libdir}/*.la %changelog +* Thu Jun 02 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.8.12-1 +- Check in 12 revisions ahead of upstream 2.5.8 release + +* Mon May 09 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.26-1 +- Check in 26 revisions ahead of upstream 2.5.7 release + +* Fri Apr 29 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.25-1 +- Check in 25 revisions ahead of upstream 2.5.7 release + +* Mon Mar 21 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.10-1 +- Check in 10 revisions ahead of upstream 2.5.7 release + +* Thu Mar 10 2016 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7.8-1 +- Check in 8 revisions ahead of upstream 2.5.7 release + * Wed Dec 16 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.5.7-1 - Upstream release 2.5.7
View file
cyr_systemd_helper
Changed
@@ -2,14 +2,20 @@ # get_config config default # extracts config option from config file get_config() { - if conf=$(grep "^$1" /etc/imapd.conf); then - echo $conf | cut -d: -f2 - else - echo $2 - fi + if conf=$(grep "^$1" /etc/imapd.conf); then + echo $conf | cut -d: -f2 + else + echo $2 + fi } CONFIGDIRECTORY=$(get_config configdirectory /var/lib/imap) +if ! -d ${CONFIGDIRECTORY} ; then + mkdir -p ${CONFIGDIRECTORY} + chmod 700 ${CONFIGDIRECTORY} + chown cyrus:mail ${CONFIGDIRECTORY} +fi + RETVAL=0 # Sometimes, there is no path @@ -20,26 +26,36 @@ fi start() { - cd $CONFIGDIRECTORY - $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all import > ${CONFIGDIRECTORY}/rpm/db_import.log 2>&1" < /dev/null - RETVAL=$? + cd $CONFIGDIRECTORY + $runuser - cyrus -s /bin/bash -c '/usr/lib/cyrus-imapd/mkimap' >/dev/null 2>&1 < /dev/null + + mkdir -p ${CONFIGDIRECTORY}/rpm + chown cyrus:mail ${CONFIGDIRECTORY}/rpm + + $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all import > ${CONFIGDIRECTORY}/rpm/db_import.log 2>&1" < /dev/null + RETVAL=$? } stop() { - cd $CONFIGDIRECTORY - $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all export > ${CONFIGDIRECTORY}/rpm/db_export.log 2>&1" < /dev/null - RETVAL=$? + cd $CONFIGDIRECTORY + mkdir -p ${CONFIGDIRECTORY}/rpm + chown cyrus:mail ${CONFIGDIRECTORY}/rpm + + $runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all export > ${CONFIGDIRECTORY}/rpm/db_export.log 2>&1" < /dev/null + RETVAL=$? } case "$1" in - start) - start - ;; - stop) - stop - ;; - *) - ;; + start) + start + ;; + + stop) + stop + ;; + + *) + ;; esac exit $RETVAL
View file
cyrus-imapd-2.5.7.tar.gz/doc/text
Deleted
-(directory)
View file
cyrus-imapd-2.5.7.tar.gz/doc/text/.gitignore
Deleted
@@ -1,33 +0,0 @@ -altnamespace -anoncvs -bugs -changes -faq -feedback -htmlstrip -index -install -install-admin-mb -install-auth -install-compile -install-configure -install-murder -install-netnews -install-virtdomains -install-perf -install-prereq -install-replication -install-sieve -install-snmpmon -install-testing -install-upgrade -mailing-list -man -notes -os -overview -questions -readme -sieve -sieve-protocol -specs
View file
cyrus-imapd-2.5.7.tar.gz/.gitignore -> cyrus-imapd-2.5.8.12.tar.gz/.gitignore
Changed
@@ -37,6 +37,8 @@ cscope.out depcomp doc/man/ +doc/murder.png +doc/netnews.png doc/rst/ doc/text/ imap/arbitron @@ -153,6 +155,7 @@ sieve/tests/ stamp-h1 timsieved/timsieved +tools/htmlstrip tools/vzic/vzic xversion.h ylwrap
View file
cyrus-imapd-2.5.7.tar.gz/Makefile.am -> cyrus-imapd-2.5.8.12.tar.gz/Makefile.am
Changed
@@ -63,7 +63,8 @@ BUILT_SOURCES = \ xversion.h \ imap/imap_err.c \ - lib/imapopts.c + lib/imapopts.c \ + lib/imapopts.h DISTCLEANFILES = \ imap/imap_err.c \ @@ -106,7 +107,7 @@ DIST_SUBDIRS = . dist_sysconf_DATA = lib_LTLIBRARIES = lib/libcyrus_min.la lib/libcyrus.la -EXTRA_PROGRAMS = doc/text/htmlstrip +EXTRA_PROGRAMS = tools/htmlstrip check_PROGRAMS = service_PROGRAMS = user_PROGRAMS = @@ -313,6 +314,8 @@ cunit/cunit-to-junit.pl \ cunit/key.pem \ cunit/vg.supp \ + doc/murder.png \ + doc/netnews.png \ doc \ imap/dav_util.h \ imap/http_err.et \ @@ -659,7 +662,7 @@ exit $$retval endif -doc_text_htmlstrip_SOURCE = doc/text/htmlstrip.c +tools_htmlstrip_SOURCE = tools/htmlstrip.c includedir=@includedir@/cyrus @@ -682,7 +685,6 @@ lib/gmtoff.h \ lib/hash.h \ lib/hashu64.h \ - lib/imapopts.h \ lib/imapurl.h \ lib/imclient.h \ lib/imparse.h \ @@ -709,6 +711,9 @@ lib/wildmat.h \ lib/xmalloc.h +nodist_include_HEADERS = \ + lib/imapopts.h + nobase_include_HEADERS = sieve/sieve_interface.h nobase_nodist_include_HEADERS = sieve/sieve_err.h @@ -1209,12 +1214,14 @@ lib_libcyrus_la_LIBADD = $(LIB_RT) ${LIB_SASL} $(SSL_LIBS) lib_libcyrus_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY) +nodist_lib_libcyrus_min_la_SOURCES = \ + lib/imapopts.c + lib_libcyrus_min_la_SOURCES = \ lib/arrayu64.c \ lib/assert.c \ lib/hash.c \ lib/hashu64.c \ - lib/imapopts.c \ lib/libconfig.c \ lib/mpool.c \ lib/retry.c \ @@ -1489,6 +1496,12 @@ grep -E ' yy_size_t _yybytes_len ' sieve/addr-lex.c && \ sed -r -i -s 's/\tint i;/\tyy_size_t i;/g' sieve/addr-lex.c || : + grep -E '^static int yy_n_chars;' sieve/sieve-lex.c && \ + sed -r -i -s 's/\tyy_size_t yy_buf_size;/\tint yy_buf_size;/g' sieve/sieve-lex.c || : + + grep -E '^static int yy_n_chars;' sieve/addr-lex.c && \ + sed -r -i -s 's/\tyy_size_t yy_buf_size;/\tint yy_buf_size;/g' sieve/addr-lex.c || : + GIT_VERSION = $(PACKAGE_VERSION)@git_version@ snapshot:: @@ -1559,7 +1572,9 @@ @cmp -s xversion.h.tmp xversion.h || mv xversion.h.tmp xversion.h @rm -f xversion.h.tmp -dist-hook: doc/text/htmlstrip doc/man/cyradm.1.html doc/man/sieveshell.1.html +.PHONY: doc + +doc: tools/htmlstrip doc/man/cyradm.1.html doc/man/sieveshell.1.html @$(MKDIR_P) doc/text doc/man for man in $(top_builddir)/man/*.1-9 $(top_srcdir)/man/*.1-9; \ do \ @@ -1571,9 +1586,8 @@ for file in $(top_srcdir)/doc/*.html; \ do \ echo "=== $$file ==="; \ - doc/text/htmlstrip $$file > doc/text/`basename $$file .html`; \ + tools/htmlstrip $$file > doc/text/`basename $$file .html`; \ done - @rm doc/text/htmlstrip doc/text/htmlstrip.o doc/text/.dirstamp @echo "== done ==" install-data-hook:
View file
cyrus-imapd-2.5.7.tar.gz/configure.ac -> cyrus-imapd-2.5.8.12.tar.gz/configure.ac
Changed
@@ -44,13 +44,16 @@ dnl -AC_INIT(cyrus-imapd, 2.5.7, http://bugzilla.cyrusimap.org,,http://www.cyrusimap.org) +AC_INIT(cyrus-imapd, 2.5.8, http://bugzilla.cyrusimap.org,,http://www.cyrusimap.org) AC_PREREQ(2.63) AC_CONFIG_SRCDIR(imap/imapd.c) AC_CONFIG_HEADERS(config.h) AC_CONFIG_MACRO_DIR(cmulocal) AC_CANONICAL_SYSTEM +dnl in case the first use of PKG_CHECK_MODULES is inside a conditional +PKG_PROG_PKG_CONFIG + AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability foreign dist-bzip2 no-installinfo subdir-objects) AC_CONFIG_LIBOBJ_DIR(lib) @@ -89,14 +92,19 @@ AM_MAINTAINER_MODE +dnl Coverage (disabled by default) +COV_CFLAGS= +COV_LDFLAGS= + AC_ARG_ENABLE(coverage, - AS_HELP_STRING(--enable-coverage,enable C test coverage), - COV_CFLAGS="--coverage" - COV_LDFLAGS="--coverage" - , - COV_CFLAGS= - COV_LDFLAGS= - ) + AS_HELP_STRING(--enable-coverage,enable C test coverage) +) + +AS_IF(test "x$enable_coverage" = "xyes", + COV_CFLAGS="--coverage" + COV_LDFLAGS="--coverage" +) + AC_SUBST(COV_CFLAGS) AC_SUBST(COV_LDFLAGS) @@ -1233,6 +1241,11 @@ AC_DEFINE(WITH_DKIM,,Build DKIM support into iSchedule?) fi + AC_EGREP_HEADER(ICAL_IANA_PARAMETER, ical.h, + AC_DEFINE(HAVE_IANA_PARAMS,, + Do we have support for IANA params?), + AC_MSG_WARN(Your version of libical can not support scheduling or managed attachments. Consider upgrading to libical >= 0.48)) + AC_EGREP_HEADER(ICAL_SCHEDULESTATUS_PARAMETER, ical.h, AC_DEFINE(HAVE_SCHEDULING_PARAMS,, Do we have built-in support for scheduling params?)) @@ -1250,7 +1263,7 @@ if test "$ENABLE_RSCALE" != no; then AC_SUBST(ICU_CFLAGS) AC_SUBST(ICU_LIBS) - AC_CHECK_LIB(ical, icalrecur_rscale_token_handling_is_supported, + AC_CHECK_LIB(ical, icalrecurrencetype_rscale_is_supported, AC_DEFINE(HAVE_RSCALE,, Build RSCALE support into httpd?)) fi fi
View file
cyrus-imapd-2.5.7.tar.gz/doc/changes.html -> cyrus-imapd-2.5.8.12.tar.gz/doc/changes.html
Changed
@@ -8,6 +8,38 @@ </head> <body> +<h1>Changes to the Cyrus IMAP Server since 2.5.7</h1> +<h2>Murder changes</h2> +<ul> +<li>Allow replicated backends in a discrete Murder to both actively +participate in the Murder.</li> +<li>When choosing between ANNOTATEMORE and METADATA, favour what the +client used.</li> +</ul> +<h2>Other changes</h2> +<ul> +<li>cyr_dbtool now supports improved_mboxlist_sort (-M)</li> +</ul> +<h2>Bug fixes</h2> +<ul> +<li>Fixed: master on pselect systems no longer chokes on repeated interrupts +(thanks Jens Erat and team)</li> +<li>Fixed: better iOS CalDAV support (don’t announce VPOLL)</li> +<li>Fixed: backported version detection code to detect future versions</li> +<li>Fixed bug #3927: don’t break cyrus.index on XFER of mailbox with annotations +(thanks Wolfgang Breyha)</li> +<li>Fixed: replication/XFER of mailbox names containing ‘@’</li> +<li>Fixed: METADATA and GETMETADATA pattern/list recognition</li> +<li>Fixed bug #3862: don’t leave behind inconsistent mailboxes when +mupdate fails during mailbox rename</li> +<li>Fixed compilation with Sun Studio 12 C Compiler (thanks Marty Lee)</li> +<li>Fixed bug #3765: ctl_cyrusdb now uses database paths from imapd.conf +(thanks Simon Matter)</li> +<li>Fixed T227: service processes no longer crash with ‘-T 0’ argument +(thanks Ian Batten and Jens Erat)</li> +<li>various build system fixes</li> +</ul> + <h1>Changes to the Cyrus IMAP Server since 2.5.6</h1> <h2>Security fixes</h2> <ul>
View file
cyrus-imapd-2.5.7.tar.gz/imap/annotate.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/annotate.c
Changed
@@ -968,7 +968,7 @@ r = split_attribs(data, datalen, &value); - if (!r) r = frock->proc(mboxname, uid, entry, userid, &value, frock->rock); + if (!r) r = frock->proc(mboxname, uid, entry, userid ? userid : "", &value, frock->rock); return r; } @@ -2115,16 +2115,25 @@ int attribcount; /* - * TODO: this is bogus. The * and % wildcard characters applied - * to attributes in the early drafts of the ANNOTATEMORE - * extension, but not in later drafts where those characters are - * actually illegal in attribute names. + * Ensure this function can be called with '/private' and '/shared' as + * is used in the RFC, and 'value.priv' and 'value.shared' as + * implemented in the RFC's drafts -- without requiring changes to + * /etc/imapd.annotations.conf. */ - g = glob_init(s, GLOB_HIERARCHY); - + if (!strncmp(s, "/private", 8)) { + g = glob_init("value.priv", GLOB_HIERARCHY); + } + else if (!strncmp(s, "/shared", 7)) { + g = glob_init("value.shared", GLOB_HIERARCHY); + } + else { + g = glob_init(s, GLOB_HIERARCHY); + } + for (attribcount = 0; annotation_attributesattribcount.name; attribcount++) { + if (GLOB_TEST(g, annotation_attributesattribcount.name) != -1) { if (annotation_attributesattribcount.entry & ATTRIB_DEPRECATED) { if (strcmp(s, "*")) @@ -2136,7 +2145,7 @@ state->attribs |= annotation_attributesattribcount.entry; } } - + glob_free(&g); }
View file
cyrus-imapd-2.5.7.tar.gz/imap/ctl_cyrusdb.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/ctl_cyrusdb.c
Changed
@@ -196,7 +196,30 @@ static const char *dbfname(struct cyrusdb *db) { static char bufMAX_MAILBOX_PATH; - snprintf(buf, MAX_MAILBOX_PATH, "%s%s", config_dir, db->name); + const char *fname = NULL; + + /* find absolute path to db files in configuration */ + if (!strcmp(db->name, FNAME_MBOXLIST)) + fname = config_getstring(IMAPOPT_MBOXLIST_DB_PATH); + else if (!strcmp(db->name, FNAME_QUOTADB)) + fname = config_getstring(IMAPOPT_QUOTA_DB_PATH); + else if (!strcmp(db->name, FNAME_GLOBALANNOTATIONS)) + fname = config_getstring(IMAPOPT_ANNOTATION_DB_PATH); + else if (!strcmp(db->name, FNAME_DELIVERDB)) + fname = config_getstring(IMAPOPT_DUPLICATE_DB_PATH); + else if (!strcmp(db->name, FNAME_TLSSESSIONS)) + fname = config_getstring(IMAPOPT_TLSCACHE_DB_PATH); + else if (!strcmp(db->name, FNAME_PTSDB)) + fname = config_getstring(IMAPOPT_PTSCACHE_DB_PATH); + else if (!strcmp(db->name, FNAME_STATUSCACHEDB)) + fname = config_getstring(IMAPOPT_STATUSCACHE_DB_PATH); + + /* use default if no special path was found */ + if (!fname) + snprintf(buf, MAX_MAILBOX_PATH, "%s%s", config_dir, db->name); + else + snprintf(buf, MAX_MAILBOX_PATH, "%s", fname); + return buf; }
View file
cyrus-imapd-2.5.7.tar.gz/imap/cyr_dbtool.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/cyr_dbtool.c
Changed
@@ -248,11 +248,14 @@ struct txn *tid = NULL; struct txn **tidp = NULL; - while ((opt = getopt(argc, argv, "C:ntT")) != EOF) { + while ((opt = getopt(argc, argv, "C:MntT")) != EOF) { switch (opt) { case 'C': /* alt config file */ alt_config = optarg; break; + case 'M': /* use "improved_mboxlist_sort" */ + db_flags |= CYRUSDB_MBOXSORT; + break; case 'n': /* create new */ db_flags |= CYRUSDB_CREATE; break;
View file
cyrus-imapd-2.5.7.tar.gz/imap/http_caldav.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/http_caldav.c
Changed
@@ -104,6 +104,7 @@ #ifdef HAVE_RSCALE +#include <unicode/ucal.h> #include <unicode/uversion.h> static int rscale_cmp(const void *a, const void *b) @@ -111,12 +112,23 @@ /* Convert to uppercase since that's what we prefer to output */ return strcmp(ucase(*((char **) a)), ucase(*((char **) b))); } - -static icalarray *rscale_calendars = NULL; #endif /* HAVE_RSCALE */ -#ifndef HAVE_SCHEDULING_PARAMS +#ifdef HAVE_SCHEDULING_PARAMS + +/* Wrappers to fetch scheduling parameters by kind */ + +#define icalproperty_get_scheduleagent_parameter(prop) \ + icalproperty_get_first_parameter(prop, ICAL_SCHEDULEAGENT_PARAMETER) + +#define icalproperty_get_scheduleforcesend_parameter(prop) \ + icalproperty_get_first_parameter(prop, ICAL_SCHEDULEFORCESEND_PARAMETER) + +#define icalproperty_get_schedulestatus_parameter(prop) \ + icalproperty_get_first_parameter(prop, ICAL_SCHEDULESTATUS_PARAMETER) + +#elif defined(HAVE_IANA_PARAMS) /* Functions to replace those not available in libical < v1.0 */ @@ -179,18 +191,22 @@ #define icalproperty_get_schedulestatus_parameter(prop) \ icalproperty_get_iana_parameter_by_name(prop, "SCHEDULE-STATUS") -#else +#else /* !HAVE_IANA_PARAMS */ -/* Wrappers to fetch scheduling parameters by kind */ +/* Functions to replace those not available in libical < v0.48 */ -#define icalproperty_get_scheduleagent_parameter(prop) \ - icalproperty_get_first_parameter(prop, ICAL_SCHEDULEAGENT_PARAMETER) +#define icalparameter_get_scheduleagent(param) ICAL_SCHEDULEAGENT_NONE -#define icalproperty_get_scheduleforcesend_parameter(prop) \ - icalproperty_get_first_parameter(prop, ICAL_SCHEDULEFORCESEND_PARAMETER) +#define icalparameter_get_scheduleforcesend(param) ICAL_SCHEDULEFORCESEND_NONE -#define icalproperty_get_schedulestatus_parameter(prop) \ - icalproperty_get_first_parameter(prop, ICAL_SCHEDULESTATUS_PARAMETER) +#define icalparameter_new_schedulestatus(stat) NULL; \ + (void) stat /* silence compiler */ + +#define icalproperty_get_scheduleagent_parameter(prop) NULL + +#define icalproperty_get_scheduleforcesend_parameter(prop) NULL + +#define icalproperty_get_schedulestatus_parameter(prop) NULL #endif /* HAVE_SCHEDULING_PARAMS */ @@ -660,6 +676,7 @@ caldav_init(); +#ifdef HAVE_IANA_PARAMS config_allowsched = config_getenum(IMAPOPT_CALDAV_ALLOWSCHEDULING); if (config_allowsched) { namespace_calendar.allow |= ALLOW_CAL_SCHED; @@ -669,6 +686,7 @@ ical_set_unknown_token_handling_setting(ICAL_ASSUME_IANA_TOKEN); #endif } +#endif /* HAVE_IANA_PARAMS */ #ifdef HAVE_TZ_BY_REF if (namespace_timezone.enabled) { @@ -2638,13 +2656,12 @@ #ifdef HAVE_RSCALE /* Make sure we support the provided RSCALE in an RRULE */ prop = icalcomponent_get_first_property(comp, ICAL_RRULE_PROPERTY); - if (prop) { + if (prop && rscale_calendars) { struct icalrecurrencetype rt = icalproperty_get_rrule(prop); - if (*rt.rscale) { - UEnumeration *en; - UErrorCode stat = U_ZERO_ERROR; - const char *rscale; + if (rt.rscale) { + /* Perform binary search on sorted icalarray */ + unsigned found = 0, start = 0, end = rscale_calendars->num_elements; ucase(rt.rscale); while (!found && start < end) { @@ -2656,9 +2673,8 @@ else if (r < 0) end = mid; else start = mid + 1; } - uenum_close(en); - if (!rscale) { + if (!found) { txn->error.precond = CALDAV_SUPP_RSCALE; ret = HTTP_FORBIDDEN; goto done; @@ -3508,19 +3524,18 @@ if (!fctx->req_tgt->collection) return HTTP_NOT_FOUND; - r = annotatemore_lookupmask(fctx->mailbox->name, prop_annot, httpd_userid, &attrib); + r = annotatemore_lookupmask(fctx->mailbox->name, prop_annot, + httpd_userid, &attrib); if (r) return HTTP_SERVER_ERROR; if (attrib.len) { types = strtoul(buf_cstring(&attrib), NULL, 10); } else { - const char **hdr = spool_getheader(fctx->req_hdrs, "User-Agent"); - types = -1; /* ALL components types */ - /* XXX iOS/8 doesn't like VPOLL */ - if (hdr && strstr(hdr0, "iOS/8")) types &= ~CAL_COMP_VPOLL; + /* Apple clients don't like VPOLL */ + types &= ~CAL_COMP_VPOLL; } buf_free(&attrib); @@ -4340,26 +4355,22 @@ if (fctx->req_tgt->resource) return HTTP_NOT_FOUND; -#ifdef HAVE_RSCALE - if (icalrecur_rscale_token_handling_is_supported()) { + if (rscale_calendars) { xmlNodePtr top; - UEnumeration *en; - UErrorCode status = U_ZERO_ERROR; - const char *rscale; + int i, n; top = xml_add_prop(HTTP_OK, fctx->nsNS_DAV, &propstatPROPSTAT_OK, name, ns, NULL, 0); - en = ucal_getKeywordValuesForLocale("calendar", NULL, FALSE, &status); - while ((rscale = uenum_next(en, NULL, &status))) { + for (i = 0, n = rscale_calendars->num_elements; i < n; i++) { + const char **rscale = icalarray_element_at(rscale_calendars, i); + xmlNewChild(top, fctx->nsNS_CALDAV, - BAD_CAST "supported-rscale", BAD_CAST rscale); + BAD_CAST "supported-rscale", BAD_CAST *rscale); } - uenum_close(en); return 0; } -#endif return HTTP_NOT_FOUND; }
View file
cyrus-imapd-2.5.7.tar.gz/imap/httpd.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/httpd.c
Changed
@@ -283,8 +283,10 @@ &namespace_principal, &namespace_calendar, &namespace_addressbook, +#ifdef HAVE_IANA_PARAMS &namespace_ischedule, &namespace_domainkey, +#endif /* HAVE_IANA_PARAMS */ #endif /* WITH_DAV */ &namespace_rss, &namespace_dblookup,
View file
cyrus-imapd-2.5.7.tar.gz/imap/imap_proxy.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/imap_proxy.c
Changed
@@ -93,6 +93,7 @@ { "IDLE", CAPA_IDLE }, { "MUPDATE", CAPA_MUPDATE }, { "MULTIAPPEND", CAPA_MULTIAPPEND }, + { "METADATA", CAPA_METADATA }, { "RIGHTS=kxte", CAPA_ACLRIGHTS }, { "LIST-EXTENDED", CAPA_LISTEXTENDED }, { "SASL-IR", CAPA_SASL_IR }, @@ -1248,7 +1249,9 @@ const strarray_t *attribute_pat) { struct backend *be; - int i; + int x, y; + int use_metadata = 0; + char mytag128; assert(server && mbox_pat && entry_pat && attribute_pat); @@ -1256,17 +1259,61 @@ be = proxy_findserver(server, &imap_protocol, proxy_userid, &backend_cached, &backend_current, &backend_inbox, imapd_in); + if (!be) return IMAP_SERVER_UNAVAILABLE; + // See if we would want to use METADATA at all, by testing the 'attribute + // pattern' to be either the draft ANNOTATEMORE or the METADATA RFC. + for (x = 0 ; x < attribute_pat->count ; x++) { + if (!strncmp(attribute_pat->datax, "/shared", 7)) { + use_metadata = 1; + } + + else if (!strncmp(attribute_pat->datax, "/private", 8)) { + use_metadata = 1; + } + } + /* Send command to remote */ proxy_gentag(mytag, sizeof(mytag)); - prot_printf(be->out, "%s GETANNOTATION \"%s\" (", mytag, mbox_pat); - for (i = 0 ; i < entry_pat->count ; i++) { - prot_printf(be->out, "%s\"%s\"", i ? " " : "", entry_pat->datai); + + if (!CAPA(be, CAPA_METADATA) && use_metadata) { + syslog( + LOG_WARNING, + "METADATA requested, but '%s' does not have the capability", + server + ); + } + + if (CAPA(be, CAPA_METADATA) && use_metadata) { + prot_printf(be->out, "%s GETMETADATA (DEPTH infinity) ", mytag); + prot_printf(be->out, "\"%s\" (", mbox_pat); + + for (x = 0 ; x < attribute_pat->count ; x++) { + for (y = 0 ; y < entry_pat->count ; y++) { + prot_printf( + be->out, + "%s\"%s%s\"", + (x || y) ? " ": "", + attribute_pat->datax, + entry_pat->datay + ); + } + } } - prot_printf(be->out, ") ("); - for (i = 0 ; i < attribute_pat->count ; i++) { - prot_printf(be->out, "%s\"%s\"", i ? " " : "", attribute_pat->datai); + + else { + prot_printf(be->out, "%s GETANNOTATION \"%s\" (", mytag, mbox_pat); + + for (y = 0 ; y < entry_pat->count ; y++) { + prot_printf(be->out, "%s\"%s\"", y ? " " : "", entry_pat->datay); + } + + prot_printf(be->out, ") ("); + + for (x = 0 ; x < attribute_pat->count ; x++) { + prot_printf(be->out, "%s\"%s\"", x ? " " : "", attribute_pat->datax); + } } prot_printf(be->out, ")\r\n"); prot_flush(be->out); @@ -1369,22 +1416,25 @@ if (be) { uint64_t server_available = 0; uint64_t server_total = 0; + const char *annot = + (part_list->mode == PART_SELECT_MODE_FREESPACE_MOST) ? + "freespace/total" : "freespace/percent/most"; + struct buf cmd = BUF_INITIALIZER; int c; /* fetch annotation from remote */ proxy_gentag(mytag, sizeof(mytag)); - if (part_list->mode == PART_SELECT_MODE_FREESPACE_MOST) { - prot_printf(be->out, - "%s GETANNOTATION \"\" " - "\"/vendor/cmu/cyrus-imapd/freespace/total\" " - "\"value.shared\"\r\n", mytag); + + if (CAPA(be, CAPA_METADATA)) { + buf_printf(&cmd, "METADATA \"\" (\"/shared/vendor/cmu/cyrus-imapd/%s\"", + annot); } else { - prot_printf(be->out, - "%s GETANNOTATION \"\" " - "\"/vendor/cmu/cyrus-imapd/freespace/percent/most\" " - "\"value.shared\"\r\n", mytag); + buf_printf(&cmd, "ANNOTATION \"\" \"/vendor/cmu/cyrus-imapd/%s\" " + "(\"value.shared\"", annot); } + + prot_printf(be->out, "%s GET%s)\r\n", mytag, buf_cstring(&cmd)); prot_flush(be->out); for (/* each annotation response */;;) { @@ -1394,17 +1444,8 @@ c = prot_getc(be->in); if (c != ' ') { /* protocol error */ c = EOF; break; } - if (part_list->mode == PART_SELECT_MODE_FREESPACE_MOST) { - c = chomp(be->in, - "ANNOTATION \"\" " - "\"/vendor/cmu/cyrus-imapd/freespace/total\" " - "(\"value.shared\" "); - } else { - c = chomp(be->in, - "ANNOTATION \"\" " - "\"/vendor/cmu/cyrus-imapd/freespace/percent/most\" " - "(\"value.shared\" "); - } + c = chomp(be->in, buf_cstring(&cmd)); + if (c == ' ') c = prot_getc(be->in); if ((c == EOF) || (c != '\"')) { /* we don't care about this response */ eatline(be->in, c); @@ -1420,6 +1461,7 @@ if (c != '\"') { c = EOF; break; } eatline(be->in, c); /* we don't care about the rest of the line */ } + buf_free(&cmd); if (c != EOF) { prot_ungetc(c, be->in);
View file
cyrus-imapd-2.5.7.tar.gz/imap/imap_proxy.h -> cyrus-imapd-2.5.8.12.tar.gz/imap/imap_proxy.h
Changed
@@ -62,7 +62,8 @@ CAPA_MULTIAPPEND = (1 << 5), CAPA_ACLRIGHTS = (1 << 6), CAPA_LISTEXTENDED = (1 << 7), - CAPA_SASL_IR = (1 << 8) + CAPA_SASL_IR = (1 << 8), + CAPA_METADATA = (1 << 9) }; extern struct protocol_t imap_protocol;
View file
cyrus-imapd-2.5.7.tar.gz/imap/imapd.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/imapd.c
Changed
@@ -8136,11 +8136,7 @@ strarray_append(entries, arg.s); - // It is only not a list if there are wildcards, - // otherwise it's just a list of 1 item - if (strchr(arg.s, '*') || strchr(arg.s, '%')) { - *is_list = 0; - } + *is_list = 0; } if (c == ' ' || c == '\r') return c; @@ -8879,8 +8875,8 @@ } } - if (have_private) strarray_append(&newa, "value.priv"); - if (have_shared) strarray_append(&newa, "value.shared"); + if (have_private) strarray_append(&newa, "/private"); + if (have_shared) strarray_append(&newa, "/shared"); astate = annotate_state_new(); annotate_state_set_auth(astate, @@ -10032,11 +10028,31 @@ { const char *minor; + /* IMPORTANT: + * + * When adding checks for new versions, you must also backport these + * checks to previous versions (especially 2.4 and 2.5). + * + * Otherwise, old versions will be unable to recognise the new version, + * assume it is ancient, and downgrade the index to the oldest version + * supported (version 6, prior to v2.3). + */ + + /* It's like looking in the mirror and not suffering from schizophrenia */ + if (strstr(be->banner, cyrus_version())) { + return MAILBOX_MINOR_VERSION; + } + /* master branch? */ - if (strstr(be->banner, "git3.0")) { + if (strstr(be->banner, "Cyrus IMAP 3.0")) { return 13; } + /* version 3.0.* is 13 */ + if (strstr(be->banner, "3.0.")) { + return 13; + } + /* version 2.5 is 13 */ if (strstr(be->banner, "Cyrus IMAP 2.5.") || strstr(be->banner, "Cyrus IMAP Murder 2.5.") @@ -10476,34 +10492,46 @@ return 0; } -static int xfer_setquotaroot(struct xfer_header *xfer, const char *mboxname) +static int xfer_setquotaroots(struct xfer_header *xfer) { + struct xfer_item *item; struct quota q; int r; - char extnameMAX_MAILBOX_NAME; - (*imapd_namespace.mboxname_toexternal)(&imapd_namespace, mboxname, - imapd_userid, extname); - - quota_init(&q, mboxname); - r = quota_read(&q, NULL, 0); - if (r == IMAP_QUOTAROOT_NONEXISTENT) return 0; - if (r) return r; - - /* note use of + to force the setting of a nonexistant - * quotaroot */ - prot_printf(xfer->be->out, "Q01 SETQUOTA {" SIZE_T_FMT "+}\r\n+%s ", - strlen(extname)+1, extname); - print_quota_limits(xfer->be->out, &q); - prot_printf(xfer->be->out, "\r\n"); - quota_free(&q); - - r = getresult(xfer->be->in, "Q01"); - if (r) syslog(LOG_ERR, - "Could not move mailbox: %s, " \ - "failed setting initial quota root\r\n", - mboxname); - return r; + for (item = xfer->items; item; item = item->next) { + quota_init(&q, item->mbentry->name); + + r = quota_read(&q, NULL, 0); + + if (r == IMAP_QUOTAROOT_NONEXISTENT) { + quota_free(&q); + continue; + } + + if (r) { + quota_free(&q); + return r; + } + + /* note use of + to force the setting of a nonexistant + * quotaroot */ + prot_printf(xfer->be->out, "Q01 SETQUOTA {" SIZE_T_FMT "+}\r\n+%s ", + strlen(item->extname)+1, item->extname); + print_quota_limits(xfer->be->out, &q); + prot_printf(xfer->be->out, "\r\n"); + quota_free(&q); + + r = getresult(xfer->be->in, "Q01"); + if (r) { + syslog(LOG_ERR, + "Could not move mailbox: %s, " \ + "failed setting quota root\r\n", + item->mbentry->name); + return r; + } + } + + return 0; } static int xfer_addsubmailboxes(struct xfer_header *xfer, const char *mboxname) @@ -10613,14 +10641,14 @@ goto done; } - /* set the quotaroot if needed */ - r = xfer_setquotaroot(xfer, mailboxname); - if (r) goto done; - /* add all submailboxes to the move list as well */ r = xfer_addsubmailboxes(xfer, mailboxname); if (r) goto done; + /* set quotaroots if needed */ + r = xfer_setquotaroots(xfer); + if (r) goto done; + /* backport the seen file if needed */ if (xfer->remoteversion < 12) { r = seen_open(userid, SEEN_CREATE, &xfer->seendb); @@ -11824,14 +11852,26 @@ if (listargs->cmd & LIST_CMD_LSUB) { prot_printf(backend_inbox->out, "%s Lsub ", tag); } else { - prot_printf(backend_inbox->out, "%s List (subscribed", tag); - if (listargs->sel & LIST_SEL_REMOTE) { - prot_printf(backend_inbox->out, " remote"); - } - if (listargs->sel & LIST_SEL_RECURSIVEMATCH) { - prot_printf(backend_inbox->out, " recursivematch"); + const char *select_opts = { + /* XXX MUST be in same order as LIST_SEL_* bitmask */ + "subscribed", "remote", "recursivematch", + "special-use", NULL + }; + char c = '('; + int i; + + prot_printf(backend_inbox->out, "%s List ", tag); + + for (i = 0; select_optsi; i++) { + unsigned opt = (1 << i); + + if (!(listargs->sel & opt)) continue; + + prot_printf(backend_inbox->out, "%c%s", c, select_optsi); + c = ' '; } - prot_printf(backend_inbox->out, ") "); + + prot_puts(backend_inbox->out, ") "); } /* print reference argument */ @@ -11850,23 +11890,56 @@ } (void)prot_putc(')', backend_inbox->out); } else { - prot_printf(backend_inbox->out, + prot_printf(backend_inbox->out, "{%tu+}\r\n%s", strlen(listargs->pat.data0), listargs->pat.data0); } /* print list return options */ if (listargs->ret) { + const char *return_opts = { + /* XXX MUST be in same order as LIST_RET_* bitmask */ + "subscribed", "children", "special-use", + "status ", "myrights", NULL + }; char c = '('; + int i,j; - prot_printf(backend_inbox->out, " return "); - if (listargs->ret & LIST_RET_SUBSCRIBED) { - prot_printf(backend_inbox->out, "%csubscribed", c); + prot_puts(backend_inbox->out, " return "); + for (i = 0; return_optsi; i++) { + unsigned opt = (1 << i); + + if (!(listargs->ret & opt)) continue; + + prot_printf(backend_inbox->out, "%c%s", c, return_optsi); c = ' '; + + if (opt == LIST_RET_STATUS) { + /* print status items */ + const char *status_items = { + /* XXX MUST be in same order as STATUS_* bitmask */ + "messages", "recent", "uidnext", "uidvalidity", "unseen", + "highestmodseq", NULL + }; + + c = '('; + + for (j = 0; status_itemsj; j++) { + if (!(listargs->statusitems & (1 << j))) continue; + + prot_printf(backend_inbox->out, "%c%s", c, + status_itemsj); + c = ' '; + } + + (void)prot_putc(')', backend_inbox->out); + + } } - if (listargs->ret & LIST_RET_CHILDREN) { - prot_printf(backend_inbox->out, "%cchildren", c); + if (listargs->ret & LIST_RET_SPECIALUSE) { + prot_printf(backend_inbox->out, "%cspecial-use", c); c = ' '; } + (void)prot_putc(')', backend_inbox->out); }
View file
cyrus-imapd-2.5.7.tar.gz/imap/imapd.h -> cyrus-imapd-2.5.8.12.tar.gz/imap/imapd.h
Changed
@@ -277,6 +277,7 @@ STATUS_UIDVALIDITY = (1<<3), STATUS_UNSEEN = (1<<4), STATUS_HIGHESTMODSEQ = (1<<5) + /* XXX New items MUST be handled in imapd.c:list_data_remote() */ }; /* Arguments to List functions */ @@ -305,6 +306,7 @@ LIST_SEL_REMOTE = (1<<1), LIST_SEL_RECURSIVEMATCH = (1<<2), LIST_SEL_SPECIALUSE = (1<<3) + /* XXX New options MUST be handled in imapd.c:list_data_remote() */ }; /* Bitmask for List return options */ @@ -314,6 +316,7 @@ LIST_RET_SPECIALUSE = (1<<2), LIST_RET_STATUS = (1<<3), LIST_RET_MYRIGHTS = (1<<4) + /* XXX New options MUST be handled in imapd.c:list_data_remote() */ }; /* Bitmask for List name attributes */
View file
cyrus-imapd-2.5.7.tar.gz/imap/jcal.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/jcal.c
Changed
@@ -249,9 +249,11 @@ kind_string = icalparameter_get_xname(param); break; +#ifdef HAVE_IANA_PARAMS case ICAL_IANA_PARAMETER: kind_string = icalparameter_get_iana_name(param); break; +#endif default: kind_string = icalparameter_kind_to_string(kind); @@ -445,50 +447,41 @@ } -struct icalrecur_parser { - const char* rule; - char* copy; - char* this_clause; - char* next_clause; - - struct icalrecurrencetype rt; -}; - -extern icalrecurrencetype_frequency icalrecur_string_to_freq(const char* str); -extern void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array, - int size, char* vals); -extern void icalrecur_add_bydayrules(struct icalrecur_parser *parser, - const char* vals); - -static const char *_json_x_value(json_t *jvalue) +static void buf_appendjson(struct buf *buf, json_t *jvalue) { - static char buf21; + switch (json_typeof(jvalue)) { + case JSON_ARRAY: { + size_t i, n = json_array_size(jvalue); + const char *sep = ""; - if (json_is_integer(jvalue)) { - snprintf(buf, sizeof(buf), "%" JSON_INTEGER_FORMAT, - json_integer_value(jvalue)); - return buf; + for (i = 0; i < n; i++, sep = ",") { + buf_appendcstr(buf, sep); + buf_appendjson(buf, json_array_get(jvalue, i)); + } + break; } - else return json_string_value(jvalue); -} -static const char *json_x_value(json_t *jvalue) -{ - static struct buf buf = BUF_INITIALIZER; + case JSON_STRING: + buf_appendcstr(buf, json_string_value(jvalue)); + break; - if (json_is_array(jvalue)) { - size_t i, n = json_array_size(jvalue); - const char *sep = ""; + case JSON_INTEGER: + buf_printf(buf, "%" JSON_INTEGER_FORMAT, json_integer_value(jvalue)); + break; - buf_reset(&buf); - for (i = 0; i < n; i++) { - buf_printf(&buf, "%s%s", - sep, _json_x_value(json_array_get(jvalue, i))); - sep = ","; - } - return buf_cstring(&buf); + case JSON_REAL: + buf_printf(buf, "%f", json_real_value(jvalue)); + break; + + case JSON_TRUE: + case JSON_FALSE: + buf_printf(buf, "%d", json_boolean_value(jvalue)); + break; + + default: + /* Shouldn't get here - ignore object */ + break; } - else return _json_x_value(jvalue); } @@ -548,24 +541,30 @@ break; case ICAL_RECUR_VALUE: - if (json_is_object(jvalue)) { - struct icalrecurrencetype *rt = NULL; - const char *key; - json_t *val; - - json_object_foreach(jvalue, key, val) { - rt = icalrecur_add_rule(&rt, key, val, - (int (*)(void *)) &json_integer_value, - (const char * (*)(void *)) &json_x_value); - if (!rt) break; - } - - if (rt && rt->freq != ICAL_NO_RECURRENCE) - value = icalvalue_new_recur(*rt); - } - else - syslog(LOG_WARNING, "jCal object object expected"); - break; + if (json_is_object(jvalue)) { + struct buf rrule = BUF_INITIALIZER; + struct icalrecurrencetype rt; + const char *key, *sep = ""; + json_t *val; + + /* create an iCal RRULE string from jCal 'recur' object */ + json_object_foreach(jvalue, key, val) { + char *mykey = xstrdup(key); + buf_printf(&rrule, "%s%s=", sep, ucase(mykey)); + buf_appendjson(&rrule, val); + sep = ";"; + free(mykey); + } + + /* parse our iCal RRULE string */ + rt = icalrecurrencetype_from_string(buf_cstring(&rrule)); + buf_free(&rrule); + + if (rt.freq != ICAL_NO_RECURRENCE) value = icalvalue_new_recur(rt); + } + else + syslog(LOG_WARNING, "jCal object object expected"); + break; case ICAL_REQUESTSTATUS_VALUE: /* MUST be an array of 2-3 strings */
View file
cyrus-imapd-2.5.7.tar.gz/imap/mbdump.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/mbdump.c
Changed
@@ -816,6 +816,14 @@ return 0; } +struct annotation_entry_t +{ + struct annotation_entry_t *next; + char *name; + char *userid; + struct buf content; +}; + EXPORTED int undump_mailbox(const char *mbname, struct protstream *pin, struct protstream *pout, struct auth_state *auth_state __attribute((unused))) @@ -828,14 +836,15 @@ const char *sieve_path = NULL; int sieve_usehomedir = config_getswitch(IMAPOPT_SIEVEUSEHOMEDIR); const char *userid = NULL; - char *annotation = NULL; + int first_annotation = 1; + struct annotation_entry_t *annotation = NULL; struct buf content = BUF_INITIALIZER; char *seen_file = NULL; char *mboxkey_file = NULL; quota_t old_quota_usageQUOTA_NUMRESOURCES; int res; quota_t newquotasQUOTA_NUMRESOURCES; - quota_t quotalimit = -1; + quota_t quotalimit = -2; annotate_state_t *astate = NULL; memset(&file, 0, sizeof(file)); @@ -861,7 +870,7 @@ eatline(pin, c); return IMAP_PROTOCOL_BAD_PARAMETERS; } - + /* We should now have a number or a NIL */ c = getword(pin, &data); if (!strcmp(data.s, "NIL")) { @@ -884,7 +893,7 @@ } else if(c == ')') { goto done; } - + r = mailbox_open_exclusive(mbname, &mailbox); if (r == IMAP_MAILBOX_NONEXISTENT) { mbentry_t *mbentry = NULL; @@ -899,21 +908,16 @@ /* track quota use */ mailbox_get_usage(mailbox, old_quota_usage); - astate = annotate_state_new(); - r = annotate_state_set_mailbox(astate, mailbox); - if (r) goto done; - while(1) { char fnamebufMAX_MAILBOX_PATH + 1024; int isnowait, sawdigit; unsigned long size; unsigned long cutoff = ULONG_MAX / 10; unsigned digit, cutlim = ULONG_MAX % 10; - annotation = NULL; buf_reset(&content); seen_file = NULL; mboxkey_file = NULL; - + c = getastring(pin, pout, &file); if(c != ' ') { r = IMAP_PROTOCOL_ERROR; @@ -922,8 +926,28 @@ if(!strncmp(file.s, "A-", 2)) { /* Annotation */ + struct annotation_entry_t *prev = annotation; int i; - char *tmpuserid; + + annotation = xmalloc(sizeof(struct annotation_entry_t)); + memset(annotation, 0, sizeof(struct annotation_entry_t)); + buf_reset(&annotation->content); + annotation->next = prev; + + /* is this the first annotation? re-read cyrus.header/index */ + if (first_annotation) { + first_annotation = 0; + mailbox_close(&mailbox); + r = mailbox_open_exclusive(mbname, &mailbox); + if (r) goto done; + + if (!astate) { + astate = annotate_state_new(); + } + + r = annotate_state_set_mailbox(astate, mailbox); + if (r) goto done; + } for(i=2; file.si; i++) { if(file.si == '/') break; @@ -932,53 +956,41 @@ r = IMAP_PROTOCOL_ERROR; goto done; } - tmpuserid = xmalloc(i-2+1); - - memcpy(tmpuserid, &(file.s2), i-2); - tmpuseridi-2 = '\0'; - - annotation = xstrdup(&(file.si)); + annotation->userid = xmalloc(i-2+1); + memset(annotation->userid, 0, i-2+1); + + memcpy(annotation->userid, &(file.s2), i-2); + + annotation->name = xstrdup(&(file.si)); if(prot_getc(pin) != '(') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; - } + } /* Parse the modtime...and ignore it */ c = getword(pin, &data); if (c != ' ') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; } - c = getbastring(pin, pout, &content); + c = getbastring(pin, pout, &annotation->content); /* xxx binary */ if(c != ' ') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; } /* got the contenttype...and ignore it */ c = getastring(pin, pout, &data); - + if(c != ')') { r = IMAP_PROTOCOL_ERROR; - free(tmpuserid); goto done; } - annotate_state_write(astate, annotation, tmpuserid, - &content); - - free(tmpuserid); - free(annotation); - annotation = NULL; - buf_reset(&content); - c = prot_getc(pin); if(c == ')') break; /* that was the last item */ else if(c != ' ') { @@ -1229,24 +1241,48 @@ buf_free(&file); buf_free(&data); - if (r) - annotate_state_abort(&mailbox->annot_state); - if (curfile >= 0) close(curfile); /* we fiddled the files under the hood, so we can't do anything * BUT close it */ mailbox_close(&mailbox); /* time to apply quota (mailbox must be unlocked) */ - if (!r) { - for (res = 0; res < QUOTA_NUMRESOURCES; res++) { - if (newquotasres != QUOTA_UNLIMITED) { - break; - } - } - if (res < QUOTA_NUMRESOURCES) { - mboxlist_setquotas(mbname, newquotas, 0); - } + if (!r && quotalimit != -2) + mboxlist_setquotas(mbname, newquotas, 0); + + /* write annotations */ + if (!r && annotation) { + r = mailbox_open_iwl(mbname, &mailbox); + if (r) goto done2; + + mailbox->i.quota_annot_used = 0; + + astate = annotate_state_new(); + r = annotate_state_set_mailbox(astate, mailbox); + if (r) goto done2; + + while (annotation) { + struct annotation_entry_t *next = annotation->next; + + r = annotate_state_write(astate, annotation->name, + annotation->userid, + &annotation->content); + if (r) goto done2; + + old_quota_usageQUOTA_ANNOTSTORAGE += annotation->content.len; + + free(annotation->name); + free(annotation->userid); + buf_free(&annotation->content); + free(annotation); + + annotation = next; + } + + r = annotate_state_commit(&astate); + astate = NULL; + + mailbox_close(&mailbox); } /* let's make sure the modification times are right */ @@ -1300,12 +1336,10 @@ done2: /* just in case we failed during the modifications, close again */ mailbox_close(&mailbox); - if (!r) - r = annotate_state_commit(&astate); - else + + if (astate) annotate_state_abort(&astate); - free(annotation); - buf_free(&content); + free(seen_file); free(mboxkey_file);
View file
cyrus-imapd-2.5.7.tar.gz/imap/mboxlist.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/mboxlist.c
Changed
@@ -1327,6 +1327,7 @@ int local_only, int forceuser, int ignorequota) { int r; + int mupdatecommiterror = 0; long myrights; int isusermbox = 0; /* Are we renaming someone's inbox */ int partitionmove = 0; @@ -1530,6 +1531,7 @@ syslog(LOG_ERR, "MUPDATE: can't commit mailbox entry for '%s'", newname); + mupdatecommiterror = r; } if (mupdate_h) mupdate_disconnect(&mupdate_h); free(loc); @@ -1540,7 +1542,37 @@ r = mailbox_commit(newmailbox); if (r) { - /* XXX - rollback DB changes if it was an mupdate failure */ + /* rollback DB changes if it was an mupdate failure */ + if (mupdatecommiterror) { + r = 0; + + /* recreate an old entry */ + if (!isusermbox) + r = cyrusdb_store(mbdb, oldname, strlen(oldname), + mboxent, strlen(mboxent), &tid); + + /* delete the new entry */ + if (!r) + r = cyrusdb_delete(mbdb, newname, strlen(newname), &tid, 0); + + /* Commit transaction */ + if (!r) + r = cyrusdb_commit(mbdb, tid); + + tid = NULL; + if (r) { + /* XXX HOWTO repair this mess! */ + syslog(LOG_ERR, "DBERROR: failed DB rollback on mailboxrename %s %s: %s", + oldname, newname, cyrusdb_strerror(r)); + syslog(LOG_ERR, "DBERROR: mailboxdb on mupdate and backend ARE NOT CONSISTENT"); + syslog(LOG_ERR, "DBERROR: mailboxdb on mupdate has entry for %s, mailboxdb on backend has entry for %s and files are on the old position", oldname, newname); + r = IMAP_IOERROR; + } else { + r = mupdatecommiterror; + } + + } + if (newmailbox) mailbox_delete(&newmailbox); if (partitionmove && newpartition) mailbox_delete_cleanup(newpartition, newname);
View file
cyrus-imapd-2.5.7.tar.gz/imap/mboxname.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/mboxname.c
Changed
@@ -1275,13 +1275,10 @@ name++; /* Skip over terminating '-' */ } else { - /* If we're using unixhierarchysep, DOTCHAR is allowed */ if (!strchr(GOODCHARS, *name) && + /* If we're using unixhierarchysep, DOTCHAR is allowed */ !(unixsep && *name == DOTCHAR)) return IMAP_MAILBOX_BADNAME; - /* If we're not using virtdomains, '@' is not permitted in the mboxname */ - if (!config_virtdomains && *name == '@') - return IMAP_MAILBOX_BADNAME; name++; sawutf7 = 0; }
View file
cyrus-imapd-2.5.7.tar.gz/imap/mupdate.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/mupdate.c
Changed
@@ -1600,33 +1600,55 @@ EXISTS, NOTACTIVE, DOESNTEXIST, ISOK, NOOUTPUT } msg = NOOUTPUT; - syslog(LOG_DEBUG, "cmd_set(fd:%d, %s)", C->fd, mailbox); + syslog(LOG_DEBUG, "cmd_set(fd:%d, %s, %d)", C->fd, mailbox, t); pthread_mutex_lock(&mailboxes_mutex); /* LOCK */ m = database_lookup(mailbox, NULL); if (m && t == SET_RESERVE) { + /* Check if we run in a discrete murder topology */ if (config_mupdate_config == IMAP_ENUM_MUPDATE_CONFIG_STANDARD) { - /* failed; mailbox already exists */ - msg = EXISTS; - goto done; + /* Replicated backends with the same server name issue + * reservations twice. Suppress bailing out on the second one + * (the replica). + */ + if (strcmp(m->location, location)) { + /* failed; mailbox already exists */ + msg = EXISTS; + goto done; + } } /* otherwise do nothing (local create on master) */ } if ((!m || m->t != SET_ACTIVE) && t == SET_DEACTIVATE) { - /* failed; mailbox not currently active */ - msg = NOTACTIVE; - goto done; + /* Check if we run in a discrete murder topology */ + if (config_mupdate_config == IMAP_ENUM_MUPDATE_CONFIG_STANDARD) { + /* Replicated backends with the same server name issue + * deactivation twice. Suppress bailing out on the second one + * (the replica). + */ + if (strcmp(m->location, location)) { + /* failed; mailbox not currently active */ + msg = NOTACTIVE; + goto done; + } + } } else if (t == SET_DEACTIVATE) { t = SET_RESERVE; } - + if (t == SET_DELETE) { if (!m) { + /* Check if we run in a discrete murder topology */ if (config_mupdate_config == IMAP_ENUM_MUPDATE_CONFIG_STANDARD) { - /* failed; mailbox doesn't exist */ - msg = DOESNTEXIST; + /* Replicated backends with the same server name issue + * deletion twice. Suppress bailing out on the second one + * (the replica). + * + * Note: This implies deleting a non-existing mailbox is OK. + */ + msg = ISOK; goto done; } /* otherwise do nothing (local delete on master) */ @@ -1649,13 +1671,14 @@ m->t = t; } else { struct mbent *newm; - + /* allocate new mailbox */ if (acl) { newm = xrealloc(m, sizeof(struct mbent) + strlen(acl)); } else { newm = xrealloc(m, sizeof(struct mbent) + 1); } + newm->mailbox = xstrdup(mailbox); newm->location = xstrdup(location); @@ -1714,7 +1737,7 @@ break; default: break; - } + } } static void cmd_find(struct conn *C, const char *tag, const char *mailbox,
View file
cyrus-imapd-2.5.7.tar.gz/imap/protocol.h -> cyrus-imapd-2.5.8.12.tar.gz/imap/protocol.h
Changed
@@ -54,7 +54,7 @@ struct stdprot_t; struct backend; -#define MAX_CAPA 9 +#define MAX_CAPA 10 enum { /* generic capabilities */
View file
cyrus-imapd-2.5.7.tar.gz/imap/sync_client.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/sync_client.c
Changed
@@ -2621,6 +2621,10 @@ /* Check for shutdown file */ if (sync_shutdown_file && !stat(sync_shutdown_file, &sbuf)) { unlink(sync_shutdown_file); + /* Have to exit with r == 0 or do_daemon() will call us again. + * The value of r is unknown from calls to sync_log_reader_begin() below. + */ + r = 0; break; }
View file
cyrus-imapd-2.5.7.tar.gz/imap/xcal.c -> cyrus-imapd-2.5.8.12.tar.gz/imap/xcal.c
Changed
@@ -56,14 +56,6 @@ #include "xcal.h" -extern icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind); -extern const char* icalrecur_freq_to_string(icalrecurrencetype_frequency kind); -extern const char* icalrecur_weekday_to_string(icalrecurrencetype_weekday kind); -#ifdef HAVE_RSCALE -extern const char* icalrecur_skip_to_string(icalrecurrencetype_skip kind); -#endif - - /* * Determine the type (kind) of an iCalendar property value. */ @@ -160,34 +152,6 @@ } -static const struct { - const char *str; - int limit; - size_t offset; -} recurmap = -{ - { "bysecond", ICAL_BY_SECOND_SIZE, - offsetof(struct icalrecurrencetype, by_second) }, - { "byminute", ICAL_BY_MINUTE_SIZE, - offsetof(struct icalrecurrencetype, by_minute) }, - { "byhour", ICAL_BY_HOUR_SIZE, - offsetof(struct icalrecurrencetype, by_hour) }, - { "byday", ICAL_BY_DAY_SIZE, - offsetof(struct icalrecurrencetype, by_day) }, - { "bymonthday", ICAL_BY_MONTHDAY_SIZE, - offsetof(struct icalrecurrencetype, by_month_day) }, - { "byyearday", ICAL_BY_YEARDAY_SIZE, - offsetof(struct icalrecurrencetype, by_year_day) }, - { "byweekno", ICAL_BY_WEEKNO_SIZE, - offsetof(struct icalrecurrencetype, by_week_no) }, - { "bymonth", ICAL_BY_MONTH_SIZE, - offsetof(struct icalrecurrencetype, by_month) }, - { "bysetpos", ICAL_BY_SETPOS_SIZE, - offsetof(struct icalrecurrencetype, by_set_pos) }, - { 0, 0, 0 }, -}; - - /* * Add iCalendar recur-rule-parts to a structured element. */ @@ -196,75 +160,47 @@ void (*add_str)(void *, const char *, const char *)) { - int i, j; - - if (recur->freq == ICAL_NO_RECURRENCE) return; - - add_str(obj, "freq", icalrecur_freq_to_string(recur->freq)); - -#ifdef HAVE_RSCALE - if (*recur->rscale) { - add_str(obj, "rscale", recur->rscale); + char *rrule, *rpart; + tok_t rparts; - if (recur->skip != ICAL_SKIP_BACKWARD) - add_str(obj, "skip", icalrecur_skip_to_string(recur->skip)); - } -#endif - - /* until and count are mutually exclusive */ - if (recur->until.year) { - add_str(obj, "until", icaltime_as_iso_string(recur->until)); - } - else if (recur->count) add_int(obj, "count", recur->count); - - if (recur->interval != 1) add_int(obj, "interval", recur->interval); - - /* Monday is the default, so no need to include it */ - if (recur->week_start != ICAL_MONDAY_WEEKDAY && - recur->week_start != ICAL_NO_WEEKDAY) { - const char *daystr; - - daystr = icalrecur_weekday_to_string( - icalrecurrencetype_day_day_of_week(recur->week_start)); - add_str(obj, "wkst", daystr); + /* generate an iCal RRULE string */ + rrule = icalrecurrencetype_as_string_r(recur); + + /* split string into rparts & values */ + tok_initm(&rparts, rrule, "=;", TOK_TRIMLEFT|TOK_TRIMRIGHT); + while ((rpart = tok_next(&rparts))) { + if (!strcmp(rpart, "UNTIL")) { + /* need to translate date format to ISO */ + struct icaltimetype until = icaltime_from_string(tok_next(&rparts)); + + add_str(obj, "until", icaltime_as_iso_string(until)); + } + else { + /* assume the rpart has multiple values - split them */ + tok_t vlist; + char *val, *p; + + tok_init(&vlist, tok_next(&rparts), ",", + TOK_TRIMLEFT|TOK_TRIMRIGHT); + while ((val = tok_next(&vlist))) { + if (add_int) { + /* try converting value to integer */ + int n = strtol(val, &p, 10); + + if (n && !*p) { + add_int(obj, lcase(rpart), n); + continue; + } + } + + add_str(obj, lcase(rpart), val); + } + tok_fini(&vlist); + } } + tok_fini(&rparts); - /* The BY* parameters can each take a list of values. - * - * Each of the lists is terminated with the value - * ICAL_RECURRENCE_ARRAY_MAX unless the the list is full. - */ - for (j = 0; recurmapj.str; j++) { - short *array = (short *)((size_t) recur + recurmapj.offset); - int limit = recurmapj.limit - 1; - - for (i = 0; i < limit && arrayi != ICAL_RECURRENCE_ARRAY_MAX; i++) { - char temp20; - - if (j == 3) { /* BYDAY */ - const char *daystr; - int pos; - - daystr = icalrecur_weekday_to_string( - icalrecurrencetype_day_day_of_week(arrayi)); - pos = icalrecurrencetype_day_position(arrayi); - - if (pos != 0) { - snprintf(temp, sizeof(temp), "%d%s", pos, daystr); - daystr = temp; - } - - add_str(obj, recurmapj.str, daystr); - } -#ifdef HAVE_RSCALE - else if (j == 7 && ICAL_RSCALE_IS_LEAP_MONTH(arrayi)) { - snprintf(temp, sizeof(temp), "%dL", ICAL_RSCALE_MONTH_NUM(arrayi)); - add_str(obj, recurmapj.str, temp); - } -#endif - else add_int(obj, recurmapj.str, arrayi); - } - } + free(rrule); } @@ -294,15 +230,6 @@ /* * Add an iCalendar recur-rule-part to a XML recur element. */ -static void icalrecur_add_int_as_xml_element(void *xrecur, const char *rpart, - int i) -{ - char ibuf20; - - snprintf(ibuf, sizeof(ibuf), "%d", i); - xmlNewTextChild((xmlNodePtr) xrecur, NULL, BAD_CAST rpart, BAD_CAST ibuf); -} - static void icalrecur_add_string_as_xml_element(void *xrecur, const char *rpart, const char *s) { @@ -327,9 +254,11 @@ kind_string = icalparameter_get_xname(param); break; +#ifdef HAVE_IANA_PARAMS case ICAL_IANA_PARAMETER: kind_string = icalparameter_get_iana_name(param); break; +#endif default: kind_string = icalparameter_kind_to_string(kind); @@ -438,10 +367,9 @@ case ICAL_RECUR_VALUE: { struct icalrecurrencetype recur = icalvalue_get_recur(value); - icalrecurrencetype_add_as_xxx(&recur, xtype, - &icalrecur_add_int_as_xml_element, - &icalrecur_add_string_as_xml_element); - return; + icalrecurrencetype_add_as_xxx(&recur, xtype, NULL, + &icalrecur_add_string_as_xml_element); + return; } case ICAL_REQUESTSTATUS_VALUE: { @@ -662,109 +590,14 @@ } -/* Add an iCalendar recurrence rule part to icalrecurrencetype. - * - * XXX The following structure is opaque libical, but for some stupid - * reason the icalrecur_add_by*rules() functions require it even though - * all they use is the rt field. MUST keep this in sync with icalrecur.c - */ -struct icalrecur_parser { - const char* rule; - char* copy; - char* this_clause; - char* next_clause; - - struct icalrecurrencetype rt; -}; - -extern icalrecurrencetype_frequency icalrecur_string_to_freq(const char* str); -#ifdef HAVE_RSCALE -extern icalrecurrencetype_skip icalrecur_string_to_skip(const char* str); -#endif -extern void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array, - int size, char* vals); -extern void icalrecur_add_bydayrules(struct icalrecur_parser *parser, - const char* vals); - -struct icalrecurrencetype *icalrecur_add_rule(struct icalrecurrencetype **rt, - const char *rpart, void *data, - int (*get_int)(void *), - const char* (*get_str)(void *)) +static void append_byrule(char *byrule, struct buf *vals, struct buf *rrule) { - static struct icalrecur_parser parser; + /* append BY* rule to RRULE buffer */ + buf_printf(rrule, ";%s=%s", ucase(byrule), buf_cstring(vals)); - if (!*rt) { - /* Initialize */ - *rt = &parser.rt; - icalrecurrencetype_clear(*rt); - } - - if (!strcmp(rpart, "freq")) { - (*rt)->freq = icalrecur_string_to_freq(get_str(data)); - } -#ifdef HAVE_RSCALE - else if (!strcmp(rpart, "rscale")) { - (*rt)->rscale = icalmemory_tmp_copy(get_str(data)); - } - else if (!strcmp(rpart, "skip")) { - (*rt)->skip = icalrecur_string_to_skip(get_str(data)); - } -#endif - else if (!strcmp(rpart, "count")) { - (*rt)->count = get_int(data); - } - else if (!strcmp(rpart, "until")) { - (*rt)->until = icaltime_from_string(get_str(data)); - } - else if (!strcmp(rpart, "interval")) { - (*rt)->interval = get_int(data); - if ((*rt)->interval < 1) (*rt)->interval = 1; /* MUST be >= 1 */ - } - else if (!strcmp(rpart, "wkst")) { - (*rt)->week_start = icalrecur_string_to_weekday(get_str(data)); - } - else if (!strcmp(rpart, "byday")) { - icalrecur_add_bydayrules(&parser, get_str(data)); - } - else { - int i; - - for (i = 0; recurmapi.str && strcmp(rpart, recurmapi.str); i++); - - if (recurmapi.str) { - short *array = - (short *)((size_t) *rt + recurmapi.offset); - int limit = recurmapi.limit; - - icalrecur_add_byrules(&parser, array, limit, - icalmemory_tmp_copy(get_str(data))); - } - else { - syslog(LOG_WARNING, "Unknown recurrence rule-part: %s", rpart); - icalrecurrencetype_clear(*rt); - *rt = NULL; - } - } - -#ifdef HAVE_RSCALE - /* When "RSCALE" is not present the default is "YES". - When "RSCALE" is present the default is "BACKWARD". */ - if (!(*rt)->rscale) (*rt)->skip = ICAL_SKIP_YES; - else if ((*rt)->skip == ICAL_SKIP_NO) (*rt)->skip = ICAL_SKIP_BACKWARD; -#endif - - return *rt; -} - - -int xmlElementContent_to_int(void *content) -{ - return atoi((const char *) content); -} - -const char *xmlElementContent_to_str(void *content) -{ - return (const char *) content; + /* free the vals buffer */ + buf_free(vals); + free(vals); } @@ -868,22 +701,57 @@ } case ICAL_RECUR_VALUE: { - struct icalrecurrencetype *rt = NULL; - - for (node = xmlFirstElementChild(xtype); node; - node = xmlNextElementSibling(node)) { - - content = xmlNodeGetContent(node); - rt = icalrecur_add_rule(&rt, (const char *) node->name, content, - &xmlElementContent_to_int, - &xmlElementContent_to_str); - xmlFree(content); - content = NULL; - if (!rt) break; - } - - if (rt && rt->freq != ICAL_NO_RECURRENCE) - value = icalvalue_new_recur(*rt); + struct buf rrule = BUF_INITIALIZER; + struct hash_table byrules; + struct icalrecurrencetype rt; + char *sep = ""; + + construct_hash_table(&byrules, 10, 1); + + /* create an iCal RRULE string from xCal <recur> sub-elements */ + for (node = xmlFirstElementChild(xtype); node; + node = xmlNextElementSibling(node)) { + + content = xmlNodeGetContent(node); + if (!xmlStrncmp(node->name, BAD_CAST "by", 2)) { + /* BY* rules can have a list of values - + assemble them using a hash table */ + struct buf *vals = + hash_lookup((const char *) node->name, &byrules); + + if (vals) { + /* append this value to existing list */ + buf_printf(vals, ",%s", (char *) content); + } + else { + /* create new list with this valiue */ + vals = xzmalloc(sizeof(struct buf)); + buf_setcstr(vals, (char *) content); + hash_insert((char *) node->name, vals, &byrules); + } + } + else { + /* single value rpart */ + buf_printf(&rrule, "%s%s=%s", sep, + ucase((char *) node->name), (char *) content); + sep = ";"; + } + + xmlFree(content); + content = NULL; + } + + /* append the BY* rules to RRULE buffer */ + hash_enumerate(&byrules, + (void (*)(const char*, void*, void*)) &append_byrule, + &rrule); + free_hash_table(&byrules, NULL); + + /* parse our iCal RRULE string */ + rt = icalrecurrencetype_from_string(buf_cstring(&rrule)); + buf_free(&rrule); + + if (rt.freq != ICAL_NO_RECURRENCE) value = icalvalue_new_recur(rt); break; }
View file
cyrus-imapd-2.5.7.tar.gz/lib/imapoptions -> cyrus-imapd-2.5.8.12.tar.gz/lib/imapoptions
Changed
@@ -796,7 +796,7 @@ { "ldap_deref", "never", STRINGLIST("search", "find", "always", "never") } /* Specify how aliases dereferencing is handled during search. */ -{ "ldap_domain_base_dn", "", STRING } +{ "ldap_domain_base_dn", NULL, STRING } /* Base DN to search for domain name spaces. */ { "ldap_domain_filter", "(&(objectclass=domainrelatedobject)(associateddomain=%s))", STRING }
View file
cyrus-imapd-2.5.7.tar.gz/man/cyr_dbtool.8 -> cyrus-imapd-2.5.8.12.tar.gz/man/cyr_dbtool.8
Changed
@@ -48,6 +48,9 @@ .I config-file +.B \-M + + .B \-n @@ -102,6 +105,9 @@ .BI \-C " config-file" Read configuration options from \fIconfig-file\fR. .TP +.BI \-M +Uses improved MBOX list sort. +.TP .BI \-n Create the database file if it doesn't already exist. .TP
View file
cyrus-imapd-2.5.7.tar.gz/man/master.8 -> cyrus-imapd-2.5.8.12.tar.gz/man/master.8
Changed
@@ -144,7 +144,10 @@ rereads its configuration file when it receives a hangup signal, SIGHUP. Services and events may be added, deleted or modified when the configuration file is reread. Any active services removed from the -configuration file will be allowed to run until completion. +configuration file will be allowed to run until completion. Services +added or modified to listen on a privileged port may not be able to +bind the port, depending on your system configuration. In this case a +full restart is needed. .PP .I Master propagates the hangup signal, SIGHUP, to its child service processes, so @@ -155,7 +158,7 @@ file. Children that are servicing a client connection when SIGHUP is received are allowed to run until the client logouts before being recycled. It may take a long time until the client logouts, so a log message is -generated for processes that have not been recycled whithin 30s. +generated for processes that have not been recycled within 30s. .SH NOTES The environment variable \fBCYRUS_VERBOSE\fR can be set to log additional debugging information. Setting the value to 1 results in base level logging.
View file
cyrus-imapd-2.5.7.tar.gz/master/master.c -> cyrus-imapd-2.5.8.12.tar.gz/master/master.c
Changed
@@ -2457,33 +2457,52 @@ } maxfd++; /* need 1 greater than maxfd */ - /* how long to wait? - do now so that any scheduled wakeup - * calls get accounted for*/ - tvptr = NULL; - if (schedule && !in_shutdown) { - double delay = timesub(&now, &schedule->mark); - if (delay > 0.0) { - timeval_set_double(&tv, delay); - } - else { - tv.tv_sec = 0; - tv.tv_usec = 0; + int interrupted = 0; + do { + /* how long to wait? - do now so that any scheduled wakeup + * calls get accounted for*/ + gettimeofday(&now, 0); + tvptr = NULL; + if (schedule && !in_shutdown) { + double delay = timesub(&now, &schedule->mark); + if (!interrupted && delay > 0.0) { + timeval_set_double(&tv, delay); + } + else { + tv.tv_sec = 0; + tv.tv_usec = 0; + } + tvptr = &tv; } - tvptr = &tv; - } #if defined(HAVE_UCDSNMP) || defined(HAVE_NETSNMP) - if (tvptr == NULL) blockp = 1; - snmp_select_info(&maxfd, &rfds, tvptr, &blockp); + if (tvptr == NULL) blockp = 1; + snmp_select_info(&maxfd, &rfds, tvptr, &blockp); #endif - errno = 0; - r = myselect(maxfd, &rfds, NULL, NULL, tvptr); - if (r == -1 && errno == EAGAIN) continue; - if (r == -1 && errno == EINTR) continue; - if (r == -1) { - /* uh oh */ - fatalf(1, "select failed: %m"); - } + errno = 0; + r = myselect(maxfd, &rfds, NULL, NULL, tvptr); + + if (r == -1) { + switch (errno) { + case EAGAIN: + case EINTR: + /* Try again to get valid rfds, this time without blocking so we + * will definitely process messages without getting interrupted + * again. */ + interrupted++; + if (interrupted > 5) { + syslog(LOG_WARNING, "Repeatedly interrupted, too many signals?"); + /* Fake a timeout */ + r = 0; + FD_ZERO(&rfds); + } + break; + default: + /* uh oh */ + fatalf(1, "select failed: %m"); + } + } + } while (!in_shutdown && r == -1); #if defined(HAVE_UCDSNMP) || defined(HAVE_NETSNMP) /* check for SNMP queries */
View file
cyrus-imapd-2.5.7.tar.gz/master/service.c -> cyrus-imapd-2.5.8.12.tar.gz/master/service.c
Changed
@@ -382,10 +382,13 @@ } id = atoi(p); - /* pick a random timeout between reuse_timeout -> 2*reuse_timeout - * to avoid massive IO overload if the network connection goes away */ srand(time(NULL) * getpid()); - reuse_timeout = reuse_timeout + (rand() % reuse_timeout); + + /* if timeout is enabled, pick a random timeout between reuse_timeout + * and 2*reuse_timeout to avoid massive IO overload if the network + * connection goes away */ + if (reuse_timeout) + reuse_timeout = reuse_timeout + (rand() % reuse_timeout); extern const int config_need_data; cyrus_init(alt_config, service, 0, config_need_data);
View file
cyrus-imapd-2.5.7.tar.gz/ptclient/ldap.c -> cyrus-imapd-2.5.8.12.tar.gz/ptclient/ldap.c
Changed
@@ -933,7 +933,7 @@ if (rc != PTSM_OK) return rc; - if (ptsm->domain_base_dn && ptsm->domain_base_dn0 != '\0' && (strrchr(canon_id, '@') != NULL)) { + if (ptsm->domain_base_dn && (strrchr(canon_id, '@') != NULL)) { syslog(LOG_DEBUG, "Attempting to get domain for %s from %s", canon_id, ptsm->domain_base_dn); /* Get the base dn to search from domain_base_dn searched on domain_scope with @@ -1019,7 +1019,7 @@ * the *only* entry found. */ if (ldap_count_entries(ptsm->ld, res) < 1) { - syslog(LOG_ERR, "No entries found"); + syslog(LOG_ERR, "No entries found (%s, %d)", __func__, __LINE__); } else if (ldap_count_entries(ptsm->ld, res) > 1) { syslog(LOG_ERR, "Multiple entries found: %d", ldap_count_entries(ptsm->ld, res)); } else { @@ -1191,17 +1191,70 @@ char *dn = NULL; rc = ptsmodule_connect(); + if (rc != PTSM_OK) { *reply = "ptsmodule_connect() failed"; return rc; } rc = ptsmodule_get_dn(canon_id, size, &dn); + if (rc != PTSM_OK) { *reply = "identifier not found"; return rc; } + rc = ldap_search_st(ptsm->ld, dn, LDAP_SCOPE_BASE, "(objectclass=*)", attrs, 0, &(ptsm->timeout), &res); + + if (rc != LDAP_SUCCESS) { + *reply = "ldap_search(attribute) failed"; + + if ( rc == LDAP_SERVER_DOWN ) { + ldap_unbind(ptsm->ld); + ptsm->ld = NULL; + rc = PTSM_RETRY; + } else { + rc = PTSM_FAIL; + } + + goto done; + } + + int numvals; + + if ((entry = ldap_first_entry(ptsm->ld, res)) != NULL) { + + if ((char *)ptsm->user_attribute) { + vals = ldap_get_values(ptsm->ld, entry, (char *)ptsm->user_attribute); + + if (vals != NULL) { + numvals = ldap_count_values(vals); + + if (numvals == 1) { + if (!*newstate) { + *dsize = sizeof(struct auth_state); + *newstate = xmalloc(*dsize); + + if (*newstate == NULL) { + *reply = "no memory"; + rc = PTSM_FAIL; + goto done; + } + + (*newstate)->ngroups = 0; + } + + size = strlen(vals0); + strcpy((*newstate)->userid.id, ptsmodule_canonifyid(vals0, size)); + (*newstate)->userid.hash = strhash((*newstate)->userid.id); + } + + ldap_value_free(vals); + vals = NULL; + } + } + } + rc = ptsmodule_expand_tokens(ptsm->member_filter, canon_id, dn, &filter); if (rc != PTSM_OK) { *reply = "ptsmodule_expand_tokens() failed for member filter"; @@ -1227,6 +1280,7 @@ } n = ldap_count_entries(ptsm->ld, res); + if (n < 0) { *reply = "ldap_count_entries() failed"; rc = PTSM_FAIL; @@ -1235,45 +1289,51 @@ *dsize = sizeof(struct auth_state) + (n * sizeof(struct auth_ident)); + *newstate = xmalloc(*dsize); + if (*newstate == NULL) { *reply = "no memory"; rc = PTSM_FAIL; goto done; } + + size = strlen(canon_id); + (*newstate)->ngroups = n; - strcpy((*newstate)->userid.id, canon_id); - (*newstate)->userid.hash = strhash(canon_id); + strcpy((*newstate)->userid.id, ptsmodule_canonifyid(canon_id, size)); + (*newstate)->userid.hash = strhash((*newstate)->userid.id); (*newstate)->mark = time(0); for (i = 0, entry = ldap_first_entry(ptsm->ld, res); entry != NULL; i++, entry = ldap_next_entry(ptsm->ld, entry)) { - vals = ldap_get_values(ptsm->ld, entry, (char *)ptsm->member_attribute); - if (vals == NULL) - continue; + vals = ldap_get_values(ptsm->ld, entry, (char *)ptsm->member_attribute); + if (vals == NULL) + continue; - if ( ldap_count_values( vals ) != 1 ) { - *reply = "too many values"; - rc = PTSM_FAIL; - ldap_value_free(vals); - vals = NULL; - goto done; - } + if ( ldap_count_values( vals ) != 1 ) { + *reply = "too many values"; + rc = PTSM_FAIL; + ldap_value_free(vals); + vals = NULL; + goto done; + } - strcpy((*newstate)->groupsi.id, "group:"); + strcpy((*newstate)->groupsi.id, "group:"); - unsigned int j; - for (j =0; j < strlen(vals0); j++) { - if(Uisupper(vals0j)) - vals0j=tolower(vals0j); - } + unsigned int j; + for (j =0; j < strlen(vals0); j++) { + if(Uisupper(vals0j)) { + vals0j=tolower(vals0j); + } + } - strlcat((*newstate)->groupsi.id, vals0, sizeof((*newstate)->groupsi.id)); - (*newstate)->groupsi.hash = strhash((*newstate)->groupsi.id); + strlcat((*newstate)->groupsi.id, vals0, sizeof((*newstate)->groupsi.id)); + (*newstate)->groupsi.hash = strhash((*newstate)->groupsi.id); - ldap_value_free(vals); - vals = NULL; + ldap_value_free(vals); + vals = NULL; } rc = PTSM_OK; @@ -1343,7 +1403,7 @@ snprintf(domain_filter, sizeof(domain_filter), ptsm->domain_filter, domain); - syslog(LOG_DEBUG, "(groups) Domain filter: %s", domain_filter); + syslog(LOG_DEBUG, "(groups) Base DN: %s, Domain filter: %s", ptsm->domain_base_dn, domain_filter); rc = ldap_search_st(ptsm->ld, ptsm->domain_base_dn, ptsm->domain_scope, domain_filter, domain_attrs, 0, &(ptsm->timeout), &res);
View file
cyrus-imapd-2.5.7.tar.gz/ptclient/ptdump.c -> cyrus-imapd-2.5.8.12.tar.gz/ptclient/ptdump.c
Changed
@@ -57,13 +57,20 @@ struct auth_state *authstate = (struct auth_state *)data; int i; - printf("user: "); - fwrite(key, keylen, 1, stdout); - printf(" time: %d groups: %d\n", + if (!strncmp(key, "group:", 6)) { + printf("group: "); + fwrite(key+6, keylen-6, 1, stdout); + } else { + printf("user: "); + fwrite(key, keylen, 1, stdout); + printf(" -> %s\n", authstate->userid.id); + } + + printf(" time: %d\n groups: %d\n", (unsigned)authstate->mark, (unsigned)authstate->ngroups); for (i=0; i < authstate->ngroups; i++) - printf(" %s\n",authstate->groupsi.id); + printf(" %s\n",authstate->groupsi.id); return 0; }
View file
cyrus-imapd-2.5.7.tar.gz/tools/config2header -> cyrus-imapd-2.5.8.12.tar.gz/tools/config2header
Changed
@@ -124,6 +124,18 @@ #include <string.h> #include "imapopts.h" +/* + * Sun C Compilers are more strict than GNU and won't allow type + * casting to a union + */ + +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#define U_CFG_V +#else +#define U_CFG_V (union config_value) +#endif + + EXPORTED struct imapopt_s imapopts = { { IMAPOPT_ZERO, "", 0, OPT_NOTOPT, { NULL }, { NULL }, { { NULL, IMAP_ENUM_ZERO } } }, @@ -150,7 +162,7 @@ if ($3 eq "STRING") { $def = $use_gcc_extension - ? "(union config_value)((const char *) $2)" + ? "U_CFG_V((const char *) $2)" : "{(void *)($2)}"; } elsif ($3 eq "ENUM") { my @values = eval $4; @@ -163,7 +175,7 @@ $e = "IMAP_ENUM_" . uc($opt) . "_" . uc($def); $e =~ s/^0-9A-Z_a-z/_/g; $def = $use_gcc_extension - ? "(union config_value)((enum enum_value) $e)" + ? "U_CFG_V((enum enum_value) $e)" : "{(void *)($e)}"; # output the enum_options @@ -189,7 +201,7 @@ my $count = 0; $def = $use_gcc_extension - ? "(union config_value)((const char *) $2)" + ? "U_CFG_V((const char *) $2)" : "{(void*)($2)}"; # output the enum_options @@ -219,7 +231,7 @@ } $e .= "0"; $def = $use_gcc_extension - ? "(union config_value)((unsigned long) $e)" + ? "U_CFG_V((unsigned long) $e)" : "{(void *)($e)}"; # output the enum_options @@ -242,7 +254,7 @@ if ($count > $enum_size) { $enum_size = $count; } } else { $def = $use_gcc_extension - ? "(union config_value)((long) $2)" + ? "U_CFG_V((long) $2)" : "{(void*)$2}"; }
View file
cyrus-imapd-2.5.8.12.tar.gz/tools/htmlstrip.c
Changed
(renamed from doc/text/htmlstrip.c)
View file
cyrus-imapd-2.5.7.tar.gz/xversion.h -> cyrus-imapd-2.5.8.12.tar.gz/xversion.h
Changed
@@ -1,3 +1,3 @@ -/* cyrus-imapd 2.5.7 */ -#define _CYRUS_VERSION "2.5.7" -#define CYRUS_GITVERSION "ee1c6ef5 2015-12-01" +/* cyrus-imapd 2.5.8.12 */ +#define _CYRUS_VERSION "2.5.8.12" +#define CYRUS_GITVERSION "fb7ae876 2016-06-02"
View file
cyrus-imapd.dsc
Changed
@@ -2,7 +2,7 @@ Source: cyrus-imapd Binary: cyrus-imapd Architecture: any -Version: 2.5.7-0~kolab1 +Version: 2.5.8-0~kolab12.1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.cyrusimap.org/ @@ -39,10 +39,9 @@ po-debconf, tcl-dev | tcl8.3-dev, transfig, - xutils-dev | xutils, - zlib1g-dev -Package-List: + xutils-dev | xutils +Package-List: cyrus-imapd deb mail extra -Files: - 00000000000000000000000000000000 0 cyrus-imapd-2.5.7.tar.gz +Files: + 00000000000000000000000000000000 0 cyrus-imapd-2.5.8.12.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
View file
cyrus-imapd.service
Changed
@@ -8,7 +8,6 @@ ExecStartPre=/usr/lib/cyrus-imapd/cyr_systemd_helper start ExecStart=/usr/lib/cyrus-imapd/cyrus-master $CYRUSOPTIONS ExecStopPost=/usr/lib/cyrus-imapd/cyr_systemd_helper stop -PrivateTmp=true Install WantedBy=multi-user.target
View file
debian.changelog
Changed
@@ -1,3 +1,40 @@ + +cyrus-imapd (2.5.8-0~kolab12.1) unstable; urgency=low + + * Check in a snapshot version 12 revisions ahead of the upstream 2.5.8 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Thu, 2 Jun 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab26.1) unstable; urgency=low + + * Check in a snapshot version 26 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Mon, 9 May 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab25.1) unstable; urgency=low + + * Check in a snapshot version 25 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Fri, 29 Apr 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab23.1) unstable; urgency=low + + * Check in a snapshot version 23 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Tue, 12 Apr 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab10.1) unstable; urgency=low + + * Check in a snapshot version 10 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Mon, 21 Mar 2016 11:30:13 +0100 + +cyrus-imapd (2.5.7-0~kolab8.1) unstable; urgency=low + + * Check in a snapshot version 8 revisions ahead of the upstream 2.5.7 release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Thu, 10 Mar 2016 11:30:13 +0100 + cyrus-imapd (2.5.7-0~kolab1) unstable; urgency=low * New upstream 2.5.7 release
View file
debian.rules
Changed
@@ -99,6 +99,7 @@ --with-perl=/usr/bin/perl \ --with-openssl=/usr \ --with-sasl=/usr \ + --without-zlib \ --with-pidfile=/var/run/cyrus-master.pid \ --with-service-path=/usr/lib/cyrus-imapd \ --with-syslogfacility=MAIL \
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
.