dovecot-1.0: If setgid() fails, includ euid and egid in the log ...

dovecot at dovecot.org dovecot at dovecot.org
Sat Nov 3 17:57:51 EET 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/635245cad7ba
changeset: 5448:635245cad7ba
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Nov 03 17:57:46 2007 +0200
description:
If setgid() fails, includ euid and egid in the log message.

diffstat:

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

diffs (17 lines):

diff -r 90b7671c8f2e -r 635245cad7ba src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Sat Nov 03 12:10:35 2007 +0200
+++ b/src/lib/restrict-access.c	Sat Nov 03 17:57:46 2007 +0200
@@ -139,8 +139,11 @@ void restrict_access_by_env(bool disallo
 	gid = env == NULL ? 0 : (gid_t)strtoul(env, NULL, 10);
 	have_root_group = gid == 0;
 	if (gid != 0 && (gid != getgid() || gid != getegid())) {
-		if (setgid(gid) != 0)
-			i_fatal("setgid(%s) failed: %m", dec2str(gid));
+		if (setgid(gid) != 0) {
+			i_fatal("setgid(%s) failed with euid=%s, egid=%s: %m",
+				dec2str(gid), dec2str(geteuid()),
+				dec2str(getegid()));
+		}
 
 		env = getenv("RESTRICT_USER");
 		if (env == NULL) {


More information about the dovecot-cvs mailing list