summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-07 16:04:17 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:46 +0100
commit01d2acfdb4c4c0349a28a18c5c0da5b960b02791 (patch)
tree7a8ae7ae55fa531212d67275f8ebfb8e9c74a205 /source4
parent0b4fab2f6047f03221314f82229647d6662464e0 (diff)
downloadsamba-01d2acfdb4c4c0349a28a18c5c0da5b960b02791.tar.gz
samba-01d2acfdb4c4c0349a28a18c5c0da5b960b02791.tar.bz2
samba-01d2acfdb4c4c0349a28a18c5c0da5b960b02791.zip
r26335: Specify name_resolve_order to socket code.
(This used to be commit b03e5d00110be3f1fe5809dad4eb6ca5cea7463d)
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/kerberos/krb5_init_context.c3
-rw-r--r--source4/lib/socket/connect.c6
-rw-r--r--source4/lib/socket/connect_multi.c11
-rw-r--r--source4/lib/socket/socket.h7
-rw-r--r--source4/lib/socket/testsuite.c3
-rw-r--r--source4/libcli/ldap/ldap_client.c4
-rw-r--r--source4/libcli/raw/clisocket.c1
-rw-r--r--source4/libcli/wrepl/winsrepl.c3
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c3
-rw-r--r--source4/param/loadparm.c4
10 files changed, 32 insertions, 13 deletions
diff --git a/source4/auth/kerberos/krb5_init_context.c b/source4/auth/kerberos/krb5_init_context.c
index 9bcf8910d5..e3479b12d1 100644
--- a/source4/auth/kerberos/krb5_init_context.c
+++ b/source4/auth/kerberos/krb5_init_context.c
@@ -276,7 +276,8 @@ krb5_error_code smb_krb5_send_and_recv_func(krb5_context context,
continue;
}
- status = socket_connect_ev(smb_krb5->sock, NULL, remote_addr, 0, ev);
+ status = socket_connect_ev(smb_krb5->sock, NULL, remote_addr, 0,
+ lp_name_resolve_order(global_loadparm), ev);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(smb_krb5);
continue;
diff --git a/source4/lib/socket/connect.c b/source4/lib/socket/connect.c
index 4a30fa3b92..cad8967dab 100644
--- a/source4/lib/socket/connect.c
+++ b/source4/lib/socket/connect.c
@@ -85,6 +85,7 @@ struct composite_context *socket_connect_send(struct socket_context *sock,
struct socket_address *my_address,
struct socket_address *server_address,
uint32_t flags,
+ const char **name_resolve_order,
struct event_context *event_ctx)
{
struct composite_context *result;
@@ -206,10 +207,11 @@ NTSTATUS socket_connect_recv(struct composite_context *result)
NTSTATUS socket_connect_ev(struct socket_context *sock,
struct socket_address *my_address,
struct socket_address *server_address,
- uint32_t flags, struct event_context *ev)
+ uint32_t flags, const char **name_resolve_order,
+ struct event_context *ev)
{
struct composite_context *ctx;
ctx = socket_connect_send(sock, my_address,
- server_address, flags, ev);
+ server_address, flags, name_resolve_order, ev);
return socket_connect_recv(ctx);
}
diff --git a/source4/lib/socket/connect_multi.c b/source4/lib/socket/connect_multi.c
index 6d30141459..58ab673965 100644
--- a/source4/lib/socket/connect_multi.c
+++ b/source4/lib/socket/connect_multi.c
@@ -38,6 +38,8 @@ struct connect_multi_state {
int num_ports;
uint16_t *ports;
+ const char **name_resolve_order;
+
struct socket_context *sock;
uint16_t result_port;
@@ -68,6 +70,7 @@ _PUBLIC_ struct composite_context *socket_connect_multi_send(
const char *server_address,
int num_server_ports,
uint16_t *server_ports,
+ const char **name_resolve_order,
struct event_context *event_ctx)
{
struct composite_context *result;
@@ -87,6 +90,7 @@ _PUBLIC_ struct composite_context *socket_connect_multi_send(
if (composite_nomem(multi->server_address, result)) goto failed;
multi->num_ports = num_server_ports;
+ multi->name_resolve_order = str_list_copy(multi, name_resolve_order);
multi->ports = talloc_array(multi, uint16_t, multi->num_ports);
if (composite_nomem(multi->ports, result)) goto failed;
@@ -104,7 +108,7 @@ _PUBLIC_ struct composite_context *socket_connect_multi_send(
struct composite_context *creq;
make_nbt_name_client(&name, server_address);
creq = resolve_name_send(&name, result->event_ctx,
- lp_name_resolve_order(global_loadparm));
+ name_resolve_order);
if (composite_nomem(creq, result)) goto failed;
composite_continue(result, creq, continue_resolve_name, result);
return result;
@@ -157,7 +161,8 @@ static void connect_multi_next_socket(struct composite_context *result)
talloc_steal(state, state->sock);
creq = socket_connect_send(state->sock, NULL,
- state->addr, 0, result->event_ctx);
+ state->addr, 0, multi->name_resolve_order,
+ result->event_ctx);
if (composite_nomem(creq, result)) return;
talloc_steal(state, creq);
@@ -264,6 +269,7 @@ _PUBLIC_ NTSTATUS socket_connect_multi_recv(struct composite_context *ctx,
NTSTATUS socket_connect_multi(TALLOC_CTX *mem_ctx,
const char *server_address,
int num_server_ports, uint16_t *server_ports,
+ const char **name_resolve_order,
struct event_context *event_ctx,
struct socket_context **result,
uint16_t *result_port)
@@ -271,6 +277,7 @@ NTSTATUS socket_connect_multi(TALLOC_CTX *mem_ctx,
struct composite_context *ctx =
socket_connect_multi_send(mem_ctx, server_address,
num_server_ports, server_ports,
+ name_resolve_order,
event_ctx);
return socket_connect_multi_recv(ctx, mem_ctx, result, result_port);
}
diff --git a/source4/lib/socket/socket.h b/source4/lib/socket/socket.h
index 7679db08a1..24bc5f1aac 100644
--- a/source4/lib/socket/socket.h
+++ b/source4/lib/socket/socket.h
@@ -178,17 +178,21 @@ struct composite_context *socket_connect_send(struct socket_context *sock,
struct socket_address *my_address,
struct socket_address *server_address,
uint32_t flags,
+ const char **name_resolve_order,
struct event_context *event_ctx);
NTSTATUS socket_connect_recv(struct composite_context *ctx);
NTSTATUS socket_connect_ev(struct socket_context *sock,
struct socket_address *my_address,
struct socket_address *server_address,
- uint32_t flags, struct event_context *ev);
+ uint32_t flags,
+ const char **name_resolve_order,
+ struct event_context *ev);
struct composite_context *socket_connect_multi_send(TALLOC_CTX *mem_ctx,
const char *server_address,
int num_server_ports,
uint16_t *server_ports,
+ const char **name_resolve_order,
struct event_context *event_ctx);
NTSTATUS socket_connect_multi_recv(struct composite_context *ctx,
TALLOC_CTX *mem_ctx,
@@ -196,6 +200,7 @@ NTSTATUS socket_connect_multi_recv(struct composite_context *ctx,
uint16_t *port);
NTSTATUS socket_connect_multi(TALLOC_CTX *mem_ctx, const char *server_address,
int num_server_ports, uint16_t *server_ports,
+ const char **name_resolve_order,
struct event_context *event_ctx,
struct socket_context **result,
uint16_t *port);
diff --git a/source4/lib/socket/testsuite.c b/source4/lib/socket/testsuite.c
index 84132c62b8..dea740dbc8 100644
--- a/source4/lib/socket/testsuite.c
+++ b/source4/lib/socket/testsuite.c
@@ -25,6 +25,7 @@
#include "system/network.h"
#include "lib/socket/netif.h"
#include "torture/torture.h"
+#include "param/param.h"
/*
basic testing of udp routines
@@ -145,7 +146,7 @@ static bool test_tcp(struct torture_context *tctx)
torture_comment(tctx, "server port is %d\n", srv_addr->port);
- status = socket_connect_ev(sock2, NULL, srv_addr, 0, ev);
+ status = socket_connect_ev(sock2, NULL, srv_addr, 0, lp_name_resolve_order(tctx->lp_ctx), ev);
torture_assert_ntstatus_ok(tctx, status, "connect() on socket 2");
status = socket_accept(sock1, &sock3);
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index 2fe0c78555..c859b4a4d1 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -352,7 +352,7 @@ struct composite_context *ldap_connect_send(struct ldap_connection *conn,
}
ctx = socket_connect_send(conn->sock, NULL, unix_addr,
- 0, conn->event.event_ctx);
+ 0, lp_name_resolve_order(global_loadparm), conn->event.event_ctx);
ctx->async.fn = ldap_connect_recv_unix_conn;
ctx->async.private_data = state;
return result;
@@ -365,7 +365,7 @@ struct composite_context *ldap_connect_send(struct ldap_connection *conn,
}
ctx = socket_connect_multi_send(state, conn->host, 1, &conn->port,
- conn->event.event_ctx);
+ lp_name_resolve_order(global_loadparm), conn->event.event_ctx);
if (ctx == NULL) goto failed;
ctx->async.fn = ldap_connect_recv_tcp_conn;
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 6e12d8073d..9b744dcc18 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -96,6 +96,7 @@ struct composite_context *smbcli_sock_connect_send(TALLOC_CTX *mem_ctx,
ctx = socket_connect_multi_send(state, host_addr,
state->num_ports, state->ports,
+ lp_name_resolve_order(global_loadparm),
state->ctx->event_ctx);
if (ctx == NULL) goto failed;
ctx->async.fn = smbcli_sock_connect_recv_conn;
diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c
index 8f808198eb..9f7bd91ec9 100644
--- a/source4/libcli/wrepl/winsrepl.c
+++ b/source4/libcli/wrepl/winsrepl.c
@@ -343,7 +343,8 @@ struct composite_context *wrepl_connect_send(struct wrepl_socket *wrepl_socket,
if (composite_nomem(peer, result)) return result;
state->creq = socket_connect_send(wrepl_socket->sock, us, peer,
- 0, wrepl_socket->event.ctx);
+ 0, lp_name_resolve_order(global_loadparm),
+ wrepl_socket->event.ctx);
composite_continue(result, state->creq, wrepl_connect_handler, state);
return result;
}
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index 8717a13467..327b1bf419 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -332,7 +332,8 @@ static struct composite_context *dcerpc_pipe_open_socket_send(TALLOC_CTX *mem_ct
talloc_steal(s->sock, s->socket_ctx);
- conn_req = socket_connect_send(s->socket_ctx, NULL, s->server, 0, c->event_ctx);
+ conn_req = socket_connect_send(s->socket_ctx, NULL, s->server, 0, lp_name_resolve_order(global_loadparm),
+ c->event_ctx);
composite_continue(c, conn_req, continue_socket_connect, c);
return c;
}
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 9cd3cdbdc8..cafb6dd909 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -71,7 +71,7 @@ static bool bLoaded = false;
static bool do_parameter(const char *, const char *, void *);
static bool defaults_saved = false;
-/*
+/**
* This structure describes global (ie., server-wide) parameters.
*/
struct loadparm_global
@@ -180,7 +180,7 @@ struct loadparm_global
};
-/*
+/**
* This structure describes a single service.
*/
struct loadparm_service