]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If chdir() fails with EACCES in mail process creation, log a user-friendly error.
authorTimo Sirainen <tss@iki.fi>
Fri, 20 Feb 2009 22:36:26 +0000 (17:36 -0500)
committerTimo Sirainen <tss@iki.fi>
Fri, 20 Feb 2009 22:36:26 +0000 (17:36 -0500)
--HG--
branch : HEAD

src/master/mail-process.c

index e58944706e140a1642e98db87c786926f1d01559..b040f905116c4f525b933d65fde30e47cd4f52f2 100644 (file)
@@ -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) {