dovecot-1.3: restrict-access: If running as root, don't give "co...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 10 03:18:23 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.3/rev/ace05d7b6da0
changeset: 9058:ace05d7b6da0
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 09 20:18:18 2009 -0400
description:
restrict-access: If running as root, don't give "couldn't drop root group privileges" error.

diffstat:

1 file changed, 2 insertions(+), 1 deletion(-)
src/lib/restrict-access.c |    3 ++-

diffs (13 lines):

diff -r c1b201243d52 -r ace05d7b6da0 src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Thu Apr 09 20:13:41 2009 -0400
+++ b/src/lib/restrict-access.c	Thu Apr 09 20:18:18 2009 -0400
@@ -312,7 +312,8 @@ void restrict_access(const struct restri
 	else
 		allow_root_gid = FALSE;
 
-	if (!allow_root_gid && set->uid != 0) {
+	if (!allow_root_gid && set->uid != 0 &&
+	    (set->uid != (uid_t)-1 || !is_root)) {
 		if (getgid() == 0 || getegid() == 0 || setgid(0) == 0) {
 			if (process_primary_gid == 0)
 				i_fatal("GID 0 isn't permitted");


More information about the dovecot-cvs mailing list