From 7f086443f58af374571516a73a535d8c71667822 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 19 Nov 2003 03:20:32 +0000 Subject: init samr and lsa names so the debug display looks right (This used to be commit 343728fad47f46e404be15d44c5b66f870302d9d) --- source4/torture/rpc/lsa.c | 14 +++++++++++--- source4/torture/rpc/samr.c | 13 ++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 1e6f8be990..3b7b65f779 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -21,6 +21,16 @@ #include "includes.h" +/* + this makes the debug code display the right thing +*/ +static void init_lsa_Name(struct lsa_Name *name, const char *s) +{ + name->name = s; + name->name_len = strlen_m(s)*2; + name->name_size = name->name_len; +} + static BOOL test_OpenPolicy(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { struct lsa_ObjectAttribute attr; @@ -114,9 +124,7 @@ static BOOL test_LookupNames(struct dcerpc_pipe *p, names = talloc(mem_ctx, tnames->count * sizeof(names[0])); for (i=0;icount;i++) { - names[i].name_len = 2*strlen(tnames->names[i].name.name); - names[i].name_size = 2*strlen(tnames->names[i].name.name); - names[i].name = tnames->names[i].name.name; + init_lsa_Name(&names[i], tnames->names[i].name.name); } r.in.handle = handle; diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 415f899947..6c7418a5fb 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -21,6 +21,17 @@ #include "includes.h" + +/* + this makes the debug code display the right thing +*/ +static void init_samr_Name(struct samr_Name *name, const char *s) +{ + name->name = s; + name->name_len = strlen_m(s)*2; + name->name_size = name->name_len; +} + static BOOL test_Close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle) { @@ -69,7 +80,7 @@ static BOOL test_CreateUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32 rid; struct samr_Name name; - name.name = "samrtorturetest"; + init_samr_Name(&name, "samrtorturetest"); r.in.handle = handle; r.in.username = &name; -- cgit