]> git.samba.org - samba.git/commitdiff
Remove another use of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 22:09:18 +0000 (23:09 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 1 Nov 2008 22:09:18 +0000 (23:09 +0100)
source4/libcli/smb2/connect.c
source4/librpc/rpc/dcerpc_connect.c
source4/ntvfs/smb2/vfs_smb2.c

index 757a816f9b66c0818aad6af96d94a7a0e1b51433..d5fff4a305756884b7a0735847b11e6e9069a2ac 100644 (file)
@@ -230,6 +230,7 @@ static void continue_resolve(struct composite_context *creq)
  */
 struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
                                            const char *host,
+                                               const char **ports,
                                            const char *share,
                                            struct resolve_context *resolve_ctx,
                                            struct cli_credentials *credentials,
@@ -240,7 +241,6 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
        struct smb2_connect_state *state;
        struct nbt_name name;
        struct composite_context *creq;
-       const char **ports;
 
        c = composite_create(mem_ctx, ev);
        if (c == NULL) return NULL;
@@ -253,8 +253,7 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
        state->options = *options;
        state->host = talloc_strdup(c, host);
        if (composite_nomem(state->host, c)) return c;
-       state->ports = lp_parm_string_list(state, global_loadparm, 
-                                                                          NULL, "smb2", "ports", NULL);
+       state->ports = talloc_reference(state, ports);
        if (composite_nomem(state->ports, c)) return c;
        state->share = talloc_strdup(c, share);
        if (composite_nomem(state->share, c)) return c;
@@ -291,15 +290,16 @@ NTSTATUS smb2_connect_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
   sync version of smb2_connect
 */
 NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx, 
-                     const char *host, const char *share,
+                     const char *host, const char **ports, 
+                         const char *share,
                      struct resolve_context *resolve_ctx,
                      struct cli_credentials *credentials,
                      struct smb2_tree **tree,
                      struct event_context *ev,
                      struct smbcli_options *options)
 {
-       struct composite_context *c = smb2_connect_send(mem_ctx, host, share
-                                                       resolve_ctx,
-                                                       credentials, ev, options);
+       struct composite_context *c = smb2_connect_send(mem_ctx, host, ports
+                                                                                                       share, resolve_ctx, 
+                                                                                                       credentials, ev, options);
        return smb2_connect_recv(c, mem_ctx, tree);
 }
index 9583fcdc02bc54bd2567a9bd8b9c67ac0cd1fc05..7bdd89649e8e858abfbdd5a8b906730050f9656a 100644 (file)
@@ -247,7 +247,9 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
        lp_smbcli_options(lp_ctx, &options);
 
        /* send smb2 connect request */
-       conn_req = smb2_connect_send(mem_ctx, s->io.binding->host, "IPC$", 
+       conn_req = smb2_connect_send(mem_ctx, s->io.binding->host, 
+                       lp_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL),
+                                       "IPC$", 
                                     s->io.resolve_ctx,
                                     s->io.creds,
                                     c->event_ctx,
index 2c1461b9167679a01c7af1bb7388e3798067502e..7e8356e94e07850e644088a9146af9779793df76 100644 (file)
@@ -226,7 +226,9 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
 
        lp_smbcli_options(ntvfs->ctx->lp_ctx, &options);
 
-       creq = smb2_connect_send(private, host, remote_share, 
+       creq = smb2_connect_send(private, host, 
+                       lp_parm_string_list(private, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL),
+                               remote_share, 
                                 lp_resolve_context(ntvfs->ctx->lp_ctx),
                                 credentials,
                                 ntvfs->ctx->event_ctx, &options);