dovecot-2.0: Allow mail_users_init() without giving socket path.
dovecot at dovecot.org
dovecot at dovecot.org
Wed Oct 21 03:36:36 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/92f2dac233b0
changeset: 10122:92f2dac233b0
user: Timo Sirainen <tss at iki.fi>
date: Tue Oct 20 20:35:17 2009 -0400
description:
Allow mail_users_init() without giving socket path.
diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
src/lib-storage/mail-user.c | 11 ++++++++---
diffs (29 lines):
diff -r cb2882c142e1 -r 92f2dac233b0 src/lib-storage/mail-user.c
--- a/src/lib-storage/mail-user.c Tue Oct 20 20:23:10 2009 -0400
+++ b/src/lib-storage/mail-user.c Tue Oct 20 20:35:17 2009 -0400
@@ -259,6 +259,9 @@ int mail_user_get_home(struct mail_user
return user->_home != NULL ? 1 : 0;
}
+ if (auth_master_conn == NULL)
+ return 0;
+
userdb_pool = pool_alloconly_create("userdb lookup", 512);
ret = auth_master_user_lookup(auth_master_conn, user->username,
&info, userdb_pool, &username, &fields);
@@ -347,10 +350,12 @@ const char *mail_user_get_anvil_userip_i
void mail_users_init(const char *auth_socket_path, bool debug)
{
- auth_master_conn = auth_master_init(auth_socket_path, debug);
+ auth_master_conn = auth_socket_path == NULL ? NULL :
+ auth_master_init(auth_socket_path, debug);
}
void mail_users_deinit(void)
{
- auth_master_deinit(&auth_master_conn);
-}
+ if (auth_master_conn != NULL)
+ auth_master_deinit(&auth_master_conn);
+}
More information about the dovecot-cvs
mailing list