Skip to content

Commit

Permalink
http_caldav: caldav_put() ensure ORGANIZER is consistent
Browse files Browse the repository at this point in the history
Fixes #1768
  • Loading branch information
dilyanpalauzov authored and elliefm committed Jan 10, 2017
1 parent 592bffd commit 74b69d2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions imap/http_caldav.c
Original file line number Diff line number Diff line change
Expand Up @@ -3952,17 +3952,16 @@ static int caldav_put(struct transaction_t *txn, void *obj,
goto done;
}

if (organizer) {
const char *nextorg = NULL;

prop = icalcomponent_get_first_property(nextcomp,
ICAL_ORGANIZER_PROPERTY);
if (prop) nextorg = icalproperty_get_organizer(prop);
if (!nextorg || strcmp(organizer, nextorg)) {
txn->error.precond = CALDAV_SAME_ORGANIZER;
ret = HTTP_FORBIDDEN;
goto done;
}
const char *nextorg = NULL;

prop = icalcomponent_get_first_property(nextcomp,
ICAL_ORGANIZER_PROPERTY);
if (prop) nextorg = icalproperty_get_organizer(prop);
if ( (!organizer && nextorg)
|| (organizer && (!nextorg || strcmp(organizer, nextorg)))) {
txn->error.precond = CALDAV_SAME_ORGANIZER;
ret = HTTP_FORBIDDEN;
goto done;
}

if (rscale_calendars && !rrule) {
Expand Down

0 comments on commit 74b69d2

Please sign in to comment.