]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Check immediately if we have write-access to mbox.
authorTimo Sirainen <tss@iki.fi>
Thu, 24 Jun 2004 14:00:21 +0000 (17:00 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 24 Jun 2004 14:00:21 +0000 (17:00 +0300)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-storage.c

index 4e461c6b64ea814e10870e39cd1501b7767d5d5d..0b97a5f6458c3e9b4e673b2165cfbb334b804590 100644 (file)
@@ -457,6 +457,15 @@ mbox_open(struct index_storage *storage, const char *name,
        ibox->mail_deinit = mbox_mail_deinit;
        ibox->mail_interface = &mbox_mail;
 
+       if (access(path, R_OK|W_OK) < 0) {
+               if (errno < EACCES)
+                       mbox_set_syscall_error(ibox, "access()");
+               else {
+                       ibox->readonly = TRUE;
+                       ibox->mbox_readonly = TRUE;
+               }
+       }
+
        return &ibox->box;
 }