diff options
| author | Sam Varshavchik | 2022-02-22 20:10:38 -0500 |
|---|---|---|
| committer | Sam Varshavchik | 2022-02-22 20:10:38 -0500 |
| commit | 23ff373602a9d7df207c8df8bbce60d2a409a908 (patch) | |
| tree | 8279cdd08eb216294753899a1e3d359137849630 /imap/imapd.c | |
| parent | d3c31390cd761b14947202422e9d8aadeea46d4c (diff) | |
| download | courier-libs-23ff373602a9d7df207c8df8bbce60d2a409a908.tar.bz2 | |
Fix response to a SELECT with insufficient ACLs.
Diffstat (limited to 'imap/imapd.c')
| -rw-r--r-- | imap/imapd.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/imap/imapd.c b/imap/imapd.c index 0d5cbbb..71af3fe 100644 --- a/imap/imapd.c +++ b/imap/imapd.c @@ -5271,6 +5271,21 @@ int uid=0; return (-1); } + /* check if this is a shared read-only folder */ + + if (is_sharedsubdir(mailbox) && + maildir_sharedisro(mailbox)) + ro=1; + + for (p=current_mailbox_acl; *p; p++) + if (strchr(ACL_INSERT ACL_EXPUNGE + ACL_SEEN ACL_WRITE ACL_DELETEMSGS, + *p)) + break; + + if (*p == 0) + ro=1; + if (imapscan_maildir(¤t_maildir_info, mailbox, 0, ro, NULL)) { @@ -5281,12 +5296,6 @@ int uid=0; } current_mailbox=mailbox; - /* check if this is a shared read-only folder */ - - if (is_sharedsubdir(mailbox) && - maildir_sharedisro(mailbox)) - ro=1; - current_mailbox_ro=ro; mailboxflags(ro); @@ -5297,15 +5306,6 @@ int uid=0; myrights(); writes(tag); - for (p=current_mailbox_acl; *p; p++) - if (strchr(ACL_INSERT ACL_EXPUNGE - ACL_SEEN ACL_WRITE ACL_DELETEMSGS, - *p)) - break; - - if (*p == 0) - ro=1; - writes(ro ? " OK [READ-ONLY] Ok\r\n":" OK [READ-WRITE] Ok\r\n"); return (0); } |
