Projects
Kolab:3.4
cyrus-imapd
cyrus-imapd-2.5-acl-change-notifications.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File cyrus-imapd-2.5-acl-change-notifications.patch of Package cyrus-imapd (Revision 50)
Currently displaying revision
50
,
Show latest
diff -ur cyrus-imapd-2.5.orig/imap/mboxevent.c cyrus-imapd-2.5/imap/mboxevent.c --- cyrus-imapd-2.5.orig/imap/mboxevent.c 2014-01-17 15:43:56.000000000 +0100 +++ cyrus-imapd-2.5/imap/mboxevent.c 2014-03-06 12:36:31.355620912 +0100 @@ -77,7 +77,7 @@ #define MAILBOX_EVENTS (EVENT_MAILBOX_CREATE|EVENT_MAILBOX_DELETE|\ EVENT_MAILBOX_RENAME|EVENT_MAILBOX_SUBSCRIBE|\ - EVENT_MAILBOX_UNSUBSCRIBE) + EVENT_MAILBOX_UNSUBSCRIBE|EVENT_ACL_CHANGE) #define QUOTA_EVENTS (EVENT_QUOTA_EXCEED|EVENT_QUOTA_WITHIN|EVENT_QUOTA_CHANGE) @@ -124,6 +124,8 @@ { EVENT_CONVEXISTS, "vnd.fastmail.convExists", EVENT_PARAM_INT, 0, 0 }, { EVENT_CONVUNSEEN, "vnd.fastmail.convUnseen", EVENT_PARAM_INT, 0, 0 }, { EVENT_UIDNEXT, "uidnext", EVENT_PARAM_INT, 0, 0 }, + { EVENT_ACL_SUBJECT, "aclSubject", EVENT_PARAM_STRING, 0, 0 }, + { EVENT_ACL_RIGHTS, "aclRights", EVENT_PARAM_STRING, 0, 0 }, { EVENT_UIDSET, "uidset", EVENT_PARAM_STRING, 0, 0 }, { EVENT_MIDSET, "vnd.cmu.midset", EVENT_PARAM_STRING, 0, 0 }, { EVENT_FLAG_NAMES, "flagNames", EVENT_PARAM_STRING, 0, 0 }, @@ -186,7 +188,7 @@ 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_MAILBOX) enabled_events |= MAILBOX_EVENTS; @@ -411,6 +413,10 @@ 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; @@ -943,6 +949,16 @@ EXPORTED void mboxevent_extract_mailbox(struct mboxevent *event, struct mailbox *mailbox) +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)); +} + { struct imapurl imapurl; char url[MAX_MAILBOX_PATH+1]; @@ -1119,6 +1135,8 @@ return "MailboxSubscribe"; case EVENT_MAILBOX_UNSUBSCRIBE: return "MailboxUnSubscribe"; + case EVENT_ACL_CHANGE: + return "AclChange"; default: fatal("Unknown message event", EC_SOFTWARE); } @@ -1322,6 +1340,12 @@ { } +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))) Only in cyrus-imapd-2.5/imap: mboxevent.c.orig Only in cyrus-imapd-2.5/imap: mboxevent.c.rej diff -ur cyrus-imapd-2.5.orig/imap/mboxevent.h cyrus-imapd-2.5/imap/mboxevent.h --- cyrus-imapd-2.5.orig/imap/mboxevent.h 2014-01-17 15:43:56.000000000 +0100 +++ cyrus-imapd-2.5/imap/mboxevent.h 2014-03-06 12:38:43.101620707 +0100 @@ -80,7 +80,8 @@ 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) }; /* @@ -108,6 +109,8 @@ EVENT_UIDNEXT, EVENT_UIDSET, EVENT_MIDSET, + EVENT_ACL_SUBJECT, + EVENT_ACL_RIGHTS, EVENT_FLAG_NAMES, EVENT_PID, EVENT_USER, @@ -219,6 +222,13 @@ 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 Only in cyrus-imapd-2.5/imap: mboxevent.h.orig Only in cyrus-imapd-2.5/imap: mboxevent.h.rej diff -ur cyrus-imapd-2.5.orig/imap/mboxlist.c cyrus-imapd-2.5/imap/mboxlist.c --- cyrus-imapd-2.5.orig/imap/mboxlist.c 2014-01-17 15:43:56.000000000 +0100 +++ cyrus-imapd-2.5/imap/mboxlist.c 2014-03-06 12:35:43.266620528 +0100 @@ -1841,6 +1841,15 @@ 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) */ Only in cyrus-imapd-2.5/imap: mboxlist.c.orig
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
.