Skip to content
Permalink
Browse files Browse the repository at this point in the history
imapd: check for isadmin BEFORE parsing sync lines
  • Loading branch information
brong authored and elliefm committed Aug 11, 2017
1 parent 5edadcf commit 53c4137
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions imap/imapd.c
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 53c4137

Please sign in to comment.