summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2017-08-06 18:11:02 +0200
committerKarolin Seeger <kseeger@samba.org>2018-05-24 12:50:13 +0200
commitea49628bdc94c960a60d466f963f5d97afa5953e (patch)
tree3012c60e338ba597497522b5a8572397a7d914ca /source3
parent7626db2b28b97534afd01753f3da3da9ff5f7ace (diff)
downloadsamba-ea49628bdc94c960a60d466f963f5d97afa5953e.tar.gz
winbindd: Factor out winbindd_domain_init_backend from get_cache()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13369 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_cache.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 98c69f8b231..8492f907553 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -119,12 +119,11 @@ static char *wcache_path(void)
return state_path("winbindd_cache.tdb");
}
-/* get the winbind_cache structure */
-static struct winbind_cache *get_cache(struct winbindd_domain *domain)
+static void winbindd_domain_init_backend(struct winbindd_domain *domain)
{
- struct winbind_cache *ret = wcache;
-
- /* We have to know what type of domain we are dealing with first. */
+ if (domain->backend != NULL) {
+ return;
+ }
if (domain->internal) {
domain->backend = &builtin_passdb_methods;
@@ -189,6 +188,14 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain)
DBG_INFO("Setting MS-RPC methods for domain %s\n", domain->name);
domain->backend = &reconnect_methods;
}
+}
+
+/* get the winbind_cache structure */
+static struct winbind_cache *get_cache(struct winbindd_domain *domain)
+{
+ struct winbind_cache *ret = wcache;
+
+ winbindd_domain_init_backend(domain);
if (ret != NULL) {
return ret;