# HG changeset patch # User Timo Sirainen # Date 1193512377 -10800 # Node ID 0dd9b91fd52ccf34e1b685b0b25a655c1b1753da # Parent 427eeded8078c978c00a75268a891148af9b208d If dovecot-shared file has setgid bit set, the group is ignored. diff -r 427eeded8078 -r 0dd9b91fd52c src/lib-storage/index/maildir/maildir-storage.c --- a/src/lib-storage/index/maildir/maildir-storage.c Sat Oct 27 20:37:35 2007 +0300 +++ b/src/lib-storage/index/maildir/maildir-storage.c Sat Oct 27 22:12:57 2007 +0300 @@ -407,8 +407,11 @@ /* for shared mailboxes get the create mode from the permissions of dovecot-shared file. */ shared = stat(t_strconcat(path, "/dovecot-shared", NULL), &st) == 0; - if (shared) - mail_index_set_permissions(index, st.st_mode & 0666, st.st_gid); + if (shared) { + mail_index_set_permissions(index, st.st_mode & 0666, + (st.st_mode & S_ISGID) != 0 ? + (gid_t)-1 : st.st_gid); + } pool = pool_alloconly_create("maildir mailbox", 1024+512); mbox = p_new(pool, struct maildir_mailbox, 1);