summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-11-02 16:20:00 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-11-02 16:20:00 +0100
commit29a20af75f150a1774b187ce64199e5f0bcc2361 (patch)
treefe7e41923244415c154d11ad79fc9338453fe41d
parentff36c52d8c7f146eca9c6c678456708a8e2efbab (diff)
downloadsamba-29a20af75f150a1774b187ce64199e5f0bcc2361.tar.gz
samba-29a20af75f150a1774b187ce64199e5f0bcc2361.tar.bz2
samba-29a20af75f150a1774b187ce64199e5f0bcc2361.zip
Remove use of global_loadparm for SMB2 client connections.
-rw-r--r--source4/client/cifsdd.c15
-rw-r--r--source4/libcli/smb2/connect.c14
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c3
-rw-r--r--source4/ntvfs/smb2/vfs_smb2.c3
-rw-r--r--source4/torture/gentest.c3
-rw-r--r--source4/torture/smb2/scan.c6
-rw-r--r--source4/torture/smb2/util.c3
7 files changed, 31 insertions, 16 deletions
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index 3e0ab7af78..8d0b87d722 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -360,7 +360,8 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
struct smbcli_options *smb_options,
const char *socket_options,
struct smbcli_session_options *smb_session_options,
- struct smb_iconv_convenience *iconv_convenience)
+ struct smb_iconv_convenience *iconv_convenience,
+ struct gensec_settings *gensec_settings)
{
int options = 0;
const char * path = NULL;
@@ -384,7 +385,8 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
check_arg_numeric("ibs"), options,
socket_options,
smb_options, smb_session_options,
- iconv_convenience);
+ iconv_convenience,
+ gensec_settings);
} else if (strcmp(which, "of") == 0) {
options |= DD_WRITE;
path = check_arg_pathname("of");
@@ -392,7 +394,8 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
check_arg_numeric("obs"), options,
socket_options,
smb_options, smb_session_options,
- iconv_convenience);
+ iconv_convenience,
+ gensec_settings);
} else {
SMB_ASSERT(0);
return(NULL);
@@ -447,7 +450,8 @@ static int copy_files(struct event_context *ev, struct loadparm_context *lp_ctx)
if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if",
lp_smb_ports(lp_ctx), &options,
lp_socket_options(lp_ctx),
- &session_options, lp_iconv_convenience(lp_ctx)))) {
+ &session_options, lp_iconv_convenience(lp_ctx),
+ lp_gensec_settings(lp_ctx, lp_ctx)))) {
return(FILESYS_EXIT_CODE);
}
@@ -455,7 +459,8 @@ static int copy_files(struct event_context *ev, struct loadparm_context *lp_ctx)
lp_smb_ports(lp_ctx), &options,
lp_socket_options(lp_ctx),
&session_options,
- lp_iconv_convenience(lp_ctx)))) {
+ lp_iconv_convenience(lp_ctx),
+ lp_gensec_settings(lp_ctx, lp_ctx)))) {
return(FILESYS_EXIT_CODE);
}
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index e7aa8c753d..c7613841b8 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -35,6 +35,7 @@ struct smb2_connect_state {
const char *share;
const char **ports;
const char *socket_options;
+ struct gensec_settings *gensec_settings;
struct smbcli_options options;
struct smb2_negprot negprot;
struct smb2_tree_connect tcon;
@@ -140,7 +141,7 @@ static void continue_negprot(struct smb2_request *req)
break;
}
- state->session = smb2_session_init(transport, lp_gensec_settings(transport, global_loadparm), state, true);
+ state->session = smb2_session_init(transport, state->gensec_settings, state, true);
if (composite_nomem(state->session, c)) return;
creq = smb2_session_setup_spnego_send(state->session, state->credentials);
@@ -236,7 +237,8 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
struct cli_credentials *credentials,
struct event_context *ev,
struct smbcli_options *options,
- const char *socket_options)
+ const char *socket_options,
+ struct gensec_settings *gensec_settings)
{
struct composite_context *c;
struct smb2_connect_state *state;
@@ -259,7 +261,7 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
if (composite_nomem(state->share, c)) return c;
state->resolve_ctx = talloc_reference(state, resolve_ctx);
state->socket_options = talloc_reference(state, socket_options);
- if (composite_nomem(state->socket_options, c)) return c;
+ state->gensec_settings = talloc_reference(state, gensec_settings);
ZERO_STRUCT(name);
name.name = host;
@@ -297,11 +299,13 @@ NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
struct smb2_tree **tree,
struct event_context *ev,
struct smbcli_options *options,
- const char *socket_options)
+ const char *socket_options,
+ struct gensec_settings *gensec_settings)
{
struct composite_context *c = smb2_connect_send(mem_ctx, host, ports,
share, resolve_ctx,
credentials, ev, options,
- socket_options);
+ socket_options,
+ gensec_settings);
return smb2_connect_recv(c, mem_ctx, tree);
}
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 8d03f9cde3..59bcca0046 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -255,7 +255,8 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
s->io.creds,
c->event_ctx,
&options,
- lp_socket_options(lp_ctx)
+ lp_socket_options(lp_ctx),
+ lp_gensec_settings(mem_ctx, lp_ctx)
);
composite_continue(c, conn_req, continue_smb2_connect, c);
return c;
diff --git a/source4/ntvfs/smb2/vfs_smb2.c b/source4/ntvfs/smb2/vfs_smb2.c
index 8e3219293d..ebb17e2806 100644
--- a/source4/ntvfs/smb2/vfs_smb2.c
+++ b/source4/ntvfs/smb2/vfs_smb2.c
@@ -232,7 +232,8 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
lp_resolve_context(ntvfs->ctx->lp_ctx),
credentials,
ntvfs->ctx->event_ctx, &options,
- lp_socket_options(ntvfs->ctx->lp_ctx)
+ lp_socket_options(ntvfs->ctx->lp_ctx),
+ lp_gensec_settings(private, ntvfs->ctx->lp_ctx)
);
status = smb2_connect_recv(creq, private, &tree);
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index c9cb715a8b..02eecd7f40 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -233,7 +233,8 @@ static bool connect_servers(struct event_context *ev,
servers[i].credentials,
&servers[i].smb2_tree[j],
ev, &smb_options,
- lp_socket_options(lp_ctx)
+ lp_socket_options(lp_ctx),
+ lp_gensec_settings(lp_ctx, lp_ctx)
);
} else {
status = smbcli_tree_full_connection(NULL,
diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c
index f0d25017c6..a5e682c111 100644
--- a/source4/torture/smb2/scan.c
+++ b/source4/torture/smb2/scan.c
@@ -209,7 +209,8 @@ bool torture_smb2_scan(struct torture_context *torture)
share,
lp_resolve_context(torture->lp_ctx),
credentials, &tree, torture->ev, &options,
- lp_socket_options(torture->lp_ctx));
+ lp_socket_options(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Connection failed - %s\n", nt_errstr(status));
return false;
@@ -228,7 +229,8 @@ bool torture_smb2_scan(struct torture_context *torture)
share,
lp_resolve_context(torture->lp_ctx),
credentials, &tree, torture->ev, &options,
- lp_socket_options(torture->lp_ctx));
+ lp_socket_options(torture->lp_ctx),
+ lp_gensec_settings(mem_ctx, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Connection failed - %s\n", nt_errstr(status));
return false;
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index e53b6cddac..b17dc246e3 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -280,7 +280,8 @@ bool torture_smb2_connection(struct torture_context *tctx, struct smb2_tree **tr
lp_resolve_context(tctx->lp_ctx),
credentials, tree,
tctx->ev, &options,
- lp_socket_options(tctx->lp_ctx)
+ lp_socket_options(tctx->lp_ctx),
+ lp_gensec_settings(tctx, tctx->lp_ctx)
);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to SMB2 share \\\\%s\\%s - %s\n",