dovecot-2.0: quota: Give better error message for connect() EACC...

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 6 17:54:17 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/93fe557c0f7b
changeset: 12246:93fe557c0f7b
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 06 15:54:14 2010 +0100
description:
quota: Give better error message for connect() EACCES failure to quota-warning socket.

diffstat:

 src/plugins/quota/quota.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r e92d2aaab3e4 -r 93fe557c0f7b src/plugins/quota/quota.c
--- a/src/plugins/quota/quota.c	Tue Oct 05 22:55:37 2010 +0100
+++ b/src/plugins/quota/quota.c	Wed Oct 06 15:54:14 2010 +0100
@@ -6,6 +6,7 @@
 #include "str.h"
 #include "network.h"
 #include "write-full.h"
+#include "eacces-error.h"
 #include "mailbox-list-private.h"
 #include "quota-private.h"
 #include "quota-fs.h"
@@ -995,7 +996,14 @@
 					  socket_path, NULL);
 	}
 	if ((fd = net_connect_unix_with_retries(socket_path, 1000)) < 0) {
-		i_error("quota: connect(%s) failed: %m", socket_path);
+		if (errno == EACCES) {
+			i_error("quota: %s",
+				eacces_error_get("net_connect_unix",
+						 socket_path));
+		} else {
+			i_error("quota: net_connect_unix(%s) failed: %m",
+				socket_path);
+		}
 		return;
 	}
 


More information about the dovecot-cvs mailing list