dovecot-2.0: lib-storage: If user->error is set during initializ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 21 20:05:23 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/7dd6ff192718
changeset: 12149:7dd6ff192718
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 21 18:04:30 2010 +0100
description:
lib-storage: If user->error is set during initialization, fail user creation.

diffstat:

 src/lib-storage/mail-user.c |  5 +++++
 src/lib-storage/mail-user.h |  3 ++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r c758655c6270 -r 7dd6ff192718 src/lib-storage/mail-user.c
--- a/src/lib-storage/mail-user.c	Tue Sep 21 16:30:20 2010 +0100
+++ b/src/lib-storage/mail-user.c	Tue Sep 21 18:04:30 2010 +0100
@@ -114,6 +114,11 @@
 
 	user->initialized = TRUE;
 	hook_mail_user_created(user);
+
+	if (user->error != NULL) {
+		*error_r = t_strdup(user->error);
+		return -1;
+	}
 	return 0;
 }
 
diff -r c758655c6270 -r 7dd6ff192718 src/lib-storage/mail-user.h
--- a/src/lib-storage/mail-user.h	Tue Sep 21 16:30:20 2010 +0100
+++ b/src/lib-storage/mail-user.h	Tue Sep 21 18:04:30 2010 +0100
@@ -23,7 +23,8 @@
 	const char *service;
 	struct ip_addr *local_ip, *remote_ip;
 	const struct var_expand_table *var_expand_table;
-	/* error during initialization */
+	/* If non-NULL, fail the user initialization with this error.
+	   This could be set by plugins that need to fail the initialization. */
 	const char *error;
 
 	const struct setting_parser_info *set_info;


More information about the dovecot-cvs mailing list