summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-07-06 12:50:48 +0200
committerAndreas Schneider <asn@samba.org>2010-07-06 18:38:14 +0200
commit11ae9aff971759f2b4658b294e9f1845500ecd4e (patch)
treec0b69aede62bfbf3561e82835bdc92f00e1b5ce2
parent66fc77e8863ef126317c1077628989e437827514 (diff)
downloadsamba-11ae9aff971759f2b4658b294e9f1845500ecd4e.tar.gz
samba-11ae9aff971759f2b4658b294e9f1845500ecd4e.tar.bz2
samba-11ae9aff971759f2b4658b294e9f1845500ecd4e.zip
s3-winbind: Fixed the winbind caching.
-rw-r--r--source3/winbindd/winbindd_cache.c8
-rw-r--r--source3/winbindd/winbindd_util.c7
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;