dovecot-2.0: mailbox log: Create file with correct permission.
dovecot at dovecot.org
dovecot at dovecot.org
Mon Dec 14 04:35:33 EET 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/d4c645713656
changeset: 10474:d4c645713656
user: Timo Sirainen <tss at iki.fi>
date: Sun Dec 13 21:35:04 2009 -0500
description:
mailbox log: Create file with correct permission.
diffstat:
1 file changed, 10 insertions(+), 5 deletions(-)
src/lib-storage/mailbox-list.c | 15 ++++++++++-----
diffs (32 lines):
diff -r a0d99b374aa4 -r d4c645713656 src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c Sun Dec 13 21:08:41 2009 -0500
+++ b/src/lib-storage/mailbox-list.c Sun Dec 13 21:35:04 2009 -0500
@@ -676,6 +676,9 @@ static bool mailbox_list_init_changelog(
static bool mailbox_list_init_changelog(struct mailbox_list *list)
{
const char *path;
+ mode_t mode;
+ gid_t gid;
+ const char *gid_origin;
if (list->changelog != NULL)
return TRUE;
@@ -685,11 +688,13 @@ static bool mailbox_list_init_changelog(
path = mailbox_list_get_path(list, NULL, MAILBOX_LIST_PATH_TYPE_INDEX);
if (path == NULL)
return FALSE;
- else {
- path = t_strconcat(path, "/"MAILBOX_LOG_FILE_NAME, NULL);
- list->changelog = mailbox_log_alloc(path);
- return TRUE;
- }
+
+ path = t_strconcat(path, "/"MAILBOX_LOG_FILE_NAME, NULL);
+ list->changelog = mailbox_log_alloc(path);
+
+ mailbox_list_get_permissions(list, NULL, &mode, &gid, &gid_origin);
+ mailbox_log_set_permissions(list->changelog, mode, gid, gid_origin);
+ return TRUE;
}
void mailbox_list_add_change(struct mailbox_list *list,
More information about the dovecot-cvs
mailing list