s4:torture/libnet: make use of dcerpc_binding_get_string_option("host")
authorStefan Metzmacher <metze@samba.org>
Tue, 4 Feb 2014 11:14:37 +0000 (12:14 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Feb 2014 10:54:18 +0000 (11:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/torture/libnet/libnet_domain.c
source4/torture/libnet/libnet_lookup.c
source4/torture/libnet/libnet_rpc.c
source4/torture/libnet/libnet_share.c

index 077d6a9f630c656d6e1ce339ae9623ad020c87ba..b330918b38a1a0c4a4961985879084103a860d26 100644 (file)
@@ -394,7 +394,7 @@ bool torture_domain_list(struct torture_context *torture)
         */
 
        ZERO_STRUCT(r);
-       r.in.hostname = binding->host;
+       r.in.hostname = dcerpc_binding_get_string_option(binding, "host");
 
        status = libnet_DomainList(ctx, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
@@ -415,7 +415,7 @@ bool torture_domain_list(struct torture_context *torture)
        ctx->samr.buf_size = 32;
 
        ZERO_STRUCT(r);
-       r.in.hostname = binding->host;
+       r.in.hostname = dcerpc_binding_get_string_option(binding, "host");
 
        status = libnet_DomainList(ctx, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
index 5359c1d7ef86cc75c2a6b0f30222df88f5a0fd95..618acdee04946316df838b3d54ed87b0fbbf6db8 100644 (file)
@@ -45,7 +45,7 @@ bool torture_lookup(struct torture_context *torture)
        if (lookup.in.hostname == NULL) {
                status = torture_rpc_binding(torture, &binding);
                if (NT_STATUS_IS_OK(status)) {
-                       lookup.in.hostname = binding->host;
+                       lookup.in.hostname = dcerpc_binding_get_string_option(binding, "host");
                }
        }
 
@@ -89,7 +89,7 @@ bool torture_lookup_host(struct torture_context *torture)
        if (lookup.in.hostname == NULL) {
                status = torture_rpc_binding(torture, &binding);
                if (NT_STATUS_IS_OK(status)) {
-                       lookup.in.hostname = binding->host;
+                       lookup.in.hostname = dcerpc_binding_get_string_option(binding, "host");
                }
        }
 
index ca64d62c4399f12d9493029e2090ef5881a5634b..661715834856ba54c07b615d87d67ba1dfc0736a 100644 (file)
@@ -138,13 +138,16 @@ bool torture_rpc_connect_srv(struct torture_context *torture)
        const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_SERVER;
        NTSTATUS status;
        struct dcerpc_binding *binding;
+       const char *host;
 
        status = torture_rpc_binding(torture, &binding);
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
 
-       return torture_rpc_connect(torture, level, NULL, binding->host);
+       host = dcerpc_binding_get_string_option(binding, "host");
+
+       return torture_rpc_connect(torture, level, NULL, host);
 }
 
 
index 3b04a1475ecbebdb70de3eb5af2143c6ca670a63..b9e969f366ca62a59465c398ab9740b0bc8dae35 100644 (file)
@@ -144,7 +144,7 @@ bool torture_listshares(struct torture_context *torture)
 
        torture_comment(torture, "Testing libnet_ListShare\n");
 
-       share.in.server_name = talloc_asprintf(mem_ctx, "%s", binding->host);
+       share.in.server_name = dcerpc_binding_get_string_option(binding, "host");
 
        for (i = 0; i < ARRAY_SIZE(levels); i++) {
                share.in.level = levels[i];
@@ -229,7 +229,7 @@ bool torture_delshare(struct torture_context *torture)
                return false;
        }
 
-       share.in.server_name    = binding->host;
+       share.in.server_name    = dcerpc_binding_get_string_option(binding, "host");
        share.in.share_name     = TEST_SHARENAME;
 
        status = libnet_DelShare(libnetctx, torture, &share);