dovecot-1.2: If chdir() fails with EACCES in mail process creati...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 21 00:36:31 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/2e563febbc67
changeset: 8760:2e563febbc67
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 20 17:36:26 2009 -0500
description:
If chdir() fails with EACCES in mail process creation, log a user-friendly error.

diffstat:

1 file changed, 8 insertions(+), 2 deletions(-)
src/master/mail-process.c |   10 ++++++++--

diffs (27 lines):

diff -r 6ec819adfde3 -r 2e563febbc67 src/master/mail-process.c
--- a/src/master/mail-process.c	Fri Feb 20 17:35:49 2009 -0500
+++ b/src/master/mail-process.c	Fri Feb 20 17:36:26 2009 -0500
@@ -4,6 +4,7 @@
 #include "array.h"
 #include "hash.h"
 #include "fd-close-on-exec.h"
+#include "eacces-error.h"
 #include "env-util.h"
 #include "base64.h"
 #include "str.h"
@@ -814,8 +815,13 @@ create_mail_process(enum process_type pr
 				!(ENOTFOUND(chdir_errno) ||
 				  chdir_errno == EINTR))) {
 			errno = chdir_errno;
-			i_fatal("chdir(%s) failed with uid %s: %m",
-				full_home_dir, dec2str(uid));
+			if (errno != EACCES) {
+				i_fatal("chdir(%s) failed with uid %s: %m",
+					full_home_dir, dec2str(uid));
+			} else {
+				i_fatal("%s", eacces_error_get("chdir",
+							       full_home_dir));
+			}
 		}
 	}
 	if (ret < 0) {


More information about the dovecot-cvs mailing list