s4:libnet: keep a dcerpc_binding_handle for samr and lsa
authorStefan Metzmacher <metze@samba.org>
Mon, 8 Mar 2010 15:27:14 +0000 (16:27 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 12 Mar 2010 14:25:42 +0000 (15:25 +0100)
metze

source4/libnet/libnet.h
source4/libnet/libnet_rpc.c

index 9964a3f526dd2a6ff6020054e610271016c1ccc7..c1a2e3708bb03bdbca64c145508cf59f1672955d 100644 (file)
@@ -30,6 +30,7 @@ struct libnet_context {
        /* samr connection parameters - opened handles and related properties */
        struct {
                struct dcerpc_pipe *pipe;
+               struct dcerpc_binding_handle *samr_handle;
                const char *name;
                struct dom_sid *sid;
                uint32_t access_mask;
@@ -41,6 +42,7 @@ struct libnet_context {
        /* lsa connection parameters - opened handles and related properties */
        struct {
                struct dcerpc_pipe *pipe;
+               struct dcerpc_binding_handle *lsa_handle;
                const char *name;
                uint32_t access_mask;
                struct policy_handle handle;
index 1c35ef6ca1d10591b1f0e1ad0066a323426481da..a681c28106524f8f3882e47e3637f5f6c9e6aaa3 100644 (file)
@@ -884,9 +884,11 @@ static NTSTATUS libnet_RpcConnectDCInfo_recv(struct composite_context *c, struct
                   mem_ctx is freed */
                if (r->in.dcerpc_iface == &ndr_table_samr) {
                        ctx->samr.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+                       ctx->samr.samr_handle = ctx->samr.pipe->binding_handle;
 
                } else if (r->in.dcerpc_iface == &ndr_table_lsarpc) {
                        ctx->lsa.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+                       ctx->lsa.lsa_handle = ctx->lsa.pipe->binding_handle;
                }
 
        } else {