diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 1e6f8be9903..3b7b65f7791 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 415f899947a..6c7418a5fba 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;