dovecot: mailbox_list_get_permissions(): If group doesn't have a...

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 11 19:19:05 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/33f59b91c4bf
changeset: 6784:33f59b91c4bf
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 11 19:18:57 2007 +0200
description:
mailbox_list_get_permissions(): If group doesn't have any permissions, don't
bother returning any group either.

diffstat:

1 file changed, 4 insertions(+)
src/lib-storage/mailbox-list.c |    4 ++++

diffs (14 lines):

diff -r 007cbfcaf3bc -r 33f59b91c4bf src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Sun Nov 11 19:17:15 2007 +0200
+++ b/src/lib-storage/mailbox-list.c	Sun Nov 11 19:18:57 2007 +0200
@@ -259,6 +259,10 @@ void mailbox_list_get_permissions(struct
 	list->file_create_mode = st.st_mode & 0666;
 	if (S_ISDIR(st.st_mode) && (st.st_mode & S_ISGID) != 0) {
 		/* directory's GID is used automatically for new files */
+		list->file_create_gid = (gid_t)-1;
+	} else if ((st.st_mode & 0060) == 0) {
+		/* group doesn't have any permissions, so don't bother
+		   changing it */
 		list->file_create_gid = (gid_t)-1;
 	} else if (getegid() == st.st_gid) {
 		/* using our own gid, no need to change it */


More information about the dovecot-cvs mailing list