dovecot: If RESTRICT_USER is empty string, don't call initgroups().

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 28 02:02:37 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/7f2501b3e993
changeset: 6640:7f2501b3e993
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 28 02:02:32 2007 +0300
description:
If RESTRICT_USER is empty string, don't call initgroups().

diffstat:

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

diffs (12 lines):

diff -r e1fde9940f7e -r 7f2501b3e993 src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Sun Oct 28 01:53:32 2007 +0300
+++ b/src/lib/restrict-access.c	Sun Oct 28 02:02:32 2007 +0300
@@ -147,7 +147,7 @@ void restrict_access_by_env(bool disallo
 			i_fatal("setgid(%s) failed: %m", dec2str(gid));
 
 		env = getenv("RESTRICT_USER");
-		if (env == NULL) {
+		if (env == NULL || *env == '\0') {
 			/* user not known, use only this one group */
 			if (setgroups(1, &gid) < 0) {
 				i_fatal("setgroups(%s) failed: %m",


More information about the dovecot-cvs mailing list