summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_site.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-05-16 13:03:01 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-05-16 13:03:01 +1000
commit58e7f253eafecca6934162034e88ee19b103c6ee (patch)
tree396365633a8c53434fbb62d33ecfcf9f404c337a /source4/libnet/libnet_site.c
parentd55e57ca99de4c094113c18bf18179923f641887 (diff)
downloadsamba-58e7f253eafecca6934162034e88ee19b103c6ee.tar.gz
samba-58e7f253eafecca6934162034e88ee19b103c6ee.tar.bz2
samba-58e7f253eafecca6934162034e88ee19b103c6ee.zip
Rework the CLDAP and NBT netlogon requests and responses.
This now matches section 7.3.3 of the MS-ATDS specification, and all our current tests pass against windows. There is still more testing to do, and the server implementation to complete. Andrew Bartlett (This used to be commit 431d0c03965cbee85691cd0dc1e2a509c1a2b717)
Diffstat (limited to 'source4/libnet/libnet_site.c')
-rw-r--r--source4/libnet/libnet_site.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index f39d9e039c..bb65de1f54 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -53,11 +53,12 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li
search.in.dest_address = r->in.dest_address;
search.in.dest_port = r->in.cldap_port;
search.in.acct_control = -1;
- search.in.version = 6;
+ search.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX;
+ search.in.map_response = true;
cldap = cldap_socket_init(tmp_ctx, lctx->event_ctx, lp_iconv_convenience(global_loadparm));
status = cldap_netlogon(cldap, tmp_ctx, &search);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NT_STATUS_IS_OK(status) || !search.out.netlogon.nt5_ex.client_site) {
/*
If cldap_netlogon() returns in error,
default to using Default-First-Site-Name.
@@ -71,7 +72,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li
}
} else {
site_name_str = talloc_asprintf(tmp_ctx, "%s",
- search.out.netlogon.logon5.client_site);
+ search.out.netlogon.nt5_ex.client_site);
if (!site_name_str) {
r->out.error_string = NULL;
talloc_free(tmp_ctx);