dovecot-1.2: file_dotlock_open_*() shouldn't try to fchmod() wit...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jul 7 19:40:36 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/d6337be8ae30
changeset: 9187:d6337be8ae30
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jul 07 12:40:31 2009 -0400
description:
file_dotlock_open_*() shouldn't try to fchmod() with no uid/gid change.
Patch by Ralf Becker.

diffstat:

1 file changed, 1 insertion(+), 1 deletion(-)
src/lib/file-dotlock.c |    2 +-

diffs (12 lines):

diff -r f70192e7ff3c -r d6337be8ae30 src/lib/file-dotlock.c
--- a/src/lib/file-dotlock.c	Wed Jul 01 21:52:54 2009 +0200
+++ b/src/lib/file-dotlock.c	Tue Jul 07 12:40:31 2009 -0400
@@ -780,7 +780,7 @@ file_dotlock_open_mode_full(const struct
 	fd = file_dotlock_open(set, path, flags, &dotlock);
 	umask(old_mask);
 
-	if (fd != -1) {
+	if (fd != -1 && (uid != (uid)-1 || gid != (gid_t)-1)) {
 		if (fchown(fd, uid, gid) < 0) {
 			if (errno == EPERM && uid == (uid_t)-1) {
 				i_error("%s", eperm_error_get_chgrp("fchown",


More information about the dovecot-cvs mailing list