Skip to content

Commit

Permalink
net_imap: Strip quotes for SUBSCRIBE command.
Browse files Browse the repository at this point in the history
Failing to strip quotes led to including quotes directly
in file path operations; add missing macro calls where
they were missing.
  • Loading branch information
InterLinked1 committed Nov 19, 2023
1 parent d39159f commit eef3663
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nets/net_imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4414,15 +4414,19 @@ static int imap_process(struct imap_session *imap, char *s)
} else if (!strcasecmp(command, "SUBSCRIBE")) {
char fullmaildir[256];
int myacl;
REQUIRE_ARGS(s);
STRIP_QUOTES(s);
IMAP_NO_READONLY(imap);
/* Since we don't check for mailbox existence (and everything is always subscribed anyways), no real need to check ACLs here */
bbs_debug(1, "Ignoring sbscription attempt for %s for mailbox %d\n", S_IF(s), mailbox_id(imap->mbox));
bbs_debug(1, "Ignoring subscription attempt for %s for mailbox %d\n", S_IF(s), mailbox_id(imap->mbox));
imap_reply(imap, "OK SUBSCRIBE completed"); /* Everything available is already subscribed anyways, so can't hurt */
imap_translate_dir(imap, s, fullmaildir, sizeof(fullmaildir), &myacl);
mailbox_dispatch_event_basic(EVENT_MAILBOX_SUBSCRIBE, imap->node, imap->mbox, fullmaildir);
} else if (!strcasecmp(command, "UNSUBSCRIBE")) {
char fullmaildir[256];
int myacl;
REQUIRE_ARGS(s);
STRIP_QUOTES(s);
IMAP_NO_READONLY(imap);
bbs_warning("Unsubscription attempt for %s for mailbox %d\n", S_IF(s), mailbox_id(imap->mbox));
imap_reply(imap, "NO [NOPERM] Permission denied");
Expand Down

0 comments on commit eef3663

Please sign in to comment.