summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-11-09 09:47:26 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-11-09 09:47:26 (GMT)
commitcaf940a246c29fa75b5f587e38c20c9bc3476f2b (patch) (side-by-side diff)
tree3cd6feeacfe90b5aff644a886f0ab2e16f7dd9b2
parentd38d139c7545ed616c0237bab5ca7db24cfccb80 (diff)
downloadmailutils-caf940a246c29fa75b5f587e38c20c9bc3476f2b.tar.gz
mailutils-caf940a246c29fa75b5f587e38c20c9bc3476f2b.tar.bz2
dotmail: fix opening in append-only mode
* libproto/dotmail/dotmail.c (dotmail_rescan_unlocked) (dotmail_rescan): Skip if mailbox is not opened for reading.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libproto/dotmail/dotmail.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libproto/dotmail/dotmail.c b/libproto/dotmail/dotmail.c
index 48ca756..fa083bb 100644
--- a/libproto/dotmail/dotmail.c
+++ b/libproto/dotmail/dotmail.c
@@ -329,6 +329,9 @@ dotmail_rescan_unlocked (mu_mailbox_t mailbox, mu_off_t offset)
int i, j;
int force_init_uids = 0;
+ if (!(mailbox->flags & MU_STREAM_READ))
+ return 0;
+
rc = mu_streamref_create (&stream, mailbox->stream);
if (rc)
{
@@ -590,6 +593,9 @@ dotmail_rescan (mu_mailbox_t mailbox, mu_off_t offset)
if (!dmp)
return EINVAL;
+ if (!(mailbox->flags & MU_STREAM_READ))
+ return 0;
+
mu_monitor_wrlock (mailbox->monitor);
#ifdef WITH_PTHREAD
pthread_cleanup_push (dotmail_cleanup, (void *)mailbox);

Return to:

Send suggestions and report system problems to the System administrator.