summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_ads.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-06-10 03:50:38 +0000
committerAndrew Tridgell <tridge@samba.org>2003-06-10 03:50:38 +0000
commit057ec70b53c8cf97066fcc6f0673a28d9ccc15ab (patch)
tree435f2ec046ebe756271722361be0003d6a86b4e5 /source3/nsswitch/winbindd_ads.c
parent1d008cd2cb2bf1821bca72328ef33aa76318e282 (diff)
downloadsamba-057ec70b53c8cf97066fcc6f0673a28d9ccc15ab.tar.gz
samba-057ec70b53c8cf97066fcc6f0673a28d9ccc15ab.tar.bz2
samba-057ec70b53c8cf97066fcc6f0673a28d9ccc15ab.zip
- fixed the bug that forced us not to use the winbindd cache when we
have a primary ADS domain and a secondary (trusted) NT4 domain. This caused winbindd to be *really* slow for that setup. - fixed winbindd_getgrgid(), which was calling uid_to_sid instead of gid_to_sid(). When you make changes to winbind *PLEASE* test using nsstest. (This used to be commit cdd9b60a078b63e22f543d4c8d0956ff536f4d89)
Diffstat (limited to 'source3/nsswitch/winbindd_ads.c')
-rw-r--r--source3/nsswitch/winbindd_ads.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index aff3754fe8..04eb65637c 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -65,7 +65,7 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
status = ads_connect(ads);
if (!ADS_ERR_OK(status) || !ads->config.realm) {
- extern struct winbindd_methods msrpc_methods;
+ extern struct winbindd_methods msrpc_methods, cache_methods;
DEBUG(1,("ads_connect for domain %s failed: %s\n",
domain->name, ads_errstr(status)));
ads_destroy(&ads);
@@ -75,7 +75,11 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
if (status.error_type == ADS_ERROR_SYSTEM &&
status.err.rc == ECONNREFUSED) {
DEBUG(1,("Trying MSRPC methods\n"));
- domain->methods = &msrpc_methods;
+ if (domain->methods == &cache_methods) {
+ domain->backend = &msrpc_methods;
+ } else {
+ domain->methods = &msrpc_methods;
+ }
}
return NULL;
}