dovecot-1.0: If setuid() fails, log the current effective uid.

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 2 17:58:22 EET 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/83d7f262a58f
changeset: 5446:83d7f262a58f
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Nov 02 17:58:15 2007 +0200
description:
If setuid() fails, log the current effective uid.

diffstat:

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

diffs (16 lines):

diff -r 1746473bcc46 -r 83d7f262a58f src/lib/restrict-access.c
--- a/src/lib/restrict-access.c	Fri Nov 02 17:29:25 2007 +0200
+++ b/src/lib/restrict-access.c	Fri Nov 02 17:58:15 2007 +0200
@@ -192,8 +192,10 @@ void restrict_access_by_env(bool disallo
 	env = getenv("RESTRICT_SETUID");
 	uid = env == NULL ? 0 : (uid_t)strtoul(env, NULL, 10);
 	if (uid != 0) {
-		if (setuid(uid) != 0)
-			i_fatal("setuid(%s) failed: %m", dec2str(uid));
+		if (setuid(uid) != 0) {
+			i_fatal("setuid(%s) failed with euid=%s: %m",
+				dec2str(uid), dec2str(geteuid()));
+		}
 	}
 
 	/* verify that we actually dropped the privileges */


More information about the dovecot-cvs mailing list