dovecot: Use better error messages for setgroups() failures.

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 30 16:27:17 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/d0689497bb11
changeset: 6509:d0689497bb11
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 30 16:27:12 2007 +0300
description:
Use better error messages for setgroups() failures.

diffstat:

1 file changed, 8 insertions(+), 4 deletions(-)
src/lib/restrict-access.c |   12 ++++++++----

diffs (29 lines):

diff -r 722bef1a0c4e -r d0689497bb11 src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Sun Sep 30 16:13:50 2007 +0300
+++ b/src/lib/restrict-access.c	Sun Sep 30 16:27:12 2007 +0300
@@ -82,8 +82,10 @@ static void drop_restricted_groups(bool 
 
 	if (used != gid_count) {
 		/* it did contain restricted groups, remove it */
-		if (setgroups(used, gid_list) < 0)
-			i_fatal("setgroups() failed: %m");
+		if (setgroups(used, gid_list) < 0) {
+			i_fatal("Couldn't drop restricted groups: "
+				"setgroups() failed: %m");
+		}
 	}
 	t_pop();
 }
@@ -119,8 +121,10 @@ static void grant_extra_groups(const cha
 		gid_list[gid_count++] = get_group_id(*tmp);
 	}
 
-	if (setgroups(gid_count, gid_list) < 0)
-		i_fatal("setgroups() failed: %m");
+	if (setgroups(gid_count, gid_list) < 0) {
+		i_fatal("Couldn't set mail_extra_groups: "
+			"setgroups(%s) failed: %m", groups);
+	}
 
 	t_pop();
 }


More information about the dovecot-cvs mailing list