summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-09-03 12:04:37 -0700
committerKarolin Seeger <kseeger@samba.org>2013-09-18 10:41:22 +0200
commit6b03f5c490be465112df7dfab0d225431410c096 (patch)
tree9ea1d0bed33a2340b19b02789e0f9863d9c72fa4
parentdbe314b716476c04f0b69b121c869451e5b27a00 (diff)
downloadsamba-6b03f5c490be465112df7dfab0d225431410c096.tar.gz
Refactor dsgetdcname to be called via a wrapper function.
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> Reviewed-by: Richard Sharpe <rsharpe@samba.org> (cherry picked from commit 66006be7ef703b2935334633d27641050cee5f58) (cherry picked from commit ac4ce44d787f448e8dce7b2eca558cecdc75499e)
-rw-r--r--source3/libsmb/dsgetdcname.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index 305baca44d7..6e0d935c960 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -1082,12 +1082,10 @@ static bool is_closest_site(struct netr_DsRGetDCNameInfo *info)
}
/********************************************************************
- dsgetdcname.
-
- This will be the only public function here.
+ Internal dsgetdcname.
********************************************************************/
-NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
+static NTSTATUS dsgetdcname_internal(TALLOC_CTX *mem_ctx,
struct messaging_context *msg_ctx,
const char *domain_name,
const struct GUID *domain_guid,
@@ -1101,7 +1099,7 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
bool first = true;
struct netr_DsRGetDCNameInfo *first_info = NULL;
- DEBUG(10,("dsgetdcname: domain_name: %s, "
+ DEBUG(10,("dsgetdcname_internal: domain_name: %s, "
"domain_guid: %s, site_name: %s, flags: 0x%08x\n",
domain_name,
domain_guid ? GUID_string(mem_ctx, domain_guid) : "(null)",
@@ -1163,3 +1161,26 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
*info = myinfo;
return NT_STATUS_OK;
}
+
+/********************************************************************
+ dsgetdcname.
+
+ This will be the only public function here.
+********************************************************************/
+
+NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
+ struct messaging_context *msg_ctx,
+ const char *domain_name,
+ const struct GUID *domain_guid,
+ const char *site_name,
+ uint32_t flags,
+ struct netr_DsRGetDCNameInfo **info)
+{
+ return dsgetdcname_internal(mem_ctx,
+ msg_ctx,
+ domain_name,
+ domain_guid,
+ site_name,
+ flags,
+ info);
+}