s4:librpc/rpc: remember "ncalrpc_dir" on the dcerpc_pipe->binding
authorStefan Metzmacher <metze@samba.org>
Thu, 13 Feb 2014 08:42:10 +0000 (09:42 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 28 Mar 2014 09:34:51 +0000 (10:34 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 28 10:34:51 CET 2014 on sn-devel-104

source4/librpc/rpc/dcerpc_connect.c

index 6c503ad95fbac5b4104b0991cd7f78eff99c23db..da452e682d8454f18056a8c7fdc961a26ebfb182 100644 (file)
@@ -43,6 +43,9 @@ struct dcerpc_pipe_connect {
        const struct ndr_interface_table *interface;
        struct cli_credentials *creds;
        struct resolve_context *resolve_ctx;
+       struct {
+               const char *dir;
+       } ncalrpc;
 };
 
 struct pipe_np_smb_state {
@@ -505,7 +508,7 @@ static void continue_pipe_open_ncalrpc(struct composite_context *ctx)
    the binding structure to determine the endpoint and options
 */
 static struct composite_context* dcerpc_pipe_connect_ncalrpc_send(TALLOC_CTX *mem_ctx,
-                                                                 struct dcerpc_pipe_connect *io, struct loadparm_context *lp_ctx)
+                                                                 struct dcerpc_pipe_connect *io)
 {
        struct composite_context *c;
        struct pipe_ncalrpc_state *s;
@@ -531,7 +534,7 @@ static struct composite_context* dcerpc_pipe_connect_ncalrpc_send(TALLOC_CTX *me
 
        /* send pipe open request */
        pipe_req = dcerpc_pipe_open_pipe_send(s->io.conn,
-                                             lpcfg_ncalrpc_dir(lp_ctx),
+                                             s->io.ncalrpc.dir,
                                              endpoint);
        composite_continue(c, pipe_req, continue_pipe_open_ncalrpc, c);
        return c;
@@ -608,6 +611,7 @@ static void continue_connect(struct composite_context *c, struct pipe_connect_st
        uint32_t flags;
 
        /* dcerpc pipe connect input parameters */
+       ZERO_STRUCT(pc);
        pc.conn         = s->pipe->conn;
        pc.binding      = s->binding;
        pc.pipe_name    = NULL;
@@ -646,7 +650,11 @@ static void continue_connect(struct composite_context *c, struct pipe_connect_st
                return;
 
        case NCALRPC:
-               ncalrpc_req = dcerpc_pipe_connect_ncalrpc_send(c, &pc, s->lp_ctx);
+               pc.ncalrpc.dir = lpcfg_ncalrpc_dir(s->lp_ctx);
+               c->status = dcerpc_binding_set_string_option(s->binding, "ncalrpc_dir",
+                                                            pc.ncalrpc.dir);
+               if (!composite_is_ok(c)) return;
+               ncalrpc_req = dcerpc_pipe_connect_ncalrpc_send(c, &pc);
                composite_continue(c, ncalrpc_req, continue_pipe_connect_ncalrpc, c);
                return;