Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8788:1f2dfc6fbda9 HEAD
mbox: Improve dotlock error logging more.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 26 Feb 2009 17:44:17 -0500 |
parents | 5c3406520c3f |
children | d153c72800e0 |
files | src/lib-storage/index/mbox/mbox-lock.c |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-lock.c Thu Feb 26 16:43:51 2009 -0500 +++ b/src/lib-storage/index/mbox/mbox-lock.c Thu Feb 26 17:44:17 2009 -0500 @@ -370,16 +370,22 @@ errmsg = eacces_error_get_creating("file_dotlock_create", path); dir = strrchr(path, '/'); dir = dir == NULL ? "." : t_strdup_until(path, dir); - if (stat(dir, &st) == 0 && - (st.st_mode & 02) == 0 && /* not world-writable */ - (st.st_mode & 020) != 0) { /* group-writable */ + if (!mbox->mbox_privileged_locking) { + dir = mailbox_list_get_path(mbox->storage->storage.list, NULL, + MAILBOX_LIST_PATH_TYPE_DIR); + mail_storage_set_critical(&mbox->storage->storage, + "%s (under root dir %s -> no privileged locking)", + errmsg, dir); + } else if (stat(dir, &st) == 0 && + (st.st_mode & 02) == 0 && /* not world-writable */ + (st.st_mode & 020) != 0) { /* group-writable */ group = getgrgid(st.st_gid); mail_storage_set_critical(&mbox->storage->storage, "%s (set mail_privileged_group=%s)", errmsg, group == NULL ? dec2str(st.st_gid) : group->gr_name); } else { mail_storage_set_critical(&mbox->storage->storage, - "%s (nonstandard permissions in %s)", errmsg, path); + "%s (nonstandard permissions in %s)", errmsg, dir); } errno = orig_errno; }