From 10ada62bedd6edaaf1311ce03bf9695f927de7b9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Oct 2006 17:33:57 +0000 Subject: r19148: Finish last nights patch - make offline work again. Still under test. Jeremy. (This used to be commit 40a455db78f805daa6bfeb9e78fb78dcc12fd9a7) --- source3/nsswitch/winbindd_util.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'source3/nsswitch/winbindd_util.c') diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index f26ec9232b..a6d6959446 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -474,13 +474,25 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai domain->dcaddr.sin_port = 0; } - set_dc_type_and_flags(domain); + init_dc_connection(domain); +#if 1 + if (!domain->initialized) { + /* If we return error here we can't do any cached authentication, + but we may be in disconnected mode and can't initialize correctly. + Do what the previous code did and just return without initialization, + once we go online we'll re-initialize. + */ + DEBUG(5, ("winbindd_dual_init_connection: %s returning without initialization " + "online = %d\n", domain->name, (int)domain->online )); + } +#else if (!domain->initialized) { DEBUG(1, ("Could not initialize domain %s\n", state->request.domain_name)); return WINBINDD_ERROR; } +#endif fstrcpy(state->response.data.domain_info.name, domain->name); fstrcpy(state->response.data.domain_info.alt_name, domain->alt_name); @@ -585,7 +597,7 @@ struct winbindd_domain *find_domain_from_name(const char *domain_name) return NULL; if (!domain->initialized) - set_dc_type_and_flags(domain); + init_dc_connection(domain); return domain; } @@ -620,7 +632,7 @@ struct winbindd_domain *find_domain_from_sid(const DOM_SID *sid) return NULL; if (!domain->initialized) - set_dc_type_and_flags(domain); + init_dc_connection(domain); return domain; } -- cgit