From b135f4467f8413f6ac44df54b8430305f6c26c0c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 12 Jan 2006 03:02:00 +0000 Subject: r12858: This moves the libnet_LookupPdc code to use a GetDC request to find the remote server's name, or in the absence of a local nbt_server to communicate with (or without root access), a node status request. The result is that we are in a better position to use kerberos, as well as to remove the 'password server' mandatory parameter for the samsync and samdump commands. (I need this to put these into SWAT). The only problem I have is that I must create a messaging context, which requires a server ID. As a client process, I don't expect to get messages, but it is currently required for replies, so I generate a random() number. We probably need the servers to accept connections on streamed sockets too, for client-only tasks that want IRPC. Because I wanted to test this code, I have put the NET-API-* tests into our test scripts, to ensure they pass and keep passing. They are good frontends onto the libnet system, and I see no reason not to test them. In doing so the NET-API-RPCCONNECT test was simplified to take a binding string on the command line, removing duplicate code, and testing the combinations in the scripts instead. (I have done a bit of work on the list shares code in libnet_share.c to make it pass 'make test') In the future, I would like to extend the libcli/findds.c code (based off volker's winbind/wb_async_helpers.c, which is why it shows up a bit odd in the patch) to handle getting multiple name replies, sending a getdc request to each in turn. (posted to samba-technical for review, and I'll happily update with any comments) Andrew Bartlett (This used to be commit 7ccddfd3515fc2c0d6f447c768ccbf7a220c3380) --- source4/libcli/finddcs.c | 245 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 source4/libcli/finddcs.c (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c new file mode 100644 index 0000000000..ff4b255a13 --- /dev/null +++ b/source4/libcli/finddcs.c @@ -0,0 +1,245 @@ +/* + Unix SMB/CIFS implementation. + + a composite API for finding a DC and its name + + Copyright (C) Volker Lendecke 2005 + Copyright (C) Andrew Bartlett 2006 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "include/includes.h" +#include "lib/messaging/irpc.h" +#include "librpc/gen_ndr/ndr_irpc.h" +#include "librpc/gen_ndr/ndr_samr.h" +#include "libcli/composite/composite.h" +#include "libcli/libcli.h" + +struct finddcs_state { + struct composite_context *ctx; + struct messaging_context *msg_ctx; + + const char *domain_name; + struct dom_sid *domain_sid; + + struct nbtd_getdcname r; + struct nbt_name_status node_status; + + int num_dcs; + struct nbt_dc_name *dcs; +}; + +static void finddcs_name_resolved(struct composite_context *ctx); +static void finddcs_getdc_replied(struct irpc_request *ireq); +static void fallback_node_status(struct finddcs_state *state); +static void fallback_node_status_replied(struct nbt_name_request *name_req); + +/* + * Setup and send off the a normal name resolution for the target name. + * + * The domain_sid parameter is optional, and is used in the subsequent getdc request. + * + * This will try a GetDC request, but this may not work. It will try + * a node status as a fallback, then return no name (but still include + * the IP) + */ + +struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, + const char *domain_name, + int name_type, + struct dom_sid *domain_sid, + const char **methods, + struct event_context *event_ctx, + struct messaging_context *msg_ctx) +{ + struct composite_context *result, *ctx; + struct finddcs_state *state; + struct nbt_name name; + + result = talloc(mem_ctx, struct composite_context); + if (result == NULL) goto failed; + result->state = COMPOSITE_STATE_IN_PROGRESS; + result->async.fn = NULL; + result->event_ctx = event_ctx; + + state = talloc(result, struct finddcs_state); + if (state == NULL) goto failed; + state->ctx = result; + result->private_data = state; + + state->domain_name = talloc_strdup(state, domain_name); + if (state->domain_name == NULL) goto failed; + state->domain_sid = domain_sid; + if (domain_sid != NULL) { + if (talloc_reference(state, domain_sid) == NULL) { + goto failed; + } + } + state->msg_ctx = msg_ctx; + + make_nbt_name(&name, state->domain_name, name_type); + ctx = resolve_name_send(&name, result->event_ctx, + methods); + + if (ctx == NULL) goto failed; + ctx->async.fn = finddcs_name_resolved; + ctx->async.private_data = state; + + return result; + +failed: + talloc_free(result); + return NULL; +} + +/* Having got an name query answer, fire off a GetDC request, so we + * can find the target's all-important name. (Kerberos and some + * netlogon operations are quite picky about names) + * + * The name is a courtasy, if we don't find it, don't compleatly fail. + * + * However, if the nbt server is down, fall back to a node status + * request + */ +static void finddcs_name_resolved(struct composite_context *ctx) +{ + struct finddcs_state *state = + talloc_get_type(ctx->async.private_data, struct finddcs_state); + struct irpc_request *ireq; + uint32_t *nbt_servers; + const char *address; + + state->ctx->status = resolve_name_recv(ctx, state, &address); + if (!composite_is_ok(state->ctx)) return; + + state->num_dcs = 1; + state->dcs = talloc_array(state, struct nbt_dc_name, state->num_dcs); + if (composite_nomem(state->dcs, state->ctx)) return; + + state->dcs[0].address = talloc_steal(state->dcs, address); + + /* Try and find the nbt server. We are not going to fail if + * we can't get the name, it will just be a disapointment. + * The nbt server just might not be running */ + nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server"); + if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) { + fallback_node_status(state); + return; + } + + state->r.in.domainname = state->domain_name; + state->r.in.ip_address = state->dcs[0].address; + state->r.in.my_computername = lp_netbios_name(); + state->r.in.my_accountname = talloc_asprintf(state, "%s$", + lp_netbios_name()); + if (composite_nomem(state->r.in.my_accountname, state->ctx)) return; + state->r.in.account_control = ACB_WSTRUST; + state->r.in.domain_sid = state->domain_sid; + + ireq = irpc_call_send(state->msg_ctx, nbt_servers[0], + &dcerpc_table_irpc, DCERPC_NBTD_GETDCNAME, + &state->r, state); + if (!ireq) { + fallback_node_status(state); + return; + } + + composite_continue_irpc(state->ctx, ireq, finddcs_getdc_replied, state); +} + +/* Called when the GetDC request returns */ +static void finddcs_getdc_replied(struct irpc_request *ireq) +{ + struct finddcs_state *state = + talloc_get_type(ireq->async.private, struct finddcs_state); + + state->ctx->status = irpc_call_recv(ireq); + if (!composite_is_ok(state->ctx)) return; + + state->dcs[0].name = talloc_steal(state->dcs, state->r.out.dcname); + composite_done(state->ctx); +} + +/* The GetDC request might not be availible (such as occours when the + * NBT server is down). Fallback to a node status. It is the best + * hope we have... */ +static void fallback_node_status(struct finddcs_state *state) +{ + struct nbt_name_socket *nbtsock; + struct nbt_name_request *name_req; + + state->node_status.in.name.name = "*"; + state->node_status.in.name.type = NBT_NAME_CLIENT; + state->node_status.in.name.scope = NULL; + state->node_status.in.dest_addr = state->dcs[0].address; + state->node_status.in.timeout = 1; + state->node_status.in.retries = 2; + + nbtsock = nbt_name_socket_init(state, state->ctx->event_ctx); + if (composite_nomem(nbtsock, state->ctx)) return; + + name_req = nbt_name_status_send(nbtsock, &state->node_status); + if (composite_nomem(name_req, state->ctx)) return; + + composite_continue_nbt(state->ctx, + name_req, + fallback_node_status_replied, + state); +} + +/* We have a node status reply (or perhaps a timeout) */ +static void fallback_node_status_replied(struct nbt_name_request *name_req) +{ + struct finddcs_state *state = talloc_get_type(name_req->async.private, struct finddcs_state); + state->ctx->status = nbt_name_status_recv(name_req, state, &state->node_status); + if (!composite_is_ok(state->ctx)) return; + + if (state->node_status.out.status.num_names > 0) { + state->dcs[0].name = talloc_steal(state->dcs, state->node_status.out.status.names[0].name); + composite_done(state->ctx); + return; + } + composite_error(state->ctx, NT_STATUS_NO_LOGON_SERVERS); +} + +NTSTATUS finddcs_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, + int *num_dcs, struct nbt_dc_name **dcs) +{ + NTSTATUS status = composite_wait(c); + if (NT_STATUS_IS_OK(status)) { + struct finddcs_state *state = + talloc_get_type(c->private_data, struct finddcs_state); + *num_dcs = state->num_dcs; + *dcs = talloc_steal(mem_ctx, state->dcs); + } + talloc_free(c); + return status; +} + +NTSTATUS finddcs(TALLOC_CTX *mem_ctx, + const char *domain_name, int name_type, + struct dom_sid *domain_sid, + const char **methods, + struct event_context *event_ctx, + struct messaging_context *msg_ctx, + int *num_dcs, struct nbt_dc_name **dcs) +{ + struct composite_context *c = finddcs_send(mem_ctx, + domain_name, name_type, + domain_sid, methods, + event_ctx, msg_ctx); + return finddcs_recv(c, mem_ctx, num_dcs, dcs); +} -- cgit From 4b2ed199ca12cedab42683e628eb7e8da6eb0fb4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 12 Jan 2006 03:30:20 +0000 Subject: r12861: Cope when we are not supplied the messaging context. This is just another case where we have to fallback to the node status request. Andrew Bartlett (This used to be commit 181064dbcf102de80937fc30b3d3ba5114194a72) --- source4/libcli/finddcs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index ff4b255a13..036b937f69 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -131,9 +131,15 @@ static void finddcs_name_resolved(struct composite_context *ctx) state->dcs[0].address = talloc_steal(state->dcs, address); - /* Try and find the nbt server. We are not going to fail if - * we can't get the name, it will just be a disapointment. - * The nbt server just might not be running */ + /* Try and find the nbt server. Fallback to a node status + * request if we can't make this happen The nbt server just + * might not be running, or we may not have a messaging + * context (not root etc) */ + if (!state->msg_ctx) { + fallback_node_status(state); + return; + } + nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server"); if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) { fallback_node_status(state); -- cgit From 3f8ee534bafa149c00f050abea8ae111fea61287 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 12 Jan 2006 06:44:28 +0000 Subject: r12862: Need to trim spaces off the end of the node status reply. Andrew Bartlett (This used to be commit 3e90e7edfa7d343a6b6bf073b8f4d018e3b463d0) --- source4/libcli/finddcs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 036b937f69..3b72cceba0 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -214,7 +214,16 @@ static void fallback_node_status_replied(struct nbt_name_request *name_req) if (!composite_is_ok(state->ctx)) return; if (state->node_status.out.status.num_names > 0) { - state->dcs[0].name = talloc_steal(state->dcs, state->node_status.out.status.names[0].name); + int i; + char *name = talloc_strndup(state->dcs, state->node_status.out.status.names[0].name, 15); + /* Strip space padding */ + if (name) { + i = MIN(strlen(name), 15); + for (; i > 0 && name[i - 1] == ' '; i--) { + name[i - 1] = '\0'; + } + } + state->dcs[0].name = name; composite_done(state->ctx); return; } -- cgit From e2ce6fec9cfb9d3efbe0e97a8faf7f60a8ea3a1d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 24 Jan 2006 01:57:31 +0000 Subject: r13103: Walk the names in the node status request, so I can find a server name, and use that. (I was trying to find a machine by the name of __SAMBA__) Andrew Bartlett (This used to be commit cde044d023c7580442bceb60ac62dc4cfc1b85fe) --- source4/libcli/finddcs.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 3b72cceba0..9caf9b5578 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -209,23 +209,26 @@ static void fallback_node_status(struct finddcs_state *state) /* We have a node status reply (or perhaps a timeout) */ static void fallback_node_status_replied(struct nbt_name_request *name_req) { + int i; struct finddcs_state *state = talloc_get_type(name_req->async.private, struct finddcs_state); state->ctx->status = nbt_name_status_recv(name_req, state, &state->node_status); if (!composite_is_ok(state->ctx)) return; - if (state->node_status.out.status.num_names > 0) { - int i; - char *name = talloc_strndup(state->dcs, state->node_status.out.status.names[0].name, 15); - /* Strip space padding */ - if (name) { - i = MIN(strlen(name), 15); - for (; i > 0 && name[i - 1] == ' '; i--) { - name[i - 1] = '\0'; + for (i=0; i < state->node_status.out.status.num_names; i++) { + int j; + if (state->node_status.out.status.names[i].type == NBT_NAME_SERVER) { + char *name = talloc_strndup(state->dcs, state->node_status.out.status.names[0].name, 15); + /* Strip space padding */ + if (name) { + j = MIN(strlen(name), 15); + for (; j > 0 && name[j - 1] == ' '; j--) { + name[j - 1] = '\0'; + } } + state->dcs[0].name = name; + composite_done(state->ctx); + return; } - state->dcs[0].name = name; - composite_done(state->ctx); - return; } composite_error(state->ctx, NT_STATUS_NO_LOGON_SERVERS); } -- cgit From 4ac2be99588b48b0652a524bf12fb1aa9c3f5fbb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 7 Mar 2006 11:07:23 +0000 Subject: r13924: Split more prototypes out of include/proto.h + initial work on header file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781) --- source4/libcli/finddcs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 9caf9b5578..085aa352ac 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -27,6 +27,7 @@ #include "librpc/gen_ndr/ndr_samr.h" #include "libcli/composite/composite.h" #include "libcli/libcli.h" +#include "libcli/resolve/resolve.h" struct finddcs_state { struct composite_context *ctx; -- cgit From 8528016978b084213ef53d66e1b6e831b1a01acc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 00:23:11 +0000 Subject: r14464: Don't include ndr_BASENAME.h files unless strictly required, instead try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd) --- source4/libcli/finddcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 085aa352ac..9ed20b77ba 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -24,7 +24,7 @@ #include "include/includes.h" #include "lib/messaging/irpc.h" #include "librpc/gen_ndr/ndr_irpc.h" -#include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/gen_ndr/samr.h" #include "libcli/composite/composite.h" #include "libcli/libcli.h" #include "libcli/resolve/resolve.h" -- cgit From cc11de1e3e938fc65e99e2c597e6f25659371e87 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 25 Apr 2006 06:53:28 +0000 Subject: r15225: Use talloc_zero() to avoid use of uninitialised values later on. Andrew Bartlett (This used to be commit e312cddafd7e00680dd059fad7ef7e5ecdbbb484) --- source4/libcli/finddcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 9ed20b77ba..aa755b5749 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -70,7 +70,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, struct finddcs_state *state; struct nbt_name name; - result = talloc(mem_ctx, struct composite_context); + result = talloc_zero(mem_ctx, struct composite_context); if (result == NULL) goto failed; result->state = COMPOSITE_STATE_IN_PROGRESS; result->async.fn = NULL; -- cgit From 464e352380865b44e67b7c5526adb94d15274955 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Mon, 3 Jul 2006 22:35:15 +0000 Subject: r16791: Typo fix in a comment. rafal (This used to be commit 48a9f822442c8b115fd61d9c6781d8100df2bf9e) --- source4/libcli/finddcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index aa755b5749..7df0551b53 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -110,7 +110,7 @@ failed: * can find the target's all-important name. (Kerberos and some * netlogon operations are quite picky about names) * - * The name is a courtasy, if we don't find it, don't compleatly fail. + * The name is a courtesy, if we don't find it, don't completely fail. * * However, if the nbt server is down, fall back to a node status * request -- cgit From 3437c2d92ccf42dbe3737c1c6a8786dfa54515d3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 30 Jul 2006 17:31:12 +0000 Subject: r17319: make better usage of the composite api metze (This used to be commit 8f9e201b9a797c0772672efab0f8e6a7a6312eb0) --- source4/libcli/finddcs.c | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 7df0551b53..417b33f277 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -66,44 +66,36 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, struct messaging_context *msg_ctx) { - struct composite_context *result, *ctx; + struct composite_context *c, *creq; struct finddcs_state *state; struct nbt_name name; - result = talloc_zero(mem_ctx, struct composite_context); - if (result == NULL) goto failed; - result->state = COMPOSITE_STATE_IN_PROGRESS; - result->async.fn = NULL; - result->event_ctx = event_ctx; + c = composite_create(mem_ctx, event_ctx); + if (c == NULL) return NULL; - state = talloc(result, struct finddcs_state); - if (state == NULL) goto failed; - state->ctx = result; - result->private_data = state; + state = talloc(c, struct finddcs_state); + if (composite_nomem(state, c)) return c; + c->private_data = state; + + state->ctx = c; state->domain_name = talloc_strdup(state, domain_name); - if (state->domain_name == NULL) goto failed; - state->domain_sid = domain_sid; - if (domain_sid != NULL) { - if (talloc_reference(state, domain_sid) == NULL) { - goto failed; - } + if (composite_nomem(state->domain_name, c)) return c; + + if (domain_sid) { + state->domain_sid = talloc_reference(state, domain_sid); + if (composite_nomem(state->domain_sid, c)) return c; + } else { + state->domain_sid = NULL; } + state->msg_ctx = msg_ctx; make_nbt_name(&name, state->domain_name, name_type); - ctx = resolve_name_send(&name, result->event_ctx, - methods); - - if (ctx == NULL) goto failed; - ctx->async.fn = finddcs_name_resolved; - ctx->async.private_data = state; - - return result; - -failed: - talloc_free(result); - return NULL; + creq = resolve_name_send(&name, event_ctx, + methods); + composite_continue(c, creq, finddcs_name_resolved, state); + return c; } /* Having got an name query answer, fire off a GetDC request, so we -- cgit From 1cd4339b9a2786aa26691ca4f02fa93ab0958b88 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 Jan 2007 10:52:09 +0000 Subject: r20646: first preparations for cluster enablement. This changes " uint32_t server_id to struct server_id server_id; which allows a server ID to have an node number. The node number will be zero in non-clustered case. This is the most basic hook needed for clustering, and ctdb. (This used to be commit 2365abaa991d57d68c6ebe9be608e01c907102eb) --- source4/libcli/finddcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 417b33f277..d8acf44ba0 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -112,7 +112,7 @@ static void finddcs_name_resolved(struct composite_context *ctx) struct finddcs_state *state = talloc_get_type(ctx->async.private_data, struct finddcs_state); struct irpc_request *ireq; - uint32_t *nbt_servers; + struct server_id *nbt_servers; const char *address; state->ctx->status = resolve_name_recv(ctx, state, &address); @@ -134,7 +134,7 @@ static void finddcs_name_resolved(struct composite_context *ctx) } nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server"); - if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) { + if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) { fallback_node_status(state); return; } -- cgit From 68b531e81784d218b598e4ec403443bbc039ca77 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 7 May 2007 15:19:53 +0000 Subject: r22748: fix memleaks by passing an mem_ctx to irpc_servers_byname() metze (This used to be commit b54584dfabee77ec7743cab431bda9765057a295) --- source4/libcli/finddcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index d8acf44ba0..09967c72b1 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -133,7 +133,7 @@ static void finddcs_name_resolved(struct composite_context *ctx) return; } - nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server"); + nbt_servers = irpc_servers_byname(state->msg_ctx, state, "nbt_server"); if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) { fallback_node_status(state); return; -- cgit From b8b580dbcb0468306b89e0a37589700dee6ca7b8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 29 May 2007 00:34:31 +0000 Subject: r23176: Note that we only return one DC from this call at the moment. Andrew Bartlett (This used to be commit 4fee8a7b77d01c7cb8b32911016158f2ff2cf8f6) --- source4/libcli/finddcs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 09967c72b1..0f639b084f 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -118,6 +118,9 @@ static void finddcs_name_resolved(struct composite_context *ctx) state->ctx->status = resolve_name_recv(ctx, state, &address); if (!composite_is_ok(state->ctx)) return; + /* TODO: This should try and find all the DCs, and give the + * caller them in the order they responded */ + state->num_dcs = 1; state->dcs = talloc_array(state, struct nbt_dc_name, state->num_dcs); if (composite_nomem(state->dcs, state->ctx)) return; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libcli/finddcs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 0f639b084f..0e115b0547 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "include/includes.h" -- cgit From f14bd1a90ab47a418c0ec2492990a417a0bb3bf6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 21:23:03 +0000 Subject: r24557: rename 'dcerpc_table_' -> 'ndr_table_' metze (This used to be commit 84651aee81aaabbebf52ffc3fbcbabb2eec6eed5) --- source4/libcli/finddcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 0e115b0547..5371879895 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -151,7 +151,7 @@ static void finddcs_name_resolved(struct composite_context *ctx) state->r.in.domain_sid = state->domain_sid; ireq = irpc_call_send(state->msg_ctx, nbt_servers[0], - &dcerpc_table_irpc, DCERPC_NBTD_GETDCNAME, + &ndr_table_irpc, DCERPC_NBTD_GETDCNAME, &state->r, state); if (!ireq) { fallback_node_status(state); -- cgit From 0d7d5a6d492253f184ac58fe45ca22af5a3731de Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 19 Aug 2007 22:09:21 +0000 Subject: r24560: rename some DCERPC_ prefixes into NDR_ metze (This used to be commit f874eca5dab74e930d0ec52abeb06295d2d90476) --- source4/libcli/finddcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 5371879895..a159ab6dfc 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -151,7 +151,7 @@ static void finddcs_name_resolved(struct composite_context *ctx) state->r.in.domain_sid = state->domain_sid; ireq = irpc_call_send(state->msg_ctx, nbt_servers[0], - &ndr_table_irpc, DCERPC_NBTD_GETDCNAME, + &ndr_table_irpc, NDR_NBTD_GETDCNAME, &state->r, state); if (!ireq) { fallback_node_status(state); -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/libcli/finddcs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index a159ab6dfc..46cca36009 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -27,6 +27,7 @@ #include "libcli/composite/composite.h" #include "libcli/libcli.h" #include "libcli/resolve/resolve.h" +#include "param/param.h" struct finddcs_state { struct composite_context *ctx; -- cgit From dccf3f99e45137b6cd18c1de1c79808ad67130d1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 13:27:14 +0000 Subject: r25027: Fix more warnings. (This used to be commit 5085c53fcfade614e83d21fc2c1a5bc43bb2a729) --- source4/libcli/finddcs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 46cca36009..edd9a92693 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -27,6 +27,7 @@ #include "libcli/composite/composite.h" #include "libcli/libcli.h" #include "libcli/resolve/resolve.h" +#include "libcli/finddcs.h" #include "param/param.h" struct finddcs_state { -- cgit From 37d53832a4623653f706e77985a79d84bd7c6694 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 28 Sep 2007 01:17:46 +0000 Subject: r25398: Parse loadparm context to all lp_*() functions. (This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238) --- source4/libcli/finddcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index edd9a92693..2ac1358197 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -145,9 +145,9 @@ static void finddcs_name_resolved(struct composite_context *ctx) state->r.in.domainname = state->domain_name; state->r.in.ip_address = state->dcs[0].address; - state->r.in.my_computername = lp_netbios_name(); + state->r.in.my_computername = lp_netbios_name(global_loadparm); state->r.in.my_accountname = talloc_asprintf(state, "%s$", - lp_netbios_name()); + lp_netbios_name(global_loadparm)); if (composite_nomem(state->r.in.my_accountname, state->ctx)) return; state->r.in.account_control = ACB_WSTRUST; state->r.in.domain_sid = state->domain_sid; -- cgit From 2f3551ca7cee59d4d053cceb87abdf1da1b3a1ad Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 1 Oct 2007 18:52:55 +0000 Subject: r25446: Merge some changes I made on the way home from SFO: 2007-09-29 More higher-level passing around of lp_ctx. 2007-09-29 Fix warning. 2007-09-29 Pass loadparm contexts on a higher level. 2007-09-29 Avoid using global loadparm context. (This used to be commit 3468952e771ab31f90b6c374ade01c5550810f42) --- source4/libcli/finddcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 2ac1358197..e00697fe17 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -147,7 +147,7 @@ static void finddcs_name_resolved(struct composite_context *ctx) state->r.in.ip_address = state->dcs[0].address; state->r.in.my_computername = lp_netbios_name(global_loadparm); state->r.in.my_accountname = talloc_asprintf(state, "%s$", - lp_netbios_name(global_loadparm)); + lp_netbios_name(global_loadparm)); if (composite_nomem(state->r.in.my_accountname, state->ctx)) return; state->r.in.account_control = ACB_WSTRUST; state->r.in.domain_sid = state->domain_sid; -- cgit From 1fbdd6ef1dfb8704de0524fc6f5c33e1418858cd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 18:47:35 +0100 Subject: r26264: pass name resolve order explicitly, use torture context for settings in dssync tests. (This used to be commit c7eae1c7842f9ff8b70cce9e5d6f3ebbbe78e83b) --- source4/libcli/finddcs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index e00697fe17..75dc14e3f4 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -93,8 +93,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, state->msg_ctx = msg_ctx; make_nbt_name(&name, state->domain_name, name_type); - creq = resolve_name_send(&name, event_ctx, - methods); + creq = resolve_name_send(&name, event_ctx, methods); composite_continue(c, creq, finddcs_name_resolved, state); return c; } -- cgit From 949f3c726452a59555236f9fdda52e79c3e5832b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Dec 2007 13:30:23 +0100 Subject: r26333: No more global_loadparm in finddcs. (This used to be commit 0c91026e587ca74692bc9223a6b5493e35943aee) --- source4/libcli/finddcs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 75dc14e3f4..83bf9837f9 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -34,6 +34,7 @@ struct finddcs_state { struct composite_context *ctx; struct messaging_context *msg_ctx; + const char *my_netbios_name; const char *domain_name; struct dom_sid *domain_sid; @@ -60,6 +61,7 @@ static void fallback_node_status_replied(struct nbt_name_request *name_req); */ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, + const char *my_netbios_name, const char *domain_name, int name_type, struct dom_sid *domain_sid, @@ -80,6 +82,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, state->ctx = c; + state->my_netbios_name = talloc_strdup(state, my_netbios_name); state->domain_name = talloc_strdup(state, domain_name); if (composite_nomem(state->domain_name, c)) return c; @@ -144,9 +147,8 @@ static void finddcs_name_resolved(struct composite_context *ctx) state->r.in.domainname = state->domain_name; state->r.in.ip_address = state->dcs[0].address; - state->r.in.my_computername = lp_netbios_name(global_loadparm); - state->r.in.my_accountname = talloc_asprintf(state, "%s$", - lp_netbios_name(global_loadparm)); + state->r.in.my_computername = state->my_netbios_name; + state->r.in.my_accountname = talloc_asprintf(state, "%s$", state->my_netbios_name); if (composite_nomem(state->r.in.my_accountname, state->ctx)) return; state->r.in.account_control = ACB_WSTRUST; state->r.in.domain_sid = state->domain_sid; @@ -244,6 +246,7 @@ NTSTATUS finddcs_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, } NTSTATUS finddcs(TALLOC_CTX *mem_ctx, + const char *my_netbios_name, const char *domain_name, int name_type, struct dom_sid *domain_sid, const char **methods, @@ -252,6 +255,7 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, int *num_dcs, struct nbt_dc_name **dcs) { struct composite_context *c = finddcs_send(mem_ctx, + my_netbios_name, domain_name, name_type, domain_sid, methods, event_ctx, msg_ctx); -- cgit From 5f4842cf65ce64bfdf577cd549565da20ca818cf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 10 Dec 2007 18:41:19 +0100 Subject: r26376: Add context for libcli_resolve. (This used to be commit 459e1466a411d6f83b7372e248566e6e71c745fc) --- source4/libcli/finddcs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 83bf9837f9..415c84a6bd 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -65,7 +65,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, const char *domain_name, int name_type, struct dom_sid *domain_sid, - const char **methods, + struct resolve_context *resolve_ctx, struct event_context *event_ctx, struct messaging_context *msg_ctx) { @@ -96,7 +96,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, state->msg_ctx = msg_ctx; make_nbt_name(&name, state->domain_name, name_type); - creq = resolve_name_send(&name, event_ctx, methods); + creq = resolve_name_send(resolve_ctx, &name, event_ctx); composite_continue(c, creq, finddcs_name_resolved, state); return c; } @@ -249,7 +249,7 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, const char *my_netbios_name, const char *domain_name, int name_type, struct dom_sid *domain_sid, - const char **methods, + struct resolve_context *resolve_ctx, struct event_context *event_ctx, struct messaging_context *msg_ctx, int *num_dcs, struct nbt_dc_name **dcs) @@ -257,7 +257,7 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, struct composite_context *c = finddcs_send(mem_ctx, my_netbios_name, domain_name, name_type, - domain_sid, methods, + domain_sid, resolve_ctx, event_ctx, msg_ctx); return finddcs_recv(c, mem_ctx, num_dcs, dcs); } -- cgit From 51ef1b606fe1853b7ca2decf2a74eecf18c5a747 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 10 Dec 2007 18:41:29 +0100 Subject: r26377: Specify port explicitly. (This used to be commit 8c767ca13906966cd6cccbeaef3c50033d46f206) --- source4/libcli/finddcs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 415c84a6bd..624f6cd630 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -189,6 +189,7 @@ static void fallback_node_status(struct finddcs_state *state) state->node_status.in.name.type = NBT_NAME_CLIENT; state->node_status.in.name.scope = NULL; state->node_status.in.dest_addr = state->dcs[0].address; + state->node_status.in.dest_port = lp_nbt_port(global_loadparm); state->node_status.in.timeout = 1; state->node_status.in.retries = 2; -- cgit From 33582dffcc2d348dc042edfdcccee7500b21d928 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 12 Dec 2007 02:15:20 +0100 Subject: r26408: Remove use of global_loadparm. (This used to be commit f933b4362124bfdd25544b4e27992d9ca4405848) --- source4/libcli/finddcs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 624f6cd630..4b7f2dce8c 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -43,6 +43,7 @@ struct finddcs_state { int num_dcs; struct nbt_dc_name *dcs; + uint16_t nbt_port; }; static void finddcs_name_resolved(struct composite_context *ctx); @@ -82,6 +83,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, state->ctx = c; + state->nbt_port = lp_nbt_port(global_loadparm); state->my_netbios_name = talloc_strdup(state, my_netbios_name); state->domain_name = talloc_strdup(state, domain_name); if (composite_nomem(state->domain_name, c)) return c; @@ -177,7 +179,7 @@ static void finddcs_getdc_replied(struct irpc_request *ireq) composite_done(state->ctx); } -/* The GetDC request might not be availible (such as occours when the +/* The GetDC request might not be available (such as occours when the * NBT server is down). Fallback to a node status. It is the best * hope we have... */ static void fallback_node_status(struct finddcs_state *state) @@ -189,7 +191,7 @@ static void fallback_node_status(struct finddcs_state *state) state->node_status.in.name.type = NBT_NAME_CLIENT; state->node_status.in.name.scope = NULL; state->node_status.in.dest_addr = state->dcs[0].address; - state->node_status.in.dest_port = lp_nbt_port(global_loadparm); + state->node_status.in.dest_port = state->nbt_port; state->node_status.in.timeout = 1; state->node_status.in.retries = 2; -- cgit From 70ccac0f05067c89bbf1503a614d09e3fd429110 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 13 Dec 2007 22:46:37 +0100 Subject: r26435: Remove global_loadparm instance. (This used to be commit 66fd8d480bdfeb1c95da8843da3d18abe3f997e1) --- source4/libcli/finddcs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 4b7f2dce8c..606809751e 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -28,7 +28,6 @@ #include "libcli/libcli.h" #include "libcli/resolve/resolve.h" #include "libcli/finddcs.h" -#include "param/param.h" struct finddcs_state { struct composite_context *ctx; @@ -63,6 +62,7 @@ static void fallback_node_status_replied(struct nbt_name_request *name_req); struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, const char *my_netbios_name, + uint16_t nbt_port, const char *domain_name, int name_type, struct dom_sid *domain_sid, @@ -83,7 +83,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, state->ctx = c; - state->nbt_port = lp_nbt_port(global_loadparm); + state->nbt_port = nbt_port; state->my_netbios_name = talloc_strdup(state, my_netbios_name); state->domain_name = talloc_strdup(state, domain_name); if (composite_nomem(state->domain_name, c)) return c; @@ -250,6 +250,7 @@ NTSTATUS finddcs_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, NTSTATUS finddcs(TALLOC_CTX *mem_ctx, const char *my_netbios_name, + uint16_t nbt_port, const char *domain_name, int name_type, struct dom_sid *domain_sid, struct resolve_context *resolve_ctx, @@ -259,6 +260,7 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, { struct composite_context *c = finddcs_send(mem_ctx, my_netbios_name, + nbt_port, domain_name, name_type, domain_sid, resolve_ctx, event_ctx, msg_ctx); -- cgit From 10169a203019445e6d325a5c1559de3c73782237 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Feb 2008 17:54:24 +0100 Subject: Remove more global_loadparm instance.s (This used to be commit a1280252ce924df69d911e597b7f65d8038abef9) --- source4/libcli/finddcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 606809751e..67ba47ddc6 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -28,6 +28,7 @@ #include "libcli/libcli.h" #include "libcli/resolve/resolve.h" #include "libcli/finddcs.h" +#include "param/param.h" struct finddcs_state { struct composite_context *ctx; @@ -195,7 +196,8 @@ static void fallback_node_status(struct finddcs_state *state) state->node_status.in.timeout = 1; state->node_status.in.retries = 2; - nbtsock = nbt_name_socket_init(state, state->ctx->event_ctx); + nbtsock = nbt_name_socket_init(state, state->ctx->event_ctx, + lp_iconv_convenience(global_loadparm)); if (composite_nomem(nbtsock, state->ctx)) return; name_req = nbt_name_status_send(nbtsock, &state->node_status); -- cgit From 7e045915205264efdd96d7e55a9e342c2748c93e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 28 Feb 2008 21:02:49 +0100 Subject: Remove use of global_loadparm. (This used to be commit 3cf3922c806d0e33439073d204b44bf0af3102d5) --- source4/libcli/finddcs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/libcli/finddcs.c') diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c index 67ba47ddc6..56f931ce19 100644 --- a/source4/libcli/finddcs.c +++ b/source4/libcli/finddcs.c @@ -41,6 +41,8 @@ struct finddcs_state { struct nbtd_getdcname r; struct nbt_name_status node_status; + struct smb_iconv_convenience *iconv_convenience; + int num_dcs; struct nbt_dc_name *dcs; uint16_t nbt_port; @@ -67,6 +69,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, const char *domain_name, int name_type, struct dom_sid *domain_sid, + struct smb_iconv_convenience *iconv_convenience, struct resolve_context *resolve_ctx, struct event_context *event_ctx, struct messaging_context *msg_ctx) @@ -87,6 +90,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx, state->nbt_port = nbt_port; state->my_netbios_name = talloc_strdup(state, my_netbios_name); state->domain_name = talloc_strdup(state, domain_name); + state->iconv_convenience = iconv_convenience; if (composite_nomem(state->domain_name, c)) return c; if (domain_sid) { @@ -197,7 +201,7 @@ static void fallback_node_status(struct finddcs_state *state) state->node_status.in.retries = 2; nbtsock = nbt_name_socket_init(state, state->ctx->event_ctx, - lp_iconv_convenience(global_loadparm)); + state->iconv_convenience); if (composite_nomem(nbtsock, state->ctx)) return; name_req = nbt_name_status_send(nbtsock, &state->node_status); @@ -255,6 +259,7 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, uint16_t nbt_port, const char *domain_name, int name_type, struct dom_sid *domain_sid, + struct smb_iconv_convenience *iconv_convenience, struct resolve_context *resolve_ctx, struct event_context *event_ctx, struct messaging_context *msg_ctx, @@ -264,7 +269,9 @@ NTSTATUS finddcs(TALLOC_CTX *mem_ctx, my_netbios_name, nbt_port, domain_name, name_type, - domain_sid, resolve_ctx, + domain_sid, + iconv_convenience, + resolve_ctx, event_ctx, msg_ctx); return finddcs_recv(c, mem_ctx, num_dcs, dcs); } -- cgit