dovecot-1.3: restrict-access: Another fix to allow running proce...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 10 01:31:59 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.3/rev/1320550c00a2
changeset: 9051:1320550c00a2
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 09 18:31:53 2009 -0400
description:
restrict-access: Another fix to allow running processes as root.

diffstat:

1 file changed, 2 insertions(+), 5 deletions(-)
src/lib/restrict-access.c |    7 ++-----

diffs (18 lines):

diff -r 85a587bcc16f -r 1320550c00a2 src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Thu Apr 09 18:28:39 2009 -0400
+++ b/src/lib/restrict-access.c	Thu Apr 09 18:31:53 2009 -0400
@@ -297,12 +297,9 @@ void restrict_access(const struct restri
 	}
 
 	/* verify that we actually dropped the privileges */
-	if (set->uid != (uid_t)-1) {
-		if (setuid(0) == 0) {
-			if (set->uid == 0)
-				i_fatal("This process must not be run as root");
+	if (set->uid != (uid_t)-1 && set->uid != 0) {
+		if (setuid(0) == 0)
 			i_fatal("We couldn't drop root privileges");
-		}
 	}
 
 	if (set->first_valid_gid != 0)


More information about the dovecot-cvs mailing list