diff options
-rw-r--r-- | source3/winbindd/winbindd_cache.c | 8 | ||||
-rw-r--r-- | source3/winbindd/winbindd_util.c | 7 |
2 files changed, 10 insertions, 5 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index 1bfbdb6699..a3e202bc7e 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -41,6 +41,7 @@ extern struct winbindd_methods reconnect_methods; extern struct winbindd_methods ads_methods; #endif extern struct winbindd_methods builtin_passdb_methods; +extern struct winbindd_methods sam_passdb_methods; /* * JRA. KEEP THIS LIST UP TO DATE IF YOU ADD CACHE ENTRIES. @@ -143,6 +144,13 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain) domain->backend = &builtin_passdb_methods; domain->initialized = True; } + + if (strequal(domain->name, get_global_sam_name()) && + sid_equal(&domain->sid, get_global_sam_sid())) { + domain->backend = &sam_passdb_methods; + domain->initialized = True; + } + if ( !domain->initialized ) { init_dc_connection( domain ); } diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 735a446e07..55874e057f 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -27,9 +27,6 @@ #define DBGC_CLASS DBGC_WINBIND extern struct winbindd_methods cache_methods; -extern struct winbindd_methods builtin_passdb_methods; -extern struct winbindd_methods sam_passdb_methods; - /** * @file winbindd_util.c @@ -598,7 +595,7 @@ bool init_domain_list(void) /* BUILTIN domain */ - domain = add_trusted_domain("BUILTIN", NULL, &builtin_passdb_methods, + domain = add_trusted_domain("BUILTIN", NULL, &cache_methods, &global_sid_Builtin); if (domain) { setup_domain_child(domain); @@ -607,7 +604,7 @@ bool init_domain_list(void) /* Local SAM */ domain = add_trusted_domain(get_global_sam_name(), NULL, - &sam_passdb_methods, get_global_sam_sid()); + &cache_methods, get_global_sam_sid()); if (domain) { if ( role != ROLE_DOMAIN_MEMBER ) { domain->primary = True; |