From: Timo Sirainen Date: Tue, 31 Aug 2010 19:04:24 +0000 (+0100) Subject: auth: Give better EACCES error if we can't connect to auth-worker. X-Git-Tag: 2.0.2~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43fb7851fd5db1cd0edf2dc975bf89780043baaa;p=thirdparty%2Fdovecot%2Fcore.git auth: Give better EACCES error if we can't connect to auth-worker. --- diff --git a/src/auth/auth-worker-server.c b/src/auth/auth-worker-server.c index 6eccea89b7..232f1c09aa 100644 --- a/src/auth/auth-worker-server.c +++ b/src/auth/auth-worker-server.c @@ -9,6 +9,7 @@ #include "ostream.h" #include "hex-binary.h" #include "str.h" +#include "eacces-error.h" #include "auth-request.h" #include "auth-worker-client.h" #include "auth-worker-server.h" @@ -153,8 +154,13 @@ static struct auth_worker_connection *auth_worker_create(void) fd = net_connect_unix_with_retries(worker_socket_path, 5000); if (fd == -1) { - i_fatal("net_connect_unix(%s) failed: %m", - worker_socket_path); + if (errno == EACCES) { + i_fatal("%s", eacces_error_get("net_connect_unix", + worker_socket_path)); + } else { + i_fatal("net_connect_unix(%s) failed: %m", + worker_socket_path); + } } conn = i_new(struct auth_worker_connection, 1);