From bf0f3be29dc04f51ebf18425abb41979fdb7897a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 4 Sep 2003 19:45:04 +0000 Subject: Check in Andrew's fix for bug #305 (always use lp_realm() ) Also make sure thet ads_startup uses lp_realm instead of just relying on the workgroup name. Fixes bug in net ads join when the workgroup defaults to "WORKGROUP" and we ignore the realm name. (This used to be commit b1763ace4e85f41574894e3807cabb5196fec661) --- source3/nsswitch/winbindd_ads.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'source3/nsswitch/winbindd_ads.c') diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c index 19babae46b..2e01b5043d 100644 --- a/source3/nsswitch/winbindd_ads.c +++ b/source3/nsswitch/winbindd_ads.c @@ -28,10 +28,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND -/* the realm of our primary LDAP server */ -static char *primary_realm; - - /* return our ads connections structure for a domain. We keep the connection open to make things faster @@ -58,10 +54,8 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain) SAFE_FREE(ads->auth.password); ads->auth.password = secrets_fetch_machine_password(lp_workgroup(), NULL, NULL); - if (primary_realm) { - SAFE_FREE(ads->auth.realm); - ads->auth.realm = strdup(primary_realm); - } + SAFE_FREE(ads->auth.realm); + ads->auth.realm = strdup(lp_realm()); status = ads_connect(ads); if (!ADS_ERR_OK(status) || !ads->config.realm) { @@ -84,11 +78,6 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain) return NULL; } - /* remember our primary realm for trusted domain support */ - if (!primary_realm) { - primary_realm = strdup(ads->config.realm); - } - domain->private = (void *)ads; return ads; } -- cgit