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

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 8 19:09:10 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/2795a5c52d92
changeset: 10863:2795a5c52d92
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 08 19:09:00 2010 +0200
description:
Improved setgid/setuid failure's error message.

diffstat:

 src/lib/failures.c          |   3 +++
 src/lib/mempool-alloconly.c |   4 ++--
 src/lib/restrict-access.c   |  14 ++++++++++----
 3 files changed, 15 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r 97216501ba6b -r 2795a5c52d92 src/lib/failures.c
--- a/src/lib/failures.c	Mon Mar 08 18:37:45 2010 +0200
+++ b/src/lib/failures.c	Mon Mar 08 19:09:00 2010 +0200
@@ -160,6 +160,7 @@
 			i_error("Raw backtrace: %s", backtrace);
 	}
 
+	sleep(3600*24);
 	if (type == LOG_TYPE_PANIC)
 		abort();
 	else
@@ -597,6 +598,8 @@
 {
 	if (internal_handler(type, fmt, args) < 0)
 		failure_exit(FATAL_LOGERROR);
+	if (type == LOG_TYPE_ERROR)
+		sleep(3600*24);
 }
 
 void i_set_failure_internal(void)
diff -r 97216501ba6b -r 2795a5c52d92 src/lib/mempool-alloconly.c
--- a/src/lib/mempool-alloconly.c	Mon Mar 08 18:37:45 2010 +0200
+++ b/src/lib/mempool-alloconly.c	Mon Mar 08 19:09:00 2010 +0200
@@ -244,8 +244,8 @@
 			   stack, so make sure everything is allocated before
 			   calling it. */
 			t_buffer_alloc_last_full();
-			i_warning("Growing pool '%s' with: %"PRIuSIZE_T,
-				  apool->name, size);
+			/*i_warning("Growing pool '%s' with: %"PRIuSIZE_T,
+				  apool->name, size);*/
 		}
 #endif
 	}
diff -r 97216501ba6b -r 2795a5c52d92 src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Mon Mar 08 18:37:45 2010 +0200
+++ b/src/lib/restrict-access.c	Mon Mar 08 19:09:00 2010 +0200
@@ -70,10 +70,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;
 	}
@@ -291,7 +294,10 @@
 	/* uid last */
 	if (set->uid != (uid_t)-1) {
 		if (setuid(set->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(set->uid), get_uid_str(geteuid()),
 				get_uid_str(set->uid), get_uid_str(geteuid()));
 		}
 	}


More information about the dovecot-cvs mailing list