diff options
author | Jeremy Allison <jra@samba.org> | 2013-09-03 14:07:43 -0700 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-09-04 01:19:05 +0200 |
commit | bdab6f9431715fbfd28f8cc0dfb4dde2966f22f3 (patch) | |
tree | 3aeeec6b70a4bcd8dbfa9d019fdc865d5baf2cfb | |
parent | 68e7b1c9446c7d1274b0fb85b59b90ac1a7f6041 (diff) | |
download | samba-bdab6f9431715fbfd28f8cc0dfb4dde2966f22f3.tar.gz samba-bdab6f9431715fbfd28f8cc0dfb4dde2966f22f3.tar.bz2 samba-bdab6f9431715fbfd28f8cc0dfb4dde2966f22f3.zip |
Optimization. Don't do the retry logic if sitename_fetch() returned NULL, we already did a NULL query.
Bug 5917 - Samba does not work on site with Read Only Domain Controller
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 4 01:19:05 CEST 2013 on sn-devel-104
-rw-r--r-- | source3/libsmb/dsgetdcname.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index bdaa250aaf..6818b01d11 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -1181,9 +1181,13 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, NTSTATUS status; const char *query_site = NULL; char *ptr_to_free = NULL; + bool retry_query_with_null = false; if ((site_name == NULL) || (site_name[0] == '\0')) { ptr_to_free = sitename_fetch(domain_name); + if (ptr_to_free != NULL) { + retry_query_with_null = true; + } query_site = ptr_to_free; } else { query_site = site_name; @@ -1204,7 +1208,7 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, } /* Should we try again with site_name == NULL ? */ - if ((site_name == NULL) || (site_name[0] == '\0')) { + if (retry_query_with_null) { status = dsgetdcname_internal(mem_ctx, msg_ctx, domain_name, |