Permalink
Browse files

imapd: check for isadmin BEFORE parsing sync lines

  • Loading branch information...
brong authored and elliefm committed Aug 11, 2017
1 parent 5edadcf commit 53c4137bd924b954432c6c59da7572c4c5ffa901
Showing with 8 additions and 0 deletions.
  1. +8 −0 imap/imapd.c
View
@@ -2062,6 +2062,8 @@ static void cmdloop(void)
snmp_increment(SCAN_COUNT, 1);
}
else if (!strcmp(cmd.s, "Syncapply")) {
if (!imapd_userisadmin) goto badcmd;
struct dlist *kl = sync_parseline(imapd_in);
if (kl) {
@@ -2071,6 +2073,8 @@ static void cmdloop(void)
else goto extraargs;
}
else if (!strcmp(cmd.s, "Syncget")) {
if (!imapd_userisadmin) goto badcmd;
struct dlist *kl = sync_parseline(imapd_in);
if (kl) {
@@ -2080,13 +2084,17 @@ static void cmdloop(void)
else goto extraargs;
}
else if (!strcmp(cmd.s, "Syncrestart")) {
if (!imapd_userisadmin) goto badcmd;
if (c == '\r') c = prot_getc(imapd_in);
if (c != '\n') goto extraargs;
/* just clear the GUID cache */
cmd_syncrestart(tag.s, &reserve_list, 1);
}
else if (!strcmp(cmd.s, "Syncrestore")) {
if (!imapd_userisadmin) goto badcmd;
struct dlist *kl = sync_parseline(imapd_in);
if (kl) {

0 comments on commit 53c4137

Please sign in to comment.