s4:libnet: let libnet_rpc_usermod() take tevent_context/dcerpc_binding_handle
authorStefan Metzmacher <metze@samba.org>
Tue, 14 Jan 2014 11:11:17 +0000 (12:11 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 16 Jan 2014 15:22:52 +0000 (16:22 +0100)
This avoids usage/dereferencing 'struct dcerpc_pipe'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/libnet/userman.c
source4/torture/libnet/userman.c

index 3058060b9d5079f66486436658b21a28bccbd1f6..39be78f670791ff78b5d0b6bc7c71b09c6d6aa98 100644 (file)
@@ -912,11 +912,11 @@ NTSTATUS libnet_rpc_usermod_recv(struct composite_context *c, TALLOC_CTX *mem_ct
  * @return nt status code of execution
  */
 
-NTSTATUS libnet_rpc_usermod(struct dcerpc_pipe *p,
+NTSTATUS libnet_rpc_usermod(struct tevent_context *ev,
+                           struct dcerpc_binding_handle *b,
                            TALLOC_CTX *mem_ctx,
                            struct libnet_rpc_usermod *io)
 {
-       struct composite_context *c = libnet_rpc_usermod_send(mem_ctx, p->conn->event_ctx,
-                                                             p->binding_handle, io, NULL);
+       struct composite_context *c = libnet_rpc_usermod_send(mem_ctx, ev, b, io, NULL);
        return libnet_rpc_usermod_recv(c, mem_ctx, io);
 }
index 2abf1e826acc30a1083186304f41a3ab9dfa8f01..8c49bb6d82ed3e5900be06fe72ee104b669d576f 100644 (file)
@@ -208,7 +208,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p,
        }
        torture_comment(tctx, "]\n");
 
-       status = libnet_rpc_usermod(p, mem_ctx, mod);
+       status = libnet_rpc_usermod(tctx->ev, p->binding_handle, mem_ctx, mod);
        torture_assert_ntstatus_ok(tctx, status, "Failed to call sync libnet_rpc_usermod");
 
        return true;