Remove another use of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 22:26:36 +0000 (23:26 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 22:26:36 +0000 (23:26 +0100)
source4/libcli/smb2/connect.c
source4/librpc/rpc/dcerpc_connect.c
source4/ntvfs/smb2/vfs_smb2.c
source4/torture/gentest.c
source4/torture/smb2/scan.c
source4/torture/smb2/util.c

index d5fff4a305756884b7a0735847b11e6e9069a2ac..61ee99448406b43a5aae98843cb86da57b6b66d3 100644 (file)
@@ -235,7 +235,8 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
                                            struct resolve_context *resolve_ctx,
                                            struct cli_credentials *credentials,
                                            struct event_context *ev,
-                                           struct smbcli_options *options)
+                                           struct smbcli_options *options,
+                                               const char *socket_options)
 {
        struct composite_context *c;
        struct smb2_connect_state *state;
@@ -258,7 +259,7 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
        state->share = talloc_strdup(c, share);
        if (composite_nomem(state->share, c)) return c;
        state->resolve_ctx = talloc_reference(state, resolve_ctx);
-       state->socket_options = lp_socket_options(global_loadparm);
+       state->socket_options = talloc_reference(state, socket_options);
        if (composite_nomem(state->socket_options, c)) return c;
 
        ZERO_STRUCT(name);
@@ -296,10 +297,12 @@ NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
                      struct cli_credentials *credentials,
                      struct smb2_tree **tree,
                      struct event_context *ev,
-                     struct smbcli_options *options)
+                     struct smbcli_options *options,
+                         const char *socket_options)
 {
        struct composite_context *c = smb2_connect_send(mem_ctx, host, ports, 
                                                                                                        share, resolve_ctx, 
-                                                                                                       credentials, ev, options);
+                                                                                                       credentials, ev, options,
+                                                                                                       socket_options);
        return smb2_connect_recv(c, mem_ctx, tree);
 }
index 7bdd89649e8e858abfbdd5a8b906730050f9656a..0ec17295cba4688e80aae213fddde0034431dd1c 100644 (file)
@@ -253,7 +253,9 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
                                     s->io.resolve_ctx,
                                     s->io.creds,
                                     c->event_ctx,
-                                    &options);
+                                    &options,
+                                        lp_socket_options(lp_ctx)
+                                        );
        composite_continue(c, conn_req, continue_smb2_connect, c);
        return c;
 }
index 7e8356e94e07850e644088a9146af9779793df76..8e3219293d2e2bdf08e6422c26bb6714038e6e21 100644 (file)
@@ -231,7 +231,9 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
                                remote_share, 
                                 lp_resolve_context(ntvfs->ctx->lp_ctx),
                                 credentials,
-                                ntvfs->ctx->event_ctx, &options);
+                                ntvfs->ctx->event_ctx, &options,
+                                lp_socket_options(ntvfs->ctx->lp_ctx)
+                                );
 
        status = smb2_connect_recv(creq, private, &tree);
        NT_STATUS_NOT_OK_RETURN(status);
index aefed23f51a9e60adeba9e02506cc806bcfa27ca..eb948f64b1e36ad77154e4217d3ee5c4f9466d55 100644 (file)
@@ -231,7 +231,9 @@ static bool connect_servers(struct event_context *ev,
                                                      lp_resolve_context(lp_ctx),
                                                      servers[i].credentials,
                                                      &servers[i].smb2_tree[j],
-                                                     ev, &smb_options);
+                                                     ev, &smb_options,
+                                                         lp_socket_options(lp_ctx)
+                                                         );
                        } else {
                                status = smbcli_tree_full_connection(NULL,
                                                                     &servers[i].smb_tree[j], 
index ae51af18820ed0ad97281be2a97814f3321423ef..5f1514df83c58865b01b3304da28bdc8cf6559af 100644 (file)
@@ -224,7 +224,9 @@ bool torture_smb2_scan(struct torture_context *torture)
                        status = smb2_connect(mem_ctx, host, share, 
                                              lp_resolve_context(torture->lp_ctx), 
                                              credentials, &tree, 
-                                             torture->ev, &options);
+                                             torture->ev, &options,
+                                                 lp_socket_options(torture->lp_ctx)
+                                                 );
                        if (!NT_STATUS_IS_OK(status)) {
                                printf("Connection failed - %s\n", nt_errstr(status));
                                return false;
index 3a437acbab870eeb6a3581cd6035a0b509616bbb..193b43266c5b029402e113c5203517341e6413d3 100644 (file)
@@ -277,7 +277,9 @@ bool torture_smb2_connection(struct torture_context *tctx, struct smb2_tree **tr
        status = smb2_connect(tctx, host, share, 
                              lp_resolve_context(tctx->lp_ctx),
                              credentials, tree, 
-                             tctx->ev, &options);
+                             tctx->ev, &options,
+                                 lp_socket_options(tctx->lp_ctx)
+                                 );
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to connect to SMB2 share \\\\%s\\%s - %s\n",
                       host, share, nt_errstr(status));