Mercurial > dovecot > core-2.2
changeset 10503:e7cd1b10f18b HEAD
Avoid using PATH_MAX.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 16 Dec 2009 13:48:16 -0500 |
parents | 13be6ac759ee |
children | 9c2fe6d0b684 |
files | src/lib-storage/index/shared/shared-list.c src/lib-storage/list/mailbox-list-fs.c src/lib-storage/list/mailbox-list-fs.h src/lib-storage/list/mailbox-list-maildir-iter.c src/lib-storage/list/mailbox-list-maildir.c src/lib-storage/list/mailbox-list-maildir.h src/lib-storage/mailbox-list.h |
diffstat | 7 files changed, 13 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/shared/shared-list.c Wed Dec 16 13:43:23 2009 -0500 +++ b/src/lib-storage/index/shared/shared-list.c Wed Dec 16 13:48:16 2009 -0500 @@ -305,7 +305,7 @@ .name = "shared", .hierarchy_sep = '/', .props = 0, - .mailbox_name_max_length = PATH_MAX, + .mailbox_name_max_length = MAILBOX_LIST_NAME_MAX_LENGTH, { shared_list_alloc,
--- a/src/lib-storage/list/mailbox-list-fs.c Wed Dec 16 13:43:23 2009 -0500 +++ b/src/lib-storage/list/mailbox-list-fs.c Wed Dec 16 13:48:16 2009 -0500 @@ -417,7 +417,7 @@ .name = MAILBOX_LIST_NAME_FS, .hierarchy_sep = '/', .props = 0, - .mailbox_name_max_length = PATH_MAX, + .mailbox_name_max_length = MAILBOX_LIST_NAME_MAX_LENGTH, { fs_list_alloc,
--- a/src/lib-storage/list/mailbox-list-fs.h Wed Dec 16 13:43:23 2009 -0500 +++ b/src/lib-storage/list/mailbox-list-fs.h Wed Dec 16 13:48:16 2009 -0500 @@ -5,7 +5,7 @@ /* Don't allow creating too long mailbox names. They could start causing problems when they reach the limit. */ -#define FS_MAX_CREATE_MAILBOX_NAME_LENGTH (PATH_MAX/2) +#define FS_MAX_CREATE_MAILBOX_NAME_LENGTH (MAILBOX_LIST_NAME_MAX_LENGTH/2) struct fs_mailbox_list { struct mailbox_list list;
--- a/src/lib-storage/list/mailbox-list-maildir-iter.c Wed Dec 16 13:43:23 2009 -0500 +++ b/src/lib-storage/list/mailbox-list-maildir-iter.c Wed Dec 16 13:48:16 2009 -0500 @@ -196,7 +196,7 @@ strcmp(ctx->ctx.list->name, MAILBOX_LIST_NAME_IMAPDIR) != 0 ? ctx->ctx.list->hierarchy_sep : '\0'; - mailbox = t_str_new(PATH_MAX); + mailbox = t_str_new(MAILBOX_LIST_NAME_MAX_LENGTH); while ((d = readdir(dirp)) != NULL) { const char *fname = d->d_name;
--- a/src/lib-storage/list/mailbox-list-maildir.c Wed Dec 16 13:43:23 2009 -0500 +++ b/src/lib-storage/list/mailbox-list-maildir.c Wed Dec 16 13:48:16 2009 -0500 @@ -442,7 +442,7 @@ .name = MAILBOX_LIST_NAME_MAILDIRPLUSPLUS, .hierarchy_sep = '.', .props = MAILBOX_LIST_PROP_NO_MAILDIR_NAME, - .mailbox_name_max_length = PATH_MAX, + .mailbox_name_max_length = MAILBOX_LIST_NAME_MAX_LENGTH, { maildir_list_alloc, @@ -471,7 +471,7 @@ .name = MAILBOX_LIST_NAME_IMAPDIR, .hierarchy_sep = '.', .props = MAILBOX_LIST_PROP_NO_MAILDIR_NAME, - .mailbox_name_max_length = PATH_MAX, + .mailbox_name_max_length = MAILBOX_LIST_NAME_MAX_LENGTH, { imapdir_list_alloc,
--- a/src/lib-storage/list/mailbox-list-maildir.h Wed Dec 16 13:43:23 2009 -0500 +++ b/src/lib-storage/list/mailbox-list-maildir.h Wed Dec 16 13:48:16 2009 -0500 @@ -5,7 +5,7 @@ /* Don't allow creating too long mailbox names. They could start causing problems when they reach the limit. */ -#define MAILDIR_MAX_CREATE_MAILBOX_NAME_LENGTH (PATH_MAX/2) +#define MAILDIR_MAX_CREATE_MAILBOX_NAME_LENGTH (MAILBOX_LIST_NAME_MAX_LENGTH/2) struct maildir_mailbox_list { struct mailbox_list list;
--- a/src/lib-storage/mailbox-list.h Wed Dec 16 13:43:23 2009 -0500 +++ b/src/lib-storage/mailbox-list.h Wed Dec 16 13:48:16 2009 -0500 @@ -4,6 +4,12 @@ #include "mail-types.h" #include "mail-error.h" +#ifdef PATH_MAX +# define MAILBOX_LIST_NAME_MAX_LENGTH PATH_MAX +#else +# define MAILBOX_LIST_NAME_MAX_LENGTH 4096 +#endif + struct mail_namespace; struct mail_storage; struct mailbox_list;