summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-19 03:20:32 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-19 03:20:32 +0000
commit7f086443f58af374571516a73a535d8c71667822 (patch)
tree507556323a4e6b970dce09443302b0edb203632c /source4/torture/rpc
parent13e10b47fb65de32dcc9d54d42294564f8b39c74 (diff)
downloadsamba-7f086443f58af374571516a73a535d8c71667822.tar.gz
samba-7f086443f58af374571516a73a535d8c71667822.tar.bz2
samba-7f086443f58af374571516a73a535d8c71667822.zip
init samr and lsa names so the debug display looks right
(This used to be commit 343728fad47f46e404be15d44c5b66f870302d9d)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/lsa.c14
-rw-r--r--source4/torture/rpc/samr.c13
2 files changed, 23 insertions, 4 deletions
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;i<tnames->count;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;