Projects
Kolab:3.4
cyrus-imapd
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 68
View file
cyrus-imapd.spec
Changed
@@ -28,14 +28,17 @@ ## Options ## -%global with_mysql 0 -%global with_pgsql 0 -%global with_dav 0 +%global with_bdb 0 +%global with_mysql 0 +%global with_pgsql 0 + +%global with_dav 0 +%global with_tcpwrap 0 Name: cyrus-imapd Summary: A high-performance mail server with IMAP, POP3, NNTP and SIEVE support Version: 2.5 -Release: 8%{?dist} +Release: 0.1.dev20140724%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.cyrusimap.org @@ -63,16 +66,7 @@ ## Patches ## -Patch0001: 0001-There-is-no-actual-prerequisite-for-libtool-of-2.2.6.patch -Patch0002: 0002-A-non-void-function-should-return-something-so-retur.patch -Patch0003: 0003-Disable-user-parameter-check-to-notify-external.patch -Patch0004: 0004-Fix-display-of-deleted-shared-folders.patch -Patch0005: 0005-Apply-ifdefs-for-building-without-DAV-and-without-re.patch -Patch0006: 0006-Add-ACL-change-notifications.patch -Patch0007: 0007-Correct-location-of-ifdef-endif.patch -Patch0008: 0008-Extend-ifdefs-endifs-for-WITH_DAV.patch -Patch0009: 0009-Keep-the-same-order-between-.c-and-.h-perhaps.patch -Patch0010: 0010-do-not-apply-ptloader-ldap-root-dn-discovery.patch +Patch9999: cyrus-imapd-mupdate-work.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -84,6 +78,7 @@ BuildRequires: bison BuildRequires: cyrus-sasl-devel +%if 0%{?with_bdb} %if 0%{?suse_version} BuildRequires: db-devel %else @@ -93,6 +88,7 @@ BuildRequires: db4-devel %endif %endif +%endif BuildRequires: flex BuildRequires: gcc-c++ @@ -150,11 +146,13 @@ BuildRequires: sqlite-devel %endif +%if 0%{?with_tcpwrap} %if 0%{?suse_version} BuildRequires: tcpd-devel %else BuildRequires: tcp_wrappers %endif +%endif BuildRequires: transfig BuildRequires: xapian-core-devel @@ -251,16 +249,8 @@ %prep %setup -q -n %{_name}-%{real_version}%{?dot_snapshot_version} -#%patch0001 -p1 -#%patch0002 -p1 -#%patch0003 -p1 -#%patch0004 -p1 -#%patch0005 -p1 -#%patch0006 -p1 -#%patch0007 -p1 -#%patch0008 -p1 -#%patch0009 -p1 -#%patch0010 -p1 + +#%patch9999 -p1 # only to update config.* files aclocal -I cmulocal @@ -308,13 +298,20 @@ --enable-nntp \ --enable-replication \ --enable-xapian \ +%if 0%{?with_bdb} %if 0%{?fedora} >= 20 || 0%{?rhel} || 0%{?suse_version} --with-bdb-incdir=%{_includedir}/db4 \ %else --with-bdb-incdir=%{_includedir}/libdb4 \ %endif +%else + --without-bdb \ +%endif --with-cyrus-prefix=%{_cyrexecdir} \ --with-extraident="Kolab-%{version}-%{release}" \ +%if 0%{?with_tcpwrap} < 1 + --without-wrap \ +%endif %if 0%{?with_dav} --with-http \ %endif @@ -333,7 +330,7 @@ --with-snmp \ --with-syslogfacility=MAIL -%{__make} +%{__make} %{?_smp_mflags} %install %{__rm} -rf %{buildroot} @@ -482,7 +479,13 @@ source %{_sysconfdir}/sysconfig/cyrus-imapd fi -if [ $CHATTRSYNC -ne 0 ]; then +if [ $CHATTRSYNC -eq 0 ]; then + # Force synchronous updates of files in the following directories + chattr -R -S \ + $(grep ^configdirectory: /etc/imapd.conf | cut -d':' -f2) \ + $(grep ^partition- /etc/imapd.conf | cut -d':' -f2) \ + $(grep ^metapartition- /etc/imapd.conf | cut -d':' -f2) 2>/dev/null ||: +else # Force synchronous updates of files in the following directories chattr -R +S \ $(grep ^configdirectory: /etc/imapd.conf | cut -d':' -f2) \ @@ -685,8 +688,6 @@ %attr(0750,%{_cyrususer},%{_cyrusgroup}) %dir %{_var}/lib/imap/user %attr(0750,%{_cyrususer},%{_cyrusgroup}) %dir %{_var}/spool/imap %{_libdir}/*.so.* -%dir %{_var}/lib/imap/ -%dir %{_var}/lib/imap/rpm/ %{_var}/lib/imap/rpm/* %doc perl/imap/README %doc perl/imap/Changes
View file
0001-There-is-no-actual-prerequisite-for-libtool-of-2.2.6.patch
Deleted
@@ -1,25 +0,0 @@ -From 18c6d1d15047ce5e92b9892aeaf73e955e2b57f0 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sat, 8 Mar 2014 23:48:30 +0100 -Subject: [PATCH 1/6] There is no actual prerequisite for libtool of >= 2.2.6 - and it is incompatible with autoconf 2.63 - ---- - configure.ac | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 3c29680..61073e2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -127,7 +127,6 @@ AH_BOTTOM([#if HAVE_VISIBILITY - #define HIDDEN - #endif]) - --LT_PREREQ([2.2.6]) - LT_INIT([disable-static]) - AC_SUBST([LIBTOOL_DEPS]) - --- -1.8.3.1 -
View file
0002-A-non-void-function-should-return-something-so-retur.patch
Deleted
@@ -1,24 +0,0 @@ -From 49a177f85e57c4a3c2613bf72ae492bc4b855caf Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sat, 8 Mar 2014 23:49:04 +0100 -Subject: [PATCH 2/6] A non void function should return something, so return 0 - ---- - imap/xapian_wrap.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/imap/xapian_wrap.cpp b/imap/xapian_wrap.cpp -index 47d904f..ea96b87 100644 ---- a/imap/xapian_wrap.cpp -+++ b/imap/xapian_wrap.cpp -@@ -291,6 +291,7 @@ xapian_query_t *xapian_query_new_match(const xapian_db_t *db, const char *prefix - catch (const Xapian::Error &err) { - syslog(LOG_ERR, "IOERROR: Xapian: caught exception: %s: %s", - err.get_context().c_str(), err.get_description().c_str()); -+ return 0; - } - } - --- -1.8.3.1 -
View file
0003-Disable-user-parameter-check-to-notify-external.patch
Deleted
@@ -1,38 +0,0 @@ -From 7e8b0d9ecee648e854bc90f674f61e44f8d42c05 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sat, 8 Mar 2014 23:49:27 +0100 -Subject: [PATCH 3/6] Disable user parameter check to notify external - ---- - notifyd/notify_external.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/notifyd/notify_external.c b/notifyd/notify_external.c -index 5a2d680..964d1ee 100644 ---- a/notifyd/notify_external.c -+++ b/notifyd/notify_external.c -@@ -71,15 +71,15 @@ char* notify_external(const char *class, const char *priority, - - /* check/parse options */ - if (!(notify = config_getstring(IMAPOPT_NOTIFY_EXTERNAL))) { -- syslog(LOG_ERR, "ERROR: recipient not specified"); -- return strdup("NO external recipient not specified"); -+ syslog(LOG_ERR, "ERROR: external recipient (program) not specified"); -+ return strdup("NO external recipient (program) not specified"); - } - -- if (!*user) { -- syslog(LOG_ERR, "ERROR: recipient not specified"); -- return strdup("NO external recipient not specified"); -+/* if (!*user) { -+ syslog(LOG_ERR, "ERROR: external recipient user not specified"); -+ return strdup("NO external recipient user not specified"); - } -- -+*/ - buf[0] = notify; - buf[1] = "-c"; - buf[2] = class; --- -1.8.3.1 -
View file
0004-Fix-display-of-deleted-shared-folders.patch
Deleted
@@ -1,32 +0,0 @@ -From f931a6f37054f6f9f7638d71147c1b7367242557 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sat, 8 Mar 2014 23:49:50 +0100 -Subject: [PATCH 4/6] Fix display of deleted shared folders - ---- - imap/mboxname.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/imap/mboxname.c b/imap/mboxname.c -index 86a755f..f3634c0 100644 ---- a/imap/mboxname.c -+++ b/imap/mboxname.c -@@ -576,7 +576,15 @@ static int mboxname_toexternal(struct namespace *namespace, const char *mboxname - - if (mbparts.box) - strcat(result, "."); -+ } else { -+ /* shared mailbox */ -+ if (mbparts.is_deleted) { -+ const char *dp = config_getstring(IMAPOPT_DELETEDPREFIX); -+ sprintf(result, "%s.", dp); -+ } - } -+ -+ - if (mbparts.box) - strcat(result, mbparts.box); - --- -1.8.3.1 -
View file
0005-Apply-ifdefs-for-building-without-DAV-and-without-re.patch
Deleted
@@ -1,281 +0,0 @@ -From af772395dc3f45dbc2347fc3611606c7242059b5 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sat, 8 Mar 2014 23:50:55 +0100 -Subject: [PATCH 5/6] Apply ifdefs for building without DAV and without - requiring DAV-related software during build - ---- - Makefile.am | 19 ++++++++++++++----- - imap/mailbox.c | 10 ++++++++++ - imap/mailbox.h | 2 ++ - imap/mboxevent.c | 13 ++++++++++++- - imap/mboxevent.h | 2 ++ - imap/sync_server.c | 6 ++++++ - 6 files changed, 46 insertions(+), 6 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index b1790a5..48d0e8e 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -1190,7 +1190,6 @@ dist_man_MANS = \ - man/deliver.8 \ - man/fetchnews.8 \ - man/fud.8 \ -- man/httpd.8 \ - man/idled.8 \ - man/imapd.8 \ - man/ipurge.8 \ -@@ -1206,17 +1205,27 @@ dist_man_MANS = \ - man/rmnews.8 \ - man/smmapd.8 \ - man/syncnews.8 \ -- man/sync_client.8 \ -- man/sync_reset.8 \ -- man/sync_server.8 \ - man/timsieved.8 \ - man/tls_prune.8 \ - man/unexpunge.8 --if USE_SQUAT -+ -+if SQUATTER - dist_man_MANS += \ - man/squatter.8 - endif - -+if HTTPD -+dist_man_MANS += \ -+ man/httpd.8 -+endif -+ -+if REPLICATION -+dist_man_MANS += \ -+ man/sync_client.8 \ -+ man/sync_reset.8 \ -+ man/sync_server.8 -+endif -+ - master_master_SOURCES = \ - master/cyrusMasterMIB.c \ - master/cyrusMasterMIB.h \ -diff --git a/imap/mailbox.c b/imap/mailbox.c -index 43d8f79..cc457df 100644 ---- a/imap/mailbox.c -+++ b/imap/mailbox.c -@@ -51,7 +51,9 @@ - #elif defined(HAVE_STDINT_H) - # include <stdint.h> - #endif -+#ifdef WITH_DAV - #include <libical/vcc.h> -+#endif - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -@@ -81,8 +83,10 @@ - - #include "annotate.h" - #include "assert.h" -+#ifdef WITH_DAV - #include "caldav_db.h" - #include "carddav_db.h" -+#endif - #include "crc32.h" - #include "md5.h" - #include "exitcodes.h" -@@ -2660,6 +2664,7 @@ out: - return r; - } - -+#ifdef WITH_DAV - static int mailbox_update_carddav(struct mailbox *mailbox, - struct index_record *old, - struct index_record *new) -@@ -2880,6 +2885,7 @@ static int mailbox_update_dav(struct mailbox *mailbox, - return mailbox_update_caldav(mailbox, old, new); - return 0; - } -+#endif //WITH_DAV - - EXPORTED int mailbox_update_conversations(struct mailbox *mailbox, - struct index_record *old, -@@ -3106,8 +3112,10 @@ static int mailbox_update_indexes(struct mailbox *mailbox, - { - int r = 0; - -+#ifdef WITH_DAV - r = mailbox_update_dav(mailbox, old, new); - if (r) return r; -+#endif - - r = mailbox_update_conversations(mailbox, old, new); - if (r) return r; -@@ -4231,6 +4239,7 @@ static int chkchildren(char *name, - return r; - } - -+#ifdef WITH_DAV - EXPORTED int mailbox_add_dav(struct mailbox *mailbox) - { - struct index_record record; -@@ -4250,6 +4259,7 @@ EXPORTED int mailbox_add_dav(struct mailbox *mailbox) - - return 0; - } -+#endif - - EXPORTED int mailbox_add_conversations(struct mailbox *mailbox) - { -diff --git a/imap/mailbox.h b/imap/mailbox.h -index cdcf878..f6174c6 100644 ---- a/imap/mailbox.h -+++ b/imap/mailbox.h -@@ -577,7 +577,9 @@ extern int mailbox_get_annotate_state(struct mailbox *mailbox, - uint32_t mailbox_sync_crc(struct mailbox *mailbox, unsigned vers, int recalc); - unsigned mailbox_best_crcvers(unsigned minvers, unsigned maxvers); - -+#ifdef WITH_DAV - extern int mailbox_add_dav(struct mailbox *mailbox); -+#endif - - /* Rename a CID. Note - this is just one mailbox! */ - extern int mailbox_cid_rename(struct mailbox *mailbox, -diff --git a/imap/mboxevent.c b/imap/mboxevent.c -index 97882a5..0f0d298 100644 ---- a/imap/mboxevent.c -+++ b/imap/mboxevent.c -@@ -53,8 +53,10 @@ - - #include "annotate.h" - #include "assert.h" -+#ifdef WITH_DAV - #include "caldav_db.h" - #include "carddav_db.h" -+#endif - #include "exitcodes.h" - #include "imapurl.h" - #include "libconfig.h" -@@ -131,9 +133,11 @@ static struct mboxevent event_template = - { EVENT_PID, "pid", EVENT_PARAM_INT, 0, 0 }, - { EVENT_USER, "user", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_MESSAGE_SIZE, "messageSize", EVENT_PARAM_INT, 0, 0 }, -+#ifdef WITH_DAV - { EVENT_MBTYPE, "vnd.cmu.mbtype", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_DAV_FILENAME, "vnd.cmu.davFilename", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_DAV_UID, "vnd.cmu.davUid", EVENT_PARAM_STRING, 0, 0 }, -+#endif - { EVENT_MESSAGE_CID, "vnd.fastmail.cid", EVENT_PARAM_STRING, 0, 0 }, - /* always at end to let the parser to easily truncate this part */ - { EVENT_ENVELOPE, "vnd.cmu.envelope", EVENT_PARAM_STRING, 0, 0 }, -@@ -378,8 +382,10 @@ static int mboxevent_expected_param(enum event_type type, enum event_param param - return extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_FASTMAIL_SESSIONID; - case EVENT_MAILBOX_ID: - return (type & MAILBOX_EVENTS); -+#ifdef WITH_DAV - case EVENT_MBTYPE: - return (type & MAILBOX_EVENTS); -+#endif - case EVENT_MAX_MESSAGES: - return type & QUOTA_EVENTS; - case EVENT_MESSAGE_CONTENT: -@@ -388,12 +394,14 @@ static int mboxevent_expected_param(enum event_type type, enum event_param param - case EVENT_MESSAGE_SIZE: - return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_MESSAGESIZE) && - (type & (EVENT_MESSAGE_APPEND|EVENT_MESSAGE_NEW)); -+#ifdef WITH_DAV - case EVENT_DAV_FILENAME: - return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_CMU_DAVFILENAME) && - (type & EVENT_CALENDAR); - case EVENT_DAV_UID: - return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_CMU_DAVUID) && - (type & EVENT_CALENDAR); -+#endif - case EVENT_MESSAGE_CID: - return (extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_VND_FASTMAIL_CID) && - (type & (EVENT_MESSAGE_APPEND|EVENT_MESSAGE_NEW)); -@@ -743,6 +751,7 @@ EXPORTED void mboxevent_extract_record(struct mboxevent *event, struct mailbox * - cacheitem_size(record, CACHE_BODYSTRUCTURE))); - } - -+#ifdef WITH_DAV
View file
0006-Add-ACL-change-notifications.patch
Deleted
@@ -1,162 +0,0 @@ -From 62103a35b782aad0d94efe21657b82eeab7d27df Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sat, 8 Mar 2014 23:52:02 +0100 -Subject: [PATCH 6/6] Add ACL change notifications - ---- - imap/mboxevent.c | 34 ++++++++++++++++++++++++++++++---- - imap/mboxevent.h | 12 +++++++++++- - imap/mboxlist.c | 9 +++++++++ - 3 files changed, 50 insertions(+), 5 deletions(-) - -diff --git a/imap/mboxevent.c b/imap/mboxevent.c -index 0f0d298..9a60b0a 100644 ---- a/imap/mboxevent.c -+++ b/imap/mboxevent.c -@@ -78,7 +78,7 @@ - EVENT_MESSAGE_TRASH) - - #define MAILBOX_EVENTS (EVENT_MAILBOX_CREATE|EVENT_MAILBOX_DELETE|\ -- EVENT_MAILBOX_RENAME) -+ EVENT_MAILBOX_RENAME|EVENT_ACL_CHANGE) - - #define SUBS_EVENTS (EVENT_MAILBOX_SUBSCRIBE|EVENT_MAILBOX_UNSUBSCRIBE) - -@@ -122,6 +122,8 @@ static struct mboxevent event_template = - { EVENT_DISK_QUOTA, "diskQuota", EVENT_PARAM_INT, 0, 0 }, - { EVENT_DISK_USED, "diskUsed", EVENT_PARAM_INT, 0, 0 }, - { EVENT_MAX_MESSAGES, "maxMessages", EVENT_PARAM_INT, 0, 0 }, -+ { EVENT_ACL_SUBJECT, "aclSubject", EVENT_PARAM_STRING, 0, 0 }, -+ { EVENT_ACL_RIGHTS, "aclRights", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_MESSAGES, "messages", EVENT_PARAM_INT, 0, 0 }, - { EVENT_UNSEEN_MESSAGES, "vnd.cmu.unseenMessages", EVENT_PARAM_INT, 0, 0 }, - { EVENT_CONVEXISTS, "vnd.fastmail.convExists", EVENT_PARAM_INT, 0, 0 }, -@@ -191,7 +193,7 @@ EXPORTED void mboxevent_init(void) - enabled_events |= FLAGS_EVENTS; - - if (groups & IMAP_ENUM_EVENT_GROUPS_ACCESS) -- enabled_events |= (EVENT_LOGIN|EVENT_LOGOUT); -+ enabled_events |= (EVENT_LOGIN|EVENT_LOGOUT|EVENT_ACL_CHANGE); - - if (groups & IMAP_ENUM_EVENT_GROUPS_SUBSCRIPTION) - enabled_events |= SUBS_EVENTS; -@@ -423,6 +425,10 @@ static int mboxevent_expected_param(enum event_type type, enum event_param param - return extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_SERVICE; - case EVENT_TIMESTAMP: - return extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_TIMESTAMP; -+ case EVENT_ACL_SUBJECT: -+ return type & EVENT_ACL_CHANGE; -+ case EVENT_ACL_RIGHTS: -+ return type & EVENT_ACL_CHANGE; - case EVENT_UIDNEXT: - if (!(extra_params & IMAP_ENUM_EVENT_EXTRA_PARAMS_UIDNEXT)) - return 0; -@@ -679,12 +685,24 @@ EXPORTED void mboxevent_set_access(struct mboxevent *event, - if (userid && mboxevent_expected_param(event->type, EVENT_USER)) { - /* translate any separators in user */ - char *user = xstrdup(userid); -- mboxname_hiersep_toexternal(&namespace, user, -- config_virtdomains ? strcspn(user, "@") : 0); -+ if (user) { -+ mboxname_hiersep_toexternal(&namespace, user, -+ config_virtdomains ? strcspn(user, "@") : 0); -+ } - FILL_STRING_PARAM(event, EVENT_USER, user); - } - } - -+EXPORTED void mboxevent_set_acl(struct mboxevent *event, const char *identifier, -+ const char *rights) -+{ -+ if (!event) -+ return; -+ -+ FILL_STRING_PARAM(event, EVENT_ACL_SUBJECT, xstrdup(identifier)); -+ FILL_STRING_PARAM(event, EVENT_ACL_RIGHTS, xstrdup(rights)); -+} -+ - EXPORTED void mboxevent_extract_record(struct mboxevent *event, struct mailbox *mailbox, - struct index_record *record) - { -@@ -1132,6 +1150,8 @@ static const char *event_to_name(enum event_type type) - return "MailboxSubscribe"; - case EVENT_MAILBOX_UNSUBSCRIBE: - return "MailboxUnSubscribe"; -+ case EVENT_ACL_CHANGE: -+ return "AclChange"; - default: - fatal("Unknown message event", EC_SOFTWARE); - } -@@ -1335,6 +1355,12 @@ EXPORTED void mboxevent_set_access(struct mboxevent *event __attribute__((unused - { - } - -+EXPORTED void mboxevent_set_acl(struct mboxevent *event __attribute__((unused)), -+ const char *identifier __attribute__((unused)), -+>.......>.......>.......>.......const char *rights __attribute__((unused))) -+{ -+} -+ - EXPORTED void mboxevent_extract_record(struct mboxevent *event __attribute__((unused)), - struct mailbox *mailbox __attribute__((unused)), - struct index_record *record __attribute__((unused))) -diff --git a/imap/mboxevent.h b/imap/mboxevent.h -index 4e111c7..6106505 100644 ---- a/imap/mboxevent.h -+++ b/imap/mboxevent.h -@@ -80,7 +80,8 @@ enum event_type { - EVENT_MAILBOX_RENAME = (1<<17), - EVENT_MAILBOX_SUBSCRIBE = (1<<18), - EVENT_MAILBOX_UNSUBSCRIBE = (1<<19), -- EVENT_CALENDAR = (1<<20) -+ EVENT_CALENDAR = (1<<20), -+ EVENT_ACL_CHANGE = (1<<21) - }; - - /* -@@ -110,6 +111,8 @@ enum event_param { - EVENT_MIDSET, - EVENT_FLAG_NAMES, - EVENT_PID, -+ EVENT_ACL_SUBJECT, -+ EVENT_ACL_RIGHTS, - EVENT_USER, - EVENT_MESSAGE_SIZE, - #ifdef WITH_DAV -@@ -221,6 +224,13 @@ void mboxevent_add_flag(struct mboxevent *event, const char *flag); - void mboxevent_set_access(struct mboxevent *event, - const char *serveraddr, const char *clientaddr, - const char *userid, const char *mailboxname); -+ -+/* -+ * Shortcut to setting event notification parameters -+ */ -+void mboxevent_set_acl(struct mboxevent *event, const char *identifier, -+ const char *rights); -+ - /* - * Extract data from the given record to fill these event parameters : - * - uidset from UID -diff --git a/imap/mboxlist.c b/imap/mboxlist.c -index 2e4b7ee..c313ba7 100644 ---- a/imap/mboxlist.c -+++ b/imap/mboxlist.c -@@ -1854,6 +1854,15 @@ EXPORTED int mboxlist_setacl(struct namespace *namespace, const char *name, - name, cyrusdb_strerror(r)); - r = IMAP_IOERROR; - } -+ -+ /* send a AclChange event notification */ -+ struct mboxevent *mboxevent = mboxevent_new(EVENT_ACL_CHANGE); -+ mboxevent_extract_mailbox(mboxevent, mailbox); -+ mboxevent_set_acl(mboxevent, identifier, rights); -+ -+ mboxevent_notify(mboxevent); -+ mboxevent_free(&mboxevent); -+ - } - - /* 4. Change backup copy (cyrus.header) */ --- -1.8.3.1 -
View file
0007-Correct-location-of-ifdef-endif.patch
Deleted
@@ -1,27 +0,0 @@ -From a5446f731ca691d8cd5eecc5ec21d81e70f5a688 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sat, 8 Mar 2014 23:56:42 +0100 -Subject: [PATCH 7/7] Correct location of ifdef/endif - ---- - imap/mboxevent.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/imap/mboxevent.c b/imap/mboxevent.c -index 9a60b0a..feac0fd 100644 ---- a/imap/mboxevent.c -+++ b/imap/mboxevent.c -@@ -809,8 +809,9 @@ EXPORTED void mboxevent_extract_record(struct mboxevent *event, struct mailbox * - } - } - } --} - #endif //WITH_DAV -+} -+ - void mboxevent_extract_copied_record(struct mboxevent *event, - const struct mailbox *mailbox, uint32_t uid) - { --- -1.8.3.1 -
View file
0008-Extend-ifdefs-endifs-for-WITH_DAV.patch
Deleted
@@ -1,47 +0,0 @@ -From 46eb1fa3ba446dbfdb31277fb0499785394a4d72 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sun, 9 Mar 2014 00:00:30 +0100 -Subject: [PATCH 8/8] Extend ifdefs/endifs for WITH_DAV - ---- - imap/mbdump.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/imap/mbdump.c b/imap/mbdump.c -index acabb95..352ed24 100644 ---- a/imap/mbdump.c -+++ b/imap/mbdump.c -@@ -630,6 +630,7 @@ EXPORTED int dump_mailbox(const char *tag, struct mailbox *mailbox, uint32_t uid - fname = mboxkey_getpath(userid); - ftag = "MBOXKEY"; - break; -+#ifdef WITH_DAV - case DAV_DB: { - struct buf dav_file = BUF_INITIALIZER; - -@@ -638,6 +639,7 @@ EXPORTED int dump_mailbox(const char *tag, struct mailbox *mailbox, uint32_t uid - ftag = "DAV"; - break; - } -+#endif // WITH_DAV - default: - fatal("unknown user data file", EC_OSFILE); - } -@@ -1072,12 +1074,14 @@ EXPORTED int undump_mailbox(const char *mbname, - char *s = user_hash_subs(userid); - strlcpy(fnamebuf, s, sizeof(fnamebuf)); - free(s); -+#ifdef WITHDAV - } else if (userid && !strcmp(file.s, "DAV")) { - /* overwriting this outright is absolutely what we want to do */ - struct buf dav_file = BUF_INITIALIZER; - dav_getpath_byuserid(&dav_file, userid); - strlcpy(fnamebuf, buf_cstring(&dav_file), sizeof(fnamebuf)); - buf_free(&dav_file); -+#endif // WITH_DAV - } else if (userid && !strcmp(file.s, "SEEN")) { - seen_file = seen_getpath(userid); - --- -1.8.3.1 -
View file
0009-Keep-the-same-order-between-.c-and-.h-perhaps.patch
Deleted
@@ -1,34 +0,0 @@ -From c70ef68f50b32bbdad04ba4d80b9f9a8bddf8817 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Sun, 9 Mar 2014 00:26:18 +0100 -Subject: [PATCH 9/9] Keep the same order between .c and .h perhaps? - ---- - imap/mboxevent.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/imap/mboxevent.c b/imap/mboxevent.c -index feac0fd..4fdf6a5 100644 ---- a/imap/mboxevent.c -+++ b/imap/mboxevent.c -@@ -122,8 +122,6 @@ static struct mboxevent event_template = - { EVENT_DISK_QUOTA, "diskQuota", EVENT_PARAM_INT, 0, 0 }, - { EVENT_DISK_USED, "diskUsed", EVENT_PARAM_INT, 0, 0 }, - { EVENT_MAX_MESSAGES, "maxMessages", EVENT_PARAM_INT, 0, 0 }, -- { EVENT_ACL_SUBJECT, "aclSubject", EVENT_PARAM_STRING, 0, 0 }, -- { EVENT_ACL_RIGHTS, "aclRights", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_MESSAGES, "messages", EVENT_PARAM_INT, 0, 0 }, - { EVENT_UNSEEN_MESSAGES, "vnd.cmu.unseenMessages", EVENT_PARAM_INT, 0, 0 }, - { EVENT_CONVEXISTS, "vnd.fastmail.convExists", EVENT_PARAM_INT, 0, 0 }, -@@ -133,6 +131,8 @@ static struct mboxevent event_template = - { EVENT_MIDSET, "vnd.cmu.midset", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_FLAG_NAMES, "flagNames", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_PID, "pid", EVENT_PARAM_INT, 0, 0 }, -+ { EVENT_ACL_SUBJECT, "aclSubject", EVENT_PARAM_STRING, 0, 0 }, -+ { EVENT_ACL_RIGHTS, "aclRights", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_USER, "user", EVENT_PARAM_STRING, 0, 0 }, - { EVENT_MESSAGE_SIZE, "messageSize", EVENT_PARAM_INT, 0, 0 }, - #ifdef WITH_DAV --- -1.8.3.1 -
View file
0010-do-not-apply-ptloader-ldap-root-dn-discovery.patch
Deleted
@@ -1,13 +0,0 @@ -diff --git a/ptclient/ldap.c b/ptclient/ldap.c -index b45a1a0..8e30e53 100644 ---- a/ptclient/ldap.c -+++ b/ptclient/ldap.c -@@ -946,7 +946,7 @@ static int ptsmodule_get_dn( - if (rc != PTSM_OK) - return rc; - -- if (ptsm->domain_base_dn && (strrchr(canon_id, '@') != NULL)) { -+ if (ptsm->domain_base_dn && ptsm->domain_base_dn[0] != '\0' && (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
View file
cyrus-imapd-mupdate-work.patch
Added
@@ -0,0 +1,1319 @@ +diff --git a/imap/annotate.c b/imap/annotate.c +index 2dbac7a..a5c3a6d 100644 +--- a/imap/annotate.c ++++ b/imap/annotate.c +@@ -1183,6 +1183,7 @@ static int annotate_state_set_scope(annotate_state_t *state, + annotate_state_unset_scope(state); + + if (mbentry) { ++ assert(!uid); + if (!mailbox && !mbentry->server) { + /* local mailbox */ + r = mailbox_open_iwl(mbentry->name, &mailbox); +@@ -1190,11 +1191,21 @@ static int annotate_state_set_scope(annotate_state_t *state, + goto out; + state->mailbox_is_ours = 1; + } +- assert(mailbox); ++ ++ if (mailbox) { ++ syslog(LOG_DEBUG, "mailbox: %s (%s:%d)", mailbox->name, __FILE__, __LINE__); ++ } ++ ++ if (mbentry) { ++ syslog(LOG_DEBUG, "%s mbentry->server: %s (%s:%d)", mbentry->name, mbentry->server, __FILE__, __LINE__); ++ syslog(LOG_DEBUG, "%s mbentry->partition: %s (%s:%d)", mbentry->name, mbentry->partition, __FILE__, __LINE__); ++ } ++ ++ state->which = ANNOTATION_SCOPE_MAILBOX; + state->mbentry = mbentry; + } + +- if (uid) { ++ else if (uid) { + assert(mailbox); + state->which = ANNOTATION_SCOPE_MESSAGE; + } +@@ -1209,6 +1220,7 @@ static int annotate_state_set_scope(annotate_state_t *state, + } + assert(oldwhich == ANNOTATION_SCOPE_UNKNOWN || + oldwhich == state->which); ++ + state->mailbox = mailbox; + state->uid = uid; + +@@ -1431,6 +1443,8 @@ static void annotation_get_freespace(annotate_state_t *state, + static void annotation_get_server(annotate_state_t *state, + struct annotate_entry_list *entry) + { ++ syslog(LOG_DEBUG, "%s (%s:%d)", __func__, __FILE__, __LINE__); ++ + struct buf value = BUF_INITIALIZER; + int r; + +@@ -2024,14 +2038,20 @@ static void _annotate_fetch_entries(annotate_state_t *state, + for (ee = state->entry_list; ee; ee = ee->next) { + + if (proxy_check) { +- if (ee->desc->proxytype == BACKEND_ONLY && +- proxy_fetch_func && +- !config_getstring(IMAPOPT_PROXYSERVERS)) ++ if ( ++ ee->desc->proxytype == BACKEND_ONLY && ++ proxy_fetch_func && ++ !config_getstring(IMAPOPT_PROXYSERVERS) ++ ) { ++ syslog(LOG_DEBUG, "%s (%s:%d) backend only (skipping): %s", __func__, __FILE__, __LINE__, ee->desc->name); + continue; ++ } + } + +- if (!_annotate_may_fetch(state, ee->desc)) ++ if (!_annotate_may_fetch(state, ee->desc)) { ++ syslog(LOG_DEBUG, "%s (%s:%d) may not fetch (skipping): %s", __func__, __FILE__, __LINE__, ee->desc->name); + continue; ++ } + + ee->desc->get(state, ee); + } +@@ -2056,6 +2076,9 @@ EXPORTED int annotate_state_fetch(annotate_state_t *state, + state->sizeptr = maxsizeptr; /* pointer to push largest back */ + } + ++ syslog(LOG_DEBUG, "%s (%s:%d) entries: %s", __func__, __FILE__, __LINE__, strarray_join(entries, ",")); ++ syslog(LOG_DEBUG, "%s (%s:%d) attribs: %s", __func__, __FILE__, __LINE__, strarray_join(attribs, ",")); ++ + /* Build list of attributes to fetch */ + for (i = 0 ; i < attribs->count ; i++) + { +@@ -2091,15 +2114,20 @@ EXPORTED int annotate_state_fetch(annotate_state_t *state, + if (!state->attribs) + goto out; + ++ syslog(LOG_DEBUG, "%s (%s:%d) attribs: %s", __func__, __FILE__, __LINE__, strarray_join(attribs, ",")); ++ + if (state->which == ANNOTATION_SCOPE_SERVER) { ++ syslog(LOG_DEBUG, "%s (%s:%d) state->which == ANNOTATION_SCOPE_SERVER", __func__, __FILE__, __LINE__); + non_db_entries = &server_entries; + db_entry = &server_db_entry; + } + else if (state->which == ANNOTATION_SCOPE_MAILBOX) { ++ syslog(LOG_DEBUG, "%s (%s:%d) state->which == ANNOTATION_SCOPE_MAILBOX", __func__, __FILE__, __LINE__); + non_db_entries = &mailbox_entries; + db_entry = &mailbox_db_entry; + } + else if (state->which == ANNOTATION_SCOPE_MESSAGE) { ++ syslog(LOG_DEBUG, "%s (%s:%d) state->which == ANNOTATION_SCOPE_MESSAGE", __func__, __FILE__, __LINE__); + non_db_entries = &message_entries; + db_entry = &message_db_entry; + } +@@ -2109,6 +2137,11 @@ EXPORTED int annotate_state_fetch(annotate_state_t *state, + goto out; + } + ++ if (proxy_fetch_func) ++ syslog(LOG_DEBUG, "we have proxy_fetch_func"); ++ else ++ syslog(LOG_DEBUG, "we do not have proxy_fetch_func"); ++ + /* Build a list of callbacks for fetching the annotations */ + for (i = 0 ; i < entries->count ; i++) + { +@@ -2116,14 +2149,25 @@ EXPORTED int annotate_state_fetch(annotate_state_t *state, + int j; + int check_db = 0; /* should we check the db for this entry? */ + ++ syslog(LOG_DEBUG, "%s (%s:%d) char s: %s", __func__, __FILE__, __LINE__, s); ++ + g = glob_init(s, GLOB_HIERARCHY); + GLOB_SET_SEPARATOR(g, '/'); + + for (j = 0 ; j < non_db_entries->count ; j++) { + const annotate_entrydesc_t *desc = non_db_entries->data[j]; + +- if (!desc->get) ++ syslog(LOG_DEBUG, "%s (%s:%d) non_db_entry '%s'", __func__, __FILE__, __LINE__, desc->name); ++ ++ if (!desc->get) { ++ syslog(LOG_DEBUG, "%s (%s:%d) desc->get returns nothing for '%s'", __func__, __FILE__, __LINE__, desc->name); + continue; ++ } ++ ++ if (desc->proxytype == PROXY_ONLY) ++ syslog(LOG_DEBUG, "%s proxytype is proxy only (%s:%d)", desc->name, __FILE__, __LINE__); ++ else ++ syslog(LOG_DEBUG, "%s proxytype is NOT proxy only (%s:%d)", desc->name, __FILE__, __LINE__); + + if (GLOB_TEST(g, desc->name) != -1) { + /* Add this entry to our list only if it +@@ -2159,6 +2203,35 @@ EXPORTED int annotate_state_fetch(annotate_state_t *state, + glob_free(&g); + } + ++ struct annotate_entry_list *ee; ++ ++ for (ee = state->entry_list; ee; ee = ee->next) { ++ ++ syslog(LOG_DEBUG, "%s (%s:%d) state->entry_list: %s", __func__, __FILE__, __LINE__, ee->name); ++ ++ if ( ++ ee->desc->proxytype == BACKEND_ONLY && ++ !config_getstring(IMAPOPT_PROXYSERVERS) ++ ) { ++ ++ continue; ++ syslog(LOG_DEBUG, "%s (%s:%d) state->entry_list(backend): %s", __func__, __FILE__, __LINE__, ee->name); ++ } ++ ++ if (!_annotate_may_fetch(state, ee->desc)) { ++ syslog(LOG_DEBUG, "%s (%s:%d) may not fetch: %s", __func__, __FILE__, __LINE__, ee->name); ++ continue; ++ } ++ ++ ee->desc->get(state, ee); ++ ++ if (ee->have_shared) ++ syslog(LOG_DEBUG, "%s (%s:%d) entry shared: %s", __func__, __FILE__, __LINE__, ee->shared.s); ++ if (ee->have_priv) ++ syslog(LOG_DEBUG, "%s (%s:%d) entry private: %s", __func__, __FILE__, __LINE__, ee->priv.s); ++ } ++ ++ + if (state->which == ANNOTATION_SCOPE_SERVER) { + _annotate_fetch_entries(state, /*proxy_check*/1); + } +@@ -3313,16 +3386,22 @@ static void init_annotation_definitions(void) + ptrarray_t *entries = NULL; + + /* copy static entries into list */ +- for (i = 0 ; server_builtin_entries[i].name ; i++) ++ for (i = 0 ; server_builtin_entries[i].name ; i++) { ++ syslog(LOG_DEBUG, "appending %s to server_entries", server_builtin_entries[i].name); + ptrarray_append(&server_entries, (void *)&server_builtin_entries[i]); ++ } + + /* copy static entries into list */ +- for (i = 0 ; mailbox_builtin_entries[i].name ; i++) ++ for (i = 0 ; mailbox_builtin_entries[i].name ; i++) { ++ syslog(LOG_DEBUG, "appending %s to mailbox_entries", mailbox_builtin_entries[i].name); + ptrarray_append(&mailbox_entries, (void *)&mailbox_builtin_entries[i]);
View file
cyrus-imapd-2.5.tar.gz/imap/annotate.c
Changed
@@ -1190,6 +1190,7 @@ goto out; state->mailbox_is_ours = 1; } + assert(mailbox); state->mbentry = mbentry; }
View file
cyrus-imapd-2.5.tar.gz/imap/ctl_mboxlist.c
Changed
@@ -72,6 +72,7 @@ #include "assert.h" #include "annotate.h" +#include "dlist.h" #include "exitcodes.h" #include "imap/imap_err.h" #include "global.h" @@ -109,7 +110,7 @@ struct mb_node { char mailbox[MAX_MAILBOX_BUFFER]; - char server[MAX_MAILBOX_BUFFER]; + char location[MAX_MAILBOX_BUFFER]; char *acl; struct mb_node *next; }; @@ -144,7 +145,7 @@ /* the server thinks we have it, do we think we have it? */ ret = mboxlist_lookup(mdata->mailbox, NULL, NULL); - if(ret) { + if (ret) { struct mb_node *next; next = xzmalloc(sizeof(struct mb_node)); @@ -160,8 +161,8 @@ next = xzmalloc(sizeof(struct mb_node)); strlcpy(next->mailbox, mdata->mailbox, sizeof(next->mailbox)); - strlcpy(next->server, mdata->server, sizeof(next->server)); - if(!strncmp(cmd, "MAILBOX", 7)) + strlcpy(next->location, mdata->location, sizeof(next->location)); + if (!strncmp(cmd, "MAILBOX", 7)) next->acl = xstrdup(mdata->acl); *act_tail = next; @@ -177,36 +178,149 @@ struct dumprock *d = (struct dumprock *) rockp; int r = 0; char *p; - char *name, *part, *acl; - int mbtype; + char *name, *server, *part; + char *acl = NULL; + uint32_t mbtype = 0; + struct dlist *dl = NULL; /* \0 terminate 'name' */ name = xstrndup(key, keylen); - /* Get mailbox type */ - mbtype = strtol(data, &p, 10); + // this is a dlist + if (data[0] == '%') { + char *mbtype_str = '\0'; // placeholder for string obtained from dlist - p = strchr(data, ' '); - if (p == NULL) { - abort(); - } - p++; - acl = strchr(p, ' '); - if (acl == NULL) { - abort(); - } - /* grab 'part', \0 terminate */ - part = xstrndup(p, acl - p); + r = dlist_parsemap(&dl, 0, data, datalen); + + if (!r) { + struct dlist *dl_acl = dlist_getchild(dl, "A"); + struct dlist *dl_ace; + + for (dl_ace = dl_acl->head; dl_ace; dl_ace = dl_ace->next) { + const char *tmp; + r = dlist_getatom(dl_acl, dl_ace->name, &tmp); + + if (!r) { + syslog( + LOG_ERR, + "Failed to dlist_getatom for (A)CL " + "dlist_kvlist key '%s' (%s:%d)", + dl_ace->name, + __FILE__, + __LINE__ + ); - /* \0 terminate 'acl' */ - p = acl + 1; - acl = xstrndup(p, datalen - (p - data)); + continue; + } // if (r = dlist_getatom()) + + if (dl_ace->name && tmp) { + const char *ace = strconcat(xstrdup(dl_ace->name), " ", xstrdup(tmp)); + + if (acl) { + acl = strconcat(xstrdup(acl), " ", ace); + } else { + acl = xstrdup(ace); + } + } + } + + // The partition is always there... + r = dlist_getatom(dl, "P", (const char **)&part); + + if (!r) { + syslog( + LOG_ERR, + "Failed to obtain (P)artition from dlist " + "(%s:%d)", + __FILE__, + __LINE__ + ); + + } + + // The mailbox type is always there too... as a string + r = dlist_getatom(dl, "T", (const char **)&mbtype_str); + + if (!r) { + syslog( + LOG_ERR, + "Failed to obtain (T)ype from dlist (%s:%d)", + __FILE__, + __LINE__ + ); + + } + + mbtype = mboxlist_string_to_mbtype(mbtype_str); + + // If the mailbox is 'remote', the 'server' field matters + if (mbtype & MBTYPE_REMOTE) { + r = dlist_getatom(dl, "S", (const char **)&server); + + if (!r) { + syslog( + LOG_ERR, + "Failed to obtain (S)erver from dlist " + "(%s:%d)", + __FILE__, + __LINE__ + ); + + } + + + if (server == config_servername) { + syslog( + LOG_WARNING, + "Mailbox %s is marked remote, but the server " + "on which it is supposed to reside equals " + "our server name.", + name + ); + } + + // Since we have a server, make it part of the location + part = strconcat(server, "!", xstrdup(part)); + + } // (mbtype & MBTYPE_REMOTE) + } // if (r = dlist_parsemap()) + else { + syslog( + LOG_ERR, + "Failed to parse dlist (%s:%d)", + __FILE__, + __LINE__ + ); + } + + } // (data[0] == '%') + else { + /* Get mailbox type */ + mbtype = strtol(data, &p, 10); + + p = strchr(data, ' '); + if (p == NULL) { + abort(); + } + p++; + acl = strchr(p, ' '); + if (acl == NULL) { + abort(); + } + + /* grab 'part', \0 terminate */ + part = xstrndup(p, acl - p); + + /* \0 terminate 'acl' */ + p = acl + 1; + acl = xstrndup(p, datalen - (p - data)); + } switch (d->op) { case DUMP: - if(!d->partition || !strcmp(d->partition, part)) {
View file
cyrus-imapd-2.5.tar.gz/imap/mboxlist.c
Changed
@@ -514,7 +514,8 @@ "cannot connect to mupdate server for update of '%s'", mbentry->name); } else { - char *location = strconcat(config_servername, (char *)NULL); + char *location = strconcat(config_servername, "!", + mbentry->partition, (char *)NULL); r = mupdate_activate(mupdate_h, mbentry->name, location, mbentry->acl); free(location); @@ -875,7 +876,7 @@ /* 9. set MUPDATE entry as commited (CRASH: commited) */ if (!r && config_mupdate_server && !localonly) { mupdate_handle *mupdate_h = NULL; - char *loc = strconcat(config_servername, (char *)NULL); + char *loc = strconcat(config_servername, "!", newpartition, (char *)NULL); r = mupdate_connect(config_mupdate_server, NULL, &mupdate_h, NULL); if (!r) r = mupdate_reserve(mupdate_h, mboxname, loc); @@ -1482,7 +1483,7 @@ if (config_mupdate_server) { /* commit the mailbox in MUPDATE */ - char *loc = strconcat(config_servername, (char *)NULL); + char *loc = strconcat(config_servername, "!", newpartition, (char *)NULL); r = mupdate_connect(config_mupdate_server, NULL, &mupdate_h, NULL); if (!partitionmove) {
View file
cyrus-imapd-2.5.tar.gz/imap/mupdate-client.c
Changed
@@ -167,12 +167,12 @@ const char *cmd, void *context __attribute__((unused))) { - syslog(LOG_ERR, "mupdate_scarf_one was called, but shouldn't be. Command recieved was %s", cmd); + syslog(LOG_ERR, "mupdate_scarf_one was called, but shouldn't be. Command received was %s", cmd); return -1; } EXPORTED int mupdate_activate(mupdate_handle *handle, - const char *mailbox, const char *server, + const char *mailbox, const char *location, const char *acl) { int ret; @@ -180,22 +180,31 @@ const char *p; if (!handle) return MUPDATE_BADPARAM; - if (!mailbox || !server || !acl) return MUPDATE_BADPARAM; + if (!mailbox || !location || !acl) return MUPDATE_BADPARAM; if (!handle->saslcompleted) return MUPDATE_NOAUTH; + syslog(LOG_DEBUG, "mupdate_activate for mailbox: %s, location: %s, acl: %s", mailbox, location, acl); + /* make sure we don't have a double server!partition */ - if ((p = strchr(server, '!')) && strchr(p+1, '!')) return MUPDATE_BADPARAM; + if ((p = strchr(location, '!')) && strchr(p+1, '!')) return MUPDATE_BADPARAM; if (config_mupdate_config == IMAP_ENUM_MUPDATE_CONFIG_REPLICATED) { /* we don't care about the server part, everything is local */ - if (p) server = p + 1; + if (p) location = p + 1; } + syslog(LOG_DEBUG, "mupdate_activate for mailbox: %s, location: %s, acl: %s", mailbox, location, acl); + prot_printf(handle->conn->out, - "X%u ACTIVATE {" SIZE_T_FMT "+}\r\n%s" - " {" SIZE_T_FMT "+}\r\n%s {" SIZE_T_FMT "+}\r\n%s\r\n", - handle->tagn++, strlen(mailbox), mailbox, - strlen(server), server, strlen(acl), acl); + "X%u ACTIVATE " + "{" SIZE_T_FMT "+}\r\n%s " + "{" SIZE_T_FMT "+}\r\n%s " + "{" SIZE_T_FMT "+}\r\n%s\r\n", + handle->tagn++, + strlen(mailbox), mailbox, + strlen(location), location, + strlen(acl), acl + ); ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response); if (ret) { @@ -208,28 +217,34 @@ } HIDDEN int mupdate_reserve(mupdate_handle *handle, - const char *mailbox, const char *server) + const char *mailbox, const char *location) { int ret; enum mupdate_cmd_response response; const char *p; if (!handle) return MUPDATE_BADPARAM; - if (!mailbox || !server) return MUPDATE_BADPARAM; + if (!mailbox || !location) return MUPDATE_BADPARAM; if (!handle->saslcompleted) return MUPDATE_NOAUTH; /* make sure we don't have a double server!partition */ - if ((p = strchr(server, '!')) && strchr(p+1, '!')) return MUPDATE_BADPARAM; + if ((p = strchr(location, '!')) && strchr(p+1, '!')) return MUPDATE_BADPARAM; if (config_mupdate_config == IMAP_ENUM_MUPDATE_CONFIG_REPLICATED) { - /* we don't care about the server part, everything is local */ - if (p) server = p + 1; + /* we don't care about the location part, everything is local */ + if (p) location = p + 1; } + syslog(LOG_DEBUG, "mupdate_reserve for mailbox: %s, location: %s", mailbox, location); + prot_printf(handle->conn->out, - "X%u RESERVE {" SIZE_T_FMT "+}\r\n%s {" SIZE_T_FMT "+}\r\n%s\r\n", - handle->tagn++, strlen(mailbox), mailbox, - strlen(server), server); + "X%u RESERVE " + "{" SIZE_T_FMT "+}\r\n%s " + "{" SIZE_T_FMT "+}\r\n%s\r\n", + handle->tagn++, + strlen(mailbox), mailbox, + strlen(location), location + ); ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response); if (ret) { @@ -242,28 +257,32 @@ } EXPORTED int mupdate_deactivate(mupdate_handle *handle, - const char *mailbox, const char *server) + const char *mailbox, const char *location) { int ret; enum mupdate_cmd_response response; const char *p; if (!handle) return MUPDATE_BADPARAM; - if (!mailbox || !server) return MUPDATE_BADPARAM; + if (!mailbox || !location) return MUPDATE_BADPARAM; if (!handle->saslcompleted) return MUPDATE_NOAUTH; - /* make sure we don't have a double server!partition */ - if ((p = strchr(server, '!')) && strchr(p+1, '!')) return MUPDATE_BADPARAM; + /* make sure we don't have a double location!partition */ + if ((p = strchr(location, '!')) && strchr(p+1, '!')) return MUPDATE_BADPARAM; if (config_mupdate_config == IMAP_ENUM_MUPDATE_CONFIG_REPLICATED) { /* we don't care about the server part, everything is local */ - if (p) server = p + 1; + if (p) location = p + 1; } prot_printf(handle->conn->out, - "X%u DEACTIVATE {" SIZE_T_FMT "+}\r\n%s {" SIZE_T_FMT "+}\r\n%s\r\n", - handle->tagn++, strlen(mailbox), mailbox, - strlen(server), server); + "X%u DEACTIVATE " + "{" SIZE_T_FMT "+}\r\n%s " + "{" SIZE_T_FMT "+}\r\n%s\r\n", + handle->tagn++, + strlen(mailbox), mailbox, + strlen(location), location + ); ret = mupdate_scarf(handle, mupdate_scarf_one, NULL, 1, &response); if (ret) { @@ -310,7 +329,7 @@ /* coyp the data to the handle storage */ /* xxx why can't we just point to the 'mdata' buffers? */ strlcpy(h->mailbox_buf, mdata->mailbox, sizeof(h->mailbox_buf)); - strlcpy(h->server_buf, mdata->server, sizeof(h->server_buf)); + strlcpy(h->location_buf, mdata->location, sizeof(h->location_buf)); if(!strncmp(cmd, "MAILBOX", 7)) { h->mailboxdata_buf.t = ACTIVE; @@ -327,7 +346,7 @@ } h->mailboxdata_buf.mailbox = h->mailbox_buf; - h->mailboxdata_buf.server = h->server_buf; + h->mailboxdata_buf.location = h->location_buf; h->mailboxdata_buf.acl = h->acl; return 0; @@ -554,7 +573,7 @@ /* Handle mailbox command */ memset(&box, 0, sizeof(box)); box.mailbox = handle->arg1.s; - box.server = handle->arg2.s; + box.location = handle->arg2.s; box.acl = handle->arg3.s; r = callback(&box, handle->cmd.s, context); if (r) { /* callback error ? */ @@ -607,7 +626,7 @@ /* Handle reserve command */ memset(&box, 0, sizeof(box)); box.mailbox = handle->arg1.s; - box.server = handle->arg2.s; + box.location = handle->arg2.s; r = callback(&box, handle->cmd.s, context); if (r) { /* callback error ? */ syslog(LOG_ERR,
View file
cyrus-imapd-2.5.tar.gz/imap/mupdate-client.h
Changed
@@ -58,16 +58,16 @@ /* activate a mailbox */ int mupdate_activate(mupdate_handle *handle, - const char *mailbox, const char *server, + const char *mailbox, const char *location, const char *acl); /* reserve a piece of namespace */ int mupdate_reserve(mupdate_handle *handle, - const char *mailbox, const char *server); + const char *mailbox, const char *location); /* deactivate a mailbox (ACTIVE->RESERVE) */ int mupdate_deactivate(mupdate_handle *handle, - const char *mailbox, const char *server); + const char *mailbox, const char *location); /* delete a mailbox */ int mupdate_delete(mupdate_handle *handle, @@ -80,7 +80,7 @@ /* mailbox data structure */ struct mupdate_mailboxdata { const char *mailbox; - const char *server; + const char *location; const char *acl; enum mbtype t; };
View file
cyrus-imapd-2.5.tar.gz/imap/mupdate.c
Changed
@@ -209,7 +209,7 @@ const char *clientstart); static void cmd_set(struct conn *C, const char *tag, const char *mailbox, - const char *server, const char *acl, enum settype t); + const char *location, const char *acl, enum settype t); static void cmd_find(struct conn *C, const char *tag, const char *mailbox, int send_ok, int send_delete); static void cmd_list(struct conn *C, const char *tag, const char *host_prefix); @@ -284,7 +284,7 @@ C->saslprops.ipremoteport, NULL, 0, &C->saslconn); - if(r != SASL_OK) { + if (r != SASL_OK) { syslog(LOG_ERR, "failed to start sasl for connection: %s", sasl_errstring(r, NULL, NULL)); prot_printf(C->pout, SERVER_UNABLE_STRING); @@ -367,7 +367,7 @@ #endif cyrus_close_sock(C->fd); - if(C->logfd != -1) close(C->logfd); + if (C->logfd != -1) close(C->logfd); if (C->saslconn) sasl_dispose(&C->saslconn); @@ -380,7 +380,7 @@ buf_free(&(C->arg2)); buf_free(&(C->arg3)); - if(C->streaming_hosts) strarray_free(C->streaming_hosts); + if (C->streaming_hosts) strarray_free(C->streaming_hosts); free(C); } @@ -489,27 +489,27 @@ /* Do minor configuration checking */ workers_to_start = config_getint(IMAPOPT_MUPDATE_WORKERS_START); - if(config_getint(IMAPOPT_MUPDATE_WORKERS_MAX) < config_getint(IMAPOPT_MUPDATE_WORKERS_MINSPARE)) { + if (config_getint(IMAPOPT_MUPDATE_WORKERS_MAX) < config_getint(IMAPOPT_MUPDATE_WORKERS_MINSPARE)) { syslog(LOG_CRIT, "Maximum total worker threads is less than minimum spare worker threads"); return EC_SOFTWARE; } - if(workers_to_start < config_getint(IMAPOPT_MUPDATE_WORKERS_MINSPARE)) { + if (workers_to_start < config_getint(IMAPOPT_MUPDATE_WORKERS_MINSPARE)) { syslog(LOG_CRIT, "Starting worker threads is less than minimum spare worker threads"); return EC_SOFTWARE; } - if(config_getint(IMAPOPT_MUPDATE_WORKERS_MAXSPARE) < workers_to_start) { + if (config_getint(IMAPOPT_MUPDATE_WORKERS_MAXSPARE) < workers_to_start) { syslog(LOG_CRIT, "Maximum spare worker threads is less than starting worker threads"); return EC_SOFTWARE; } - if(config_getint(IMAPOPT_MUPDATE_WORKERS_MINSPARE) > workers_to_start) { + if (config_getint(IMAPOPT_MUPDATE_WORKERS_MINSPARE) > workers_to_start) { syslog(LOG_CRIT, "Minimum spare worker threads is greater than starting worker threads"); return EC_SOFTWARE; } - if(config_getint(IMAPOPT_MUPDATE_WORKERS_MAX) < workers_to_start) { + if (config_getint(IMAPOPT_MUPDATE_WORKERS_MAX) < workers_to_start) { syslog(LOG_CRIT, "Maximum total worker threads is less than starting worker threads"); return EC_SOFTWARE; } @@ -546,7 +546,7 @@ fatal("cannot run mupdate master on a unified server", EC_USAGE); } - if(pipe(conn_pipe) == -1) { + if (pipe(conn_pipe) == -1) { syslog(LOG_ERR, "could not setup connection signaling pipe %m"); return EC_OSERR; } @@ -555,7 +555,7 @@ if (!masterp) { r = pthread_create(&t, NULL, &mupdate_client_start, NULL); - if(r == 0) { + if (r == 0) { pthread_detach(t); } else { syslog(LOG_ERR, "could not start client thread"); @@ -564,14 +564,14 @@ /* Wait until they sync the database */ pthread_mutex_lock(&synced_mutex); - if(!synced) + if (!synced) pthread_cond_wait(&synced_cond, &synced_mutex); pthread_mutex_unlock(&synced_mutex); } else { pthread_t t; r = pthread_create(&t, NULL, &mupdate_placebo_kick_start, NULL); - if(r == 0) { + if (r == 0) { pthread_detach(t); } else { syslog(LOG_ERR, "could not start placebo kick thread"); @@ -584,7 +584,7 @@ /* Now create the worker thread pool */ for(i=0; i < workers_to_start; i++) { r = pthread_create(&t, NULL, &thread_main, NULL); - if(r == 0) { + if (r == 0) { pthread_detach(t); } else { syslog(LOG_ERR, "could not start client thread"); @@ -605,7 +605,7 @@ { static int recurse_code = 0; - if(recurse_code) exit(code); + if (recurse_code) exit(code); else recurse_code = code; syslog(LOG_ERR, "%s", s); @@ -661,7 +661,7 @@ /* parse command name */ ch = getword(c->pin, &(c->cmd)); - if(ch == EOF) { + if (ch == EOF) { goto lost_conn; } else if (!c->cmd.s[0]) { prot_printf(c->pout, "%s BAD \"Null command\"\r\n", c->tag.s); @@ -883,11 +883,11 @@ while(ch == ' ') { /* Hey, look, more bits of a PARTIAL-UPDATE command */ ch = getstring(c->pin, c->pout, &(c->arg1)); - if(c->arg1.s[0] == '\0') { + if (c->arg1.s[0] == '\0') { strarray_free(arg); goto badargs; } - if(counter-- == 0) { + if (counter-- == 0) { strarray_free(arg); goto extraargs; } @@ -963,7 +963,7 @@ done: /* Restore the state of the input stream */ - if(was_blocking) + if (was_blocking) prot_BLOCK(c->pin); else prot_NONBLOCK(c->pin); @@ -1001,7 +1001,7 @@ syslog(LOG_ERR, "Server too busy, dropping connection."); if (r) return 0; /* filthy hack to avoid warning on 'r' */ - } else if(write(conn_pipe[1], &fd, sizeof(fd)) == -1) { + } else if (write(conn_pipe[1], &fd, sizeof(fd)) == -1) { /* signal that a new file descriptor is available. * If it fails... */ @@ -1028,8 +1028,8 @@ &mechs, NULL, &mechcount); /* Add mupdate:// tag if necessary */ - if(!masterp) { - if(!config_mupdate_server) + if (!masterp) { + if (!config_mupdate_server) fatal("mupdate server was not specified for slave", EC_TEMPFAIL); @@ -1100,10 +1100,10 @@ max_worker_flag = (idle_worker_count >= config_getint(IMAPOPT_MUPDATE_WORKERS_MAXSPARE)); /* Increment Idle Workers */ - if(!max_worker_flag) idle_worker_count++; + if (!max_worker_flag) idle_worker_count++; pthread_mutex_unlock(&idle_worker_mutex); - if(max_worker_flag) goto worker_thread_done; + if (max_worker_flag) goto worker_thread_done; retry_lock: @@ -1377,11 +1377,25 @@ /* log change to database. database must be locked. */ static void database_log(const struct mbent *mb, struct txn **mytid) { + char *c; + char *location = NULL; mbentry_t *mbentry = NULL; mbentry = mboxlist_entry_create(); mbentry->name = xstrdupnull(mb->mailbox); - mbentry->server = xstrdupnull(mb->server); + + location = xstrdupnull(mb->location);
View file
cyrus-imapd-2.5.tar.gz/imap/mupdate.h
Changed
@@ -70,7 +70,7 @@ /* For client side mupdate_find calls */ char mailbox_buf[MAX_MAILBOX_BUFFER]; - char server_buf[MAX_MAILBOX_BUFFER]; + char location_buf[MAX_MAILBOX_BUFFER]; char *acl; struct mupdate_mailboxdata mailboxdata_buf; @@ -88,7 +88,7 @@ /* acl MUST be last, since it is what causes the variable size */ struct mbent { char *mailbox; - char *server; + char *location; enum settype t; struct mbent *next; /* used for queue */ char acl[1];
View file
cyrus-imapd.sysconfig
Changed
@@ -7,7 +7,7 @@ # In RPM install / update / upgrade %post, make sure all files in # Cyrus (meta-)partitions and configuration directories are set +S -CHATTRSYNC=1 +CHATTRSYNC=0 # Mailbox list dumps are rotated n times via cron.daily #ROTATE=6
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
.