dovecot-1.2: Improved setgid/setuid failure's error message.

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 8 19:07:11 EET 2010


details:   http://hg.dovecot.org/dovecot-1.2/rev/6794893d03c9
changeset: 9549:6794893d03c9
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 08 19:07:06 2010 +0200
description:
Improved setgid/setuid failure's error message.

diffstat:

 src/lib/restrict-access.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 7c3b7c3a86ff -r 6794893d03c9 src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Wed Mar 03 18:33:00 2010 +0200
+++ b/src/lib/restrict-access.c	Mon Mar 08 19:07:06 2010 +0200
@@ -92,10 +92,13 @@
 		}
 
 		if (setgid(primary_gid) != 0) {
-			i_fatal("setgid(%s) failed with euid=%s, "
-				"gid=%s, egid=%s: %m",
+			i_fatal("setgid(%s) failed with "
+				"euid=%s, gid=%s, egid=%s: %m "
+				"(This binary should probably be called with "
+				"process group set to %s instead of %s)",
 				get_gid_str(primary_gid), get_uid_str(geteuid()),
-				get_gid_str(getgid()), get_gid_str(getegid()));
+				get_gid_str(getgid()), get_gid_str(getegid()),
+				get_gid_str(primary_gid), get_uid_str(geteuid()));
 		}
 		return;
 	}
@@ -324,7 +327,10 @@
 	uid = env == NULL || *env == '\0' ? 0 : (uid_t)strtoul(env, NULL, 10);
 	if (uid != 0) {
 		if (setuid(uid) != 0) {
-			i_fatal("setuid(%s) failed with euid=%s: %m",
+			i_fatal("setuid(%s) failed with euid=%s: %m "
+				"(This binary should probably be called with "
+				"process user set to %s instead of %s)",
+				get_uid_str(uid), get_uid_str(geteuid()),
 				get_uid_str(uid), get_uid_str(geteuid()));
 		}
 	}


More information about the dovecot-cvs mailing list