summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-27 16:22:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:48 -0500
commitd658de65d32e6746ac51aeb4da7aa74b3da40c2b (patch)
tree3057af6864b3eb0b26d523aa4c100213380551f5 /source4/torture
parent8270e1e31071d23915cc3aa408ad6c7074ea1c11 (diff)
downloadsamba-d658de65d32e6746ac51aeb4da7aa74b3da40c2b.tar.gz
samba-d658de65d32e6746ac51aeb4da7aa74b3da40c2b.tar.bz2
samba-d658de65d32e6746ac51aeb4da7aa74b3da40c2b.zip
r12512: Use GUID structs in API functions everywhere rather then converting back and
forth between GUID structs and strings in several places. (This used to be commit 3564e2f967ef72d6301b4f7e9a311cebcded4d75)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/bind.c2
-rw-r--r--source4/torture/rpc/epmapper.c4
-rw-r--r--source4/torture/rpc/mgmt.c10
-rw-r--r--source4/torture/rpc/scanner.c18
4 files changed, 16 insertions, 18 deletions
diff --git a/source4/torture/rpc/bind.c b/source4/torture/rpc/bind.c
index d27fbb2b11..55ddec2fd5 100644
--- a/source4/torture/rpc/bind.c
+++ b/source4/torture/rpc/bind.c
@@ -64,7 +64,7 @@ BOOL torture_multi_bind(void)
if (NT_STATUS_IS_OK(status)) {
printf("(incorrectly) allowed re-bind to uuid %s - %s\n",
- dcerpc_table_lsarpc.uuid, nt_errstr(status));
+ GUID_string(mem_ctx, &dcerpc_table_lsarpc.uuid), nt_errstr(status));
ret = False;
} else {
printf("\n");
diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c
index f7935ce2d7..9774b9681c 100644
--- a/source4/torture/rpc/epmapper.c
+++ b/source4/torture/rpc/epmapper.c
@@ -44,7 +44,6 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct epm_Map r;
struct GUID uuid;
- const char *uuid_str;
struct policy_handle handle;
int i;
struct GUID if_uuid;
@@ -60,10 +59,9 @@ static BOOL test_Map(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
r.in.max_towers = 100;
dcerpc_floor_get_lhs_data(&twr->tower.floors[0], &if_uuid, &if_version);
- uuid_str = GUID_string(mem_ctx, &if_uuid);
printf("epm_Map results for '%s':\n",
- idl_pipe_name(uuid_str, if_version));
+ idl_pipe_name(&if_uuid, if_version));
twr->tower.floors[2].lhs.protocol = EPM_PROTOCOL_NCACN;
twr->tower.floors[2].lhs.lhs_data = data_blob(NULL, 0);
diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c
index 72495c248b..28ac07f607 100644
--- a/source4/torture/rpc/mgmt.c
+++ b/source4/torture/rpc/mgmt.c
@@ -50,15 +50,12 @@ static BOOL test_inq_if_ids(struct dcerpc_pipe *p,
}
for (i=0;i<r.out.if_id_vector->count;i++) {
- const char *uuid;
struct dcerpc_syntax_id *id = r.out.if_id_vector->if_id[i].id;
if (!id) continue;
- uuid = GUID_string(mem_ctx, &id->uuid);
-
printf("\tuuid %s version 0x%08x '%s'\n",
- uuid,
- id->if_version, idl_pipe_name(uuid, id->if_version));
+ GUID_string(mem_ctx, &id->uuid),
+ id->if_version, idl_pipe_name(&id->uuid, id->if_version));
}
return True;
@@ -212,8 +209,9 @@ BOOL torture_rpc_mgmt(void)
if (b->transport == NCACN_IP_TCP) {
status = dcerpc_epm_map_binding(loop_ctx, b, l->table, NULL);
if (!NT_STATUS_IS_OK(status)) {
+ printf("Failed to map port for uuid %s\n",
+ GUID_string(loop_ctx, &l->table->uuid));
talloc_free(loop_ctx);
- printf("Failed to map port for uuid %s\n", l->table->uuid);
continue;
}
} else {
diff --git a/source4/torture/rpc/scanner.c b/source4/torture/rpc/scanner.c
index 1f612fbaee..9ed414e2f4 100644
--- a/source4/torture/rpc/scanner.c
+++ b/source4/torture/rpc/scanner.c
@@ -32,7 +32,6 @@ static BOOL test_num_calls(const struct dcerpc_interface_table *iface,
{
struct dcerpc_pipe *p;
NTSTATUS status;
- const char *uuid;
int i;
DATA_BLOB stub_in, stub_out;
int idl_calls;
@@ -41,14 +40,15 @@ static BOOL test_num_calls(const struct dcerpc_interface_table *iface,
/* FIXME: This should be fixed when torture_rpc_connection
* takes a dcerpc_syntax_id */
tbl.name = iface->name;
- tbl.uuid = GUID_string(mem_ctx, &id->uuid);
+ tbl.uuid = id->uuid;
tbl.if_version = id->if_version;
- status = torture_rpc_connection(mem_ctx,
- &p, iface);
+ status = torture_rpc_connection(mem_ctx, &p, iface);
if (!NT_STATUS_IS_OK(status)) {
+ char *uuid_str = GUID_string(mem_ctx, &id->uuid);
printf("Failed to connect to '%s' on '%s' - %s\n",
- uuid, iface->name, nt_errstr(status));
+ uuid_str, iface->name, nt_errstr(status));
+ talloc_free(uuid_str);
return False;
}
@@ -75,7 +75,7 @@ static BOOL test_num_calls(const struct dcerpc_interface_table *iface,
}
printf("\t%d calls available\n", i);
- idl_calls = idl_num_calls(uuid, id->if_version);
+ idl_calls = idl_num_calls(&id->uuid, id->if_version);
if (idl_calls == -1) {
printf("\tinterface not known in local IDL\n");
} else if (i != idl_calls) {
@@ -125,7 +125,8 @@ static BOOL test_inq_if_ids(struct dcerpc_pipe *p,
printf("\n\tuuid %s version 0x%08x '%s'\n",
uuid,
- id->if_version, idl_pipe_name(uuid, id->if_version));
+ id->if_version, idl_pipe_name(&id->uuid, id->if_version));
+
test_num_calls(iface, mem_ctx, id);
}
@@ -172,8 +173,9 @@ BOOL torture_rpc_scanner(void)
if (b->transport == NCACN_IP_TCP) {
status = dcerpc_epm_map_binding(mem_ctx, b, l->table, NULL);
if (!NT_STATUS_IS_OK(status)) {
+ printf("Failed to map port for uuid %s\n",
+ GUID_string(loop_ctx, &l->table->uuid));
talloc_free(loop_ctx);
- printf("Failed to map port for uuid %s\n", l->table->uuid);
continue;
}
} else {