]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If mail_debug=yes: Log which per-namespace file permissions are used.
authorTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 19:00:13 +0000 (22:00 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 19:00:13 +0000 (22:00 +0300)
--HG--
branch : HEAD

src/lib-storage/mailbox-list.c

index c10ee7bc9caf41a14b634827982360957fa0f529..43665c1536d82957fd5a8c507919ad0ea8e104f7 100644 (file)
@@ -254,6 +254,9 @@ void mailbox_list_get_permissions(struct mailbox_list *list,
                if (!ENOTFOUND(errno)) {
                        mailbox_list_set_critical(list, "stat(%s) failed: %m",
                                                  path);
+               } else if ((list->flags & MAILBOX_LIST_FLAG_DEBUG) != 0) {
+                       i_info("Namespace %s: Permission lookup failed from %s",
+                              list->ns->prefix, path);
                }
                /* return safe defaults */
                *mode_r = 0600;
@@ -276,6 +279,14 @@ void mailbox_list_get_permissions(struct mailbox_list *list,
                list->file_create_gid = st.st_gid;
        }
 
+       if ((list->flags & MAILBOX_LIST_FLAG_DEBUG) != 0) {
+               i_info("Namespace %s: Using permissions from %s: "
+                      "mode=0%o gid=%ld", list->ns->prefix, path,
+                      list->file_create_mode,
+                      list->file_create_gid == (gid_t)-1 ? -1L :
+                      (long)list->file_create_gid);
+       }
+
        *mode_r = list->file_create_mode;
        *gid_r = list->file_create_gid;
 }