dovecot: Fix to handling setgid-bit-ignores-gid.

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 28 16:53:25 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/b2c14c07dcb2
changeset: 6648:b2c14c07dcb2
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 28 16:53:21 2007 +0200
description:
Fix to handling setgid-bit-ignores-gid.

diffstat:

1 file changed, 5 insertions(+), 3 deletions(-)
src/lib-storage/index/maildir/maildir-storage.c |    8 +++++---

diffs (18 lines):

diff -r 6dd5df1c1ec9 -r b2c14c07dcb2 src/lib-storage/index/maildir/maildir-storage.c
--- a/src/lib-storage/index/maildir/maildir-storage.c	Sun Oct 28 14:47:10 2007 +0200
+++ b/src/lib-storage/index/maildir/maildir-storage.c	Sun Oct 28 16:53:21 2007 +0200
@@ -408,9 +408,11 @@ maildir_open(struct maildir_storage *sto
 	   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_mode & S_ISGID) != 0 ?
-					   (gid_t)-1 : st.st_gid);
+		if ((st.st_mode & S_ISGID) != 0) {
+			/* Ignore GID */
+			st.st_gid = (gid_t)-1;
+		}
+		mail_index_set_permissions(index, st.st_mode & 0666, st.st_gid);
 	}
 
 	pool = pool_alloconly_create("maildir mailbox", 1024+512);


More information about the dovecot-cvs mailing list