changeset 6249:2ebca5088938 HEAD

Crashfixes
author Timo Sirainen <tss@iki.fi>
date Thu, 09 Aug 2007 19:27:57 +0300
parents c6b1d8515354
children a5db1b4bc02c
files src/plugins/mbox-snarf/mbox-snarf-plugin.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/mbox-snarf/mbox-snarf-plugin.c	Thu Aug 09 19:03:18 2007 +0300
+++ b/src/plugins/mbox-snarf/mbox-snarf-plugin.c	Thu Aug 09 19:27:57 2007 +0300
@@ -5,6 +5,7 @@
 #include "home-expand.h"
 #include "mail-search.h"
 #include "mail-storage-private.h"
+#include "mailbox-list-private.h"
 #include "mbox-snarf-plugin.h"
 
 #include <stdlib.h>
@@ -129,18 +130,24 @@
 {
 	struct mbox_snarf_mail_storage *mstorage =
 		MBOX_SNARF_CONTEXT(storage);
+	struct mailbox_list *list;
 	struct mailbox *box;
 	struct mbox_snarf_mailbox *mbox;
 	struct stat st;
 	enum mail_storage_flags old_flags = storage->flags;
+	enum mailbox_list_flags old_list_flags;
 	bool use_snarfing = FALSE;
 
+	list = mail_storage_get_list(storage);
+	old_list_flags = list->flags;
+
 	if (strcasecmp(name, "INBOX") == 0 && !mstorage->open_spool_inbox) {
 		if (stat(mstorage->snarf_inbox_path, &st) == 0) {
 			/* use ~/mbox as the INBOX */
 			name = mstorage->snarf_inbox_path;
 			use_snarfing = TRUE;
 			storage->flags |= MAIL_STORAGE_FLAG_FULL_FS_ACCESS;
+			list->flags |= MAILBOX_LIST_FLAG_FULL_FS_ACCESS;
 		} else if (errno != ENOENT) {
 			mail_storage_set_critical(storage,
 						  "stat(%s) failed: %m",
@@ -151,6 +158,7 @@
 	box = mstorage->module_ctx.super.
 		mailbox_open(storage, name, input, flags);
 	storage->flags = old_flags;
+	list->flags = old_list_flags;
 
 	if (box == NULL || !use_snarfing)
 		return box;