From 41fe702c284067106eca784a128e403d771595b3 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 20 Feb 2009 17:36:26 -0500 Subject: [PATCH] If chdir() fails with EACCES in mail process creation, log a user-friendly error. --HG-- branch : HEAD --- src/master/mail-process.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/master/mail-process.c b/src/master/mail-process.c index e58944706e..b040f90511 100644 --- a/src/master/mail-process.c +++ b/src/master/mail-process.c @@ -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 process_type, struct settings *set, !(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) { -- 2.47.3