dovecot: If setgid() fails, includ euid and egid in the log mess...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Nov 3 17:57:54 EET 2007
details: http://hg.dovecot.org/dovecot/rev/2a49ba9789b1
changeset: 6671:2a49ba9789b1
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 03af6da2ace1 -r 2a49ba9789b1 src/lib/restrict-access.c
--- a/src/lib/restrict-access.c Sat Nov 03 17:14:57 2007 +0200
+++ b/src/lib/restrict-access.c Sat Nov 03 17:57:46 2007 +0200
@@ -143,8 +143,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 || *env == '\0') {
More information about the dovecot-cvs
mailing list