[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-list.c,1.16,1.17
cras at procontrol.fi
cras at procontrol.fi
Sun Mar 9 12:03:37 EET 2003
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c,1.44,1.45
- Next message: [dovecot-cvs] dovecot/src/lib-index/maildir maildir-index.c,1.25,1.26 maildir-index.h,1.14,1.15 maildir-open.c,1.14,1.15 maildir-sync.c,1.29,1.30
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory danu:/tmp/cvs-serv2137/lib-storage/index/mbox
Modified Files:
mbox-list.c
Log Message:
mbox: LIST "" invalid-directory/% doesn't anymore give internal error
Index: mbox-list.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-list.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- mbox-list.c 24 Feb 2003 17:39:32 -0000 1.16
+++ mbox-list.c 9 Mar 2003 10:03:35 -0000 1.17
@@ -72,8 +72,9 @@
if (*dirp != NULL)
return 1;
- if (!root && (errno == ENOENT || errno == ENOTDIR)) {
- /* probably just race condition with other client
+ if (errno == ENOENT || errno == ENOTDIR) {
+ /* root) user gave invalid hiearchy, ignore
+ sub) probably just race condition with other client
deleting the mailbox. */
return 0;
}
@@ -128,9 +129,11 @@
virtual_path = mask_get_dir(mask);
path = mbox_get_path(storage, virtual_path);
- if (list_opendir(storage, path, TRUE, &dirp) <= 0)
+ if (list_opendir(storage, path, TRUE, &dirp) < 0)
return NULL;
+ /* if user gave invalid directory, we just don't show any results. */
+
ctx = i_new(struct mailbox_list_context, 1);
ctx->storage = storage;
ctx->flags = flags;
@@ -139,15 +142,17 @@
if (virtual_path == NULL && imap_match(ctx->glob, "INBOX") > 0)
ctx->next = mbox_list_inbox;
- else if (virtual_path != NULL)
+ else if (virtual_path != NULL && dirp != NULL)
ctx->next = mbox_list_path;
else
ctx->next = mbox_list_next;
- ctx->dir = i_new(struct list_dir_context, 1);
- ctx->dir->dirp = dirp;
- ctx->dir->real_path = i_strdup(path);
- ctx->dir->virtual_path = i_strdup(virtual_path);
+ if (dirp != NULL) {
+ ctx->dir = i_new(struct list_dir_context, 1);
+ ctx->dir->dirp = dirp;
+ ctx->dir->real_path = i_strdup(path);
+ ctx->dir->virtual_path = i_strdup(virtual_path);
+ }
return ctx;
}
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c,1.44,1.45
- Next message: [dovecot-cvs] dovecot/src/lib-index/maildir maildir-index.c,1.25,1.26 maildir-index.h,1.14,1.15 maildir-open.c,1.14,1.15 maildir-sync.c,1.29,1.30
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list