summaryrefslogtreecommitdiffstats
path: root/source/libsmb/namequery.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-08-30 04:40:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:59 -0500
commitab3f0c5b1e9c5fd192c5514cbe9451b938f9cd5d (patch)
tree662e9bc2f69243c0d74087fa52d46c2445dc207f /source/libsmb/namequery.c
parent70edd716ef0ccb218fe18d1233bd30abe46b62bf (diff)
downloadsamba-ab3f0c5b1e9c5fd192c5514cbe9451b938f9cd5d.tar.gz
samba-ab3f0c5b1e9c5fd192c5514cbe9451b938f9cd5d.tar.xz
samba-ab3f0c5b1e9c5fd192c5514cbe9451b938f9cd5d.zip
r17928: Implement the basic store for CLDAP sitename
support when looking up DC's. On every CLDAP call store the returned client sitename (if present, delete store if not) in gencache with infinate timeout. On AD DNS DC lookup, try looking for sitename DC's first, only try generic if sitename DNS lookup failed. I still haven't figured out yet how to ensure we fetch the sitename with a CLDAP query before doing the generic DC list lookup. This code is difficult to understand. I'll do some experiments and backtraces tomorrow to try and work out where to force a CLDAP site query first. Jeremy.
Diffstat (limited to 'source/libsmb/namequery.c')
-rw-r--r--source/libsmb/namequery.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c
index dcb7dbf0708..4c361a37165 100644
--- a/source/libsmb/namequery.c
+++ b/source/libsmb/namequery.c
@@ -111,7 +111,6 @@ char *saf_fetch( const char *domain )
return server;
}
-
/****************************************************************************
Generate a random trn_id.
****************************************************************************/
@@ -1044,6 +1043,7 @@ static BOOL resolve_ads(const char *name, int name_type,
status = ads_dns_query_dcs( ctx, name, &dcs, &numdcs );
if ( !NT_STATUS_IS_OK( status ) ) {
+ talloc_destroy(ctx);
return False;
}
@@ -1053,6 +1053,7 @@ static BOOL resolve_ads(const char *name, int name_type,
if ( (*return_iplist = SMB_MALLOC_ARRAY(struct ip_service, numaddrs)) == NULL ) {
DEBUG(0,("resolve_ads: malloc failed for %d entries\n", numaddrs ));
+ talloc_destroy(ctx);
return False;
}
@@ -1096,8 +1097,7 @@ static BOOL resolve_ads(const char *name, int name_type,
(*return_count)++;
}
- TALLOC_FREE( dcs );
-
+ talloc_destroy(ctx);
return True;
}