dovecot-1.1: safe_mkstemp(): If fchown() fails, log the used uid...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jul 20 21:53:45 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/054aab723148
changeset: 7777:054aab723148
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jul 20 21:53:33 2008 +0300
description:
safe_mkstemp(): If fchown() fails, log the used uid/gid.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/lib/safe-mkstemp.c |    5 ++++-

diffs (15 lines):

diff -r 5659ce2398e4 -r 054aab723148 src/lib/safe-mkstemp.c
--- a/src/lib/safe-mkstemp.c	Sun Jul 20 21:47:07 2008 +0300
+++ b/src/lib/safe-mkstemp.c	Sun Jul 20 21:53:33 2008 +0300
@@ -44,7 +44,10 @@ int safe_mkstemp(string_t *prefix, mode_
 	}
 	if (uid != (uid_t)-1 || gid != (gid_t)-1) {
 		if (fchown(fd, uid, gid) < 0) {
-			i_error("fchown(%s) failed: %m", str_c(prefix));
+			i_error("fchown(%s, %ld, %ld) failed: %m",
+				str_c(prefix),
+				uid == (uid_t)-1 ? -1L : (long)uid,
+				gid == (gid_t)-1 ? -1L : (long)gid);
 			(void)close(fd);
 			(void)unlink(str_c(prefix));
 			return -1;


More information about the dovecot-cvs mailing list