summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/samr_accessmask.c152
1 files changed, 81 insertions, 71 deletions
diff --git a/source4/torture/rpc/samr_accessmask.c b/source4/torture/rpc/samr_accessmask.c
index ebfc069521..38e97314b4 100644
--- a/source4/torture/rpc/samr_accessmask.c
+++ b/source4/torture/rpc/samr_accessmask.c
@@ -31,7 +31,7 @@
#define TEST_MACHINENAME "samrtestmach"
static NTSTATUS torture_samr_Close(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
struct policy_handle *h)
{
NTSTATUS status;
@@ -39,13 +39,13 @@ static NTSTATUS torture_samr_Close(struct torture_context *tctx,
cl.in.handle = h;
cl.out.handle = h;
- status = dcerpc_samr_Close(p, tctx, &cl);
+ status = dcerpc_samr_Close_r(b, tctx, &cl);
return status;
}
static NTSTATUS torture_samr_Connect5(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
uint32_t mask, struct policy_handle *h)
{
NTSTATUS status;
@@ -63,7 +63,7 @@ static NTSTATUS torture_samr_Connect5(struct torture_context *tctx,
r5.out.connect_handle = h;
r5.in.access_mask = mask;
- status = dcerpc_samr_Connect5(p, tctx, &r5);
+ status = dcerpc_samr_Connect5_r(b, tctx, &r5);
return status;
}
@@ -76,12 +76,13 @@ static bool test_samr_accessmask_Connect5(struct torture_context *tctx,
struct policy_handle h;
int i;
uint32_t mask;
+ struct dcerpc_binding_handle *b = p->binding_handle;
printf("testing which bits in accessmask allows us to connect\n");
mask = 1;
for (i=0;i<33;i++) {
printf("testing Connect5 with access mask 0x%08x", mask);
- status = torture_samr_Connect5(tctx, p, mask, &h);
+ status = torture_samr_Connect5(tctx, b, mask, &h);
mask <<= 1;
switch (i) {
@@ -117,7 +118,7 @@ static bool test_samr_accessmask_Connect5(struct torture_context *tctx,
return false;
}
- status = torture_samr_Close(tctx, p, &h);
+ status = torture_samr_Close(tctx, b, &h);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
@@ -150,12 +151,13 @@ static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx,
uint32_t resume_handle = 0;
struct samr_SamArray *sam = NULL;
uint32_t num_entries = 0;
+ struct dcerpc_binding_handle *b = p->binding_handle;
printf("testing which bits in Connect5 accessmask allows us to EnumDomains\n");
mask = 1;
for (i=0;i<33;i++) {
printf("testing Connect5/EnumDomains with access mask 0x%08x", mask);
- status = torture_samr_Connect5(tctx, p, mask, &ch);
+ status = torture_samr_Connect5(tctx, b, mask, &ch);
mask <<= 1;
switch (i) {
@@ -176,13 +178,13 @@ static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx,
ed.out.num_entries = &num_entries;
ed.out.sam = &sam;
- status = dcerpc_samr_EnumDomains(p, tctx, &ed);
+ status = dcerpc_samr_EnumDomains_r(b, tctx, &ed);
if (!NT_STATUS_IS_OK(status)) {
printf("EnumDomains failed - %s\n", nt_errstr(status));
return false;
}
- status = torture_samr_Close(tctx, p, &ch);
+ status = torture_samr_Close(tctx, b, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
@@ -203,13 +205,13 @@ static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx,
ed.out.num_entries = &num_entries;
ed.out.sam = &sam;
- status = dcerpc_samr_EnumDomains(p, tctx, &ed);
+ status = dcerpc_samr_EnumDomains_r(b, tctx, &ed);
if(!NT_STATUS_EQUAL(NT_STATUS_ACCESS_DENIED, status)) {
printf("EnumDomains failed - %s\n", nt_errstr(status));
return false;
}
- status = torture_samr_Close(tctx, p, &ch);
+ status = torture_samr_Close(tctx, b, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
@@ -231,7 +233,7 @@ static bool test_samr_accessmask_EnumDomains(struct torture_context *tctx,
* the server
*/
static bool test_samr_connect_user_acl(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
struct cli_credentials *test_credentials,
const struct dom_sid *test_sid)
@@ -247,12 +249,13 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
bool ret = true;
int sd_size;
struct dcerpc_pipe *test_p;
+ struct dcerpc_binding_handle *test_b;
const char *binding = torture_setting_string(tctx, "binding", NULL);
printf("testing ACLs to allow/prevent users to connect to SAMR");
/* connect to SAMR */
- status = torture_samr_Connect5(tctx, p, SEC_FLAG_MAXIMUM_ALLOWED, &ch);
+ status = torture_samr_Connect5(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Connect5 failed - %s\n", nt_errstr(status));
return false;
@@ -263,7 +266,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
qs.in.handle = &ch;
qs.in.sec_info = SECINFO_DACL;
qs.out.sdbuf = &sdbuf;
- status = dcerpc_samr_QuerySecurity(p, tctx, &qs);
+ status = dcerpc_samr_QuerySecurity_r(b, tctx, &qs);
if (!NT_STATUS_IS_OK(status)) {
printf("QuerySecurity failed - %s\n", nt_errstr(status));
ret = false;
@@ -290,7 +293,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
ss.in.sec_info = SECINFO_DACL;
ss.in.sdbuf = &sdb;
sdb.sd = sd;
- status = dcerpc_samr_SetSecurity(p, tctx, &ss);
+ status = dcerpc_samr_SetSecurity_r(b, tctx, &ss);
if (!NT_STATUS_IS_OK(status)) {
printf("SetSecurity failed - %s\n", nt_errstr(status));
ret = false;
@@ -305,9 +308,10 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
printf("dcerpc_pipe_connect failed: %s\n", nt_errstr(status));
return false;
}
+ test_b = test_p->binding_handle;
/* connect to SAMR as the user */
- status = torture_samr_Connect5(tctx, test_p, SEC_FLAG_MAXIMUM_ALLOWED, &uch);
+ status = torture_samr_Connect5(tctx, test_b, SEC_FLAG_MAXIMUM_ALLOWED, &uch);
if (!NT_STATUS_IS_OK(status)) {
printf("Connect5 failed - %s\n", nt_errstr(status));
return false;
@@ -319,7 +323,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
/* read the sequrity descriptor back. it should not have changed
* eventhough samr_SetSecurity returned SUCCESS
*/
- status = dcerpc_samr_QuerySecurity(p, tctx, &qs);
+ status = dcerpc_samr_QuerySecurity_r(b, tctx, &qs);
if (!NT_STATUS_IS_OK(status)) {
printf("QuerySecurity failed - %s\n", nt_errstr(status));
ret = false;
@@ -330,7 +334,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
}
- status = torture_samr_Close(tctx, p, &ch);
+ status = torture_samr_Close(tctx, b, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
ret = false;
@@ -351,7 +355,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
* the connect should fail.
*/
static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
struct cli_credentials *test_credentials,
const struct dom_sid *test_sid)
@@ -360,6 +364,7 @@ static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx,
struct policy_handle uch;
bool ret = true;
struct dcerpc_pipe *test_p;
+ struct dcerpc_binding_handle *test_b;
const char *binding = torture_setting_string(tctx, "binding", NULL);
printf("testing if ACLs are enforced for non domain admin users when connecting to SAMR");
@@ -372,9 +377,10 @@ static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx,
printf("dcerpc_pipe_connect failed: %s\n", nt_errstr(status));
return false;
}
+ test_b = test_p->binding_handle;
/* connect to SAMR as the user */
- status = torture_samr_Connect5(tctx, test_p, SAMR_ACCESS_SHUTDOWN_SERVER, &uch);
+ status = torture_samr_Connect5(tctx, test_b, SAMR_ACCESS_SHUTDOWN_SERVER, &uch);
if (NT_STATUS_IS_OK(status)) {
printf("Connect5 failed - %s\n", nt_errstr(status));
return false;
@@ -406,12 +412,13 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
struct lsa_String dn;
int i;
uint32_t mask;
+ struct dcerpc_binding_handle *b = p->binding_handle;
printf("testing which bits in Connect5 accessmask allows us to LookupDomain\n");
mask = 1;
for (i=0;i<33;i++) {
printf("testing Connect5/LookupDomain with access mask 0x%08x", mask);
- status = torture_samr_Connect5(tctx, p, mask, &ch);
+ status = torture_samr_Connect5(tctx, b, mask, &ch);
mask <<= 1;
switch (i) {
@@ -430,13 +437,13 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
ld.out.sid = &sid;
dn.string = lp_workgroup(tctx->lp_ctx);
- status = dcerpc_samr_LookupDomain(p, tctx, &ld);
+ status = dcerpc_samr_LookupDomain_r(b, tctx, &ld);
if (!NT_STATUS_IS_OK(status)) {
printf("LookupDomain failed - %s\n", nt_errstr(status));
return false;
}
- status = torture_samr_Close(tctx, p, &ch);
+ status = torture_samr_Close(tctx, b, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
@@ -455,13 +462,13 @@ static bool test_samr_accessmask_LookupDomain(struct torture_context *tctx,
ld.out.sid = &sid;
dn.string = lp_workgroup(tctx->lp_ctx);
- status = dcerpc_samr_LookupDomain(p, tctx, &ld);
+ status = dcerpc_samr_LookupDomain_r(b, tctx, &ld);
if(!NT_STATUS_EQUAL(NT_STATUS_ACCESS_DENIED, status)) {
printf("LookupDomain failed - %s\n", nt_errstr(status));
return false;
}
- status = torture_samr_Close(tctx, p, &ch);
+ status = torture_samr_Close(tctx, b, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
@@ -495,10 +502,11 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
struct lsa_String dn;
int i;
uint32_t mask;
+ struct dcerpc_binding_handle *b = p->binding_handle;
/* first we must grab the sid of the domain */
- status = torture_samr_Connect5(tctx, p, SEC_FLAG_MAXIMUM_ALLOWED, &ch);
+ status = torture_samr_Connect5(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Connect5 failed - %s\n", nt_errstr(status));
return false;
@@ -508,7 +516,7 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
ld.in.domain_name = &dn;
ld.out.sid = &sid;
dn.string = lp_workgroup(tctx->lp_ctx);
- status = dcerpc_samr_LookupDomain(p, tctx, &ld);
+ status = dcerpc_samr_LookupDomain_r(b, tctx, &ld);
if (!NT_STATUS_IS_OK(status)) {
printf("LookupDomain failed - %s\n", nt_errstr(status));
return false;
@@ -520,7 +528,7 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
mask = 1;
for (i=0;i<33;i++) {
printf("testing Connect5/OpenDomain with access mask 0x%08x", mask);
- status = torture_samr_Connect5(tctx, p, mask, &ch);
+ status = torture_samr_Connect5(tctx, b, mask, &ch);
mask <<= 1;
switch (i) {
@@ -539,19 +547,19 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
od.in.sid = sid;
od.out.domain_handle = &dh;
- status = dcerpc_samr_OpenDomain(p, tctx, &od);
+ status = dcerpc_samr_OpenDomain_r(b, tctx, &od);
if (!NT_STATUS_IS_OK(status)) {
printf("OpenDomain failed - %s\n", nt_errstr(status));
return false;
}
- status = torture_samr_Close(tctx, p, &dh);
+ status = torture_samr_Close(tctx, b, &dh);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
}
- status = torture_samr_Close(tctx, p, &ch);
+ status = torture_samr_Close(tctx, b, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
@@ -565,7 +573,7 @@ static bool test_samr_accessmask_OpenDomain(struct torture_context *tctx,
continue;
}
- status = torture_samr_Close(tctx, p, &ch);
+ status = torture_samr_Close(tctx, b, &ch);
if (!NT_STATUS_IS_OK(status)) {
printf("Close failed - %s\n", nt_errstr(status));
return false;
@@ -586,6 +594,7 @@ static bool test_samr_connect(struct torture_context *tctx,
struct cli_credentials *test_credentials;
bool ret = true;
const struct dom_sid *test_sid;
+ struct dcerpc_binding_handle *b = p->binding_handle;
if (torture_setting_bool(tctx, "samba3", false)) {
torture_skip(tctx, "Skipping test against Samba 3");
@@ -610,7 +619,7 @@ static bool test_samr_connect(struct torture_context *tctx,
/* test if ACLs can be changed for the policy handle
* returned by Connect5
*/
- if (!test_samr_connect_user_acl(tctx, p, test_credentials, test_sid)) {
+ if (!test_samr_connect_user_acl(tctx, b, test_credentials, test_sid)) {
ret = false;
}
@@ -624,7 +633,7 @@ static bool test_samr_connect(struct torture_context *tctx,
* is granted and should therefore not be able to connect when
* requesting SAMR_ACCESS_SHUTDOWN_SERVER
*/
- if (!test_samr_connect_user_acl_enforced(tctx, p, test_credentials, test_sid)) {
+ if (!test_samr_connect_user_acl_enforced(tctx, b, test_credentials, test_sid)) {
ret = false;
}
@@ -668,7 +677,7 @@ struct torture_suite *torture_rpc_samr_accessmask(TALLOC_CTX *mem_ctx)
}
static bool test_LookupRids(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
struct policy_handle *domain_handle,
uint32_t rid)
{
@@ -684,7 +693,7 @@ static bool test_LookupRids(struct torture_context *tctx,
r.out.names = &names;
r.out.types = &types;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupRids(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupRids_r(b, tctx, &r),
"failed to call samr_LookupRids");
return true;
@@ -692,7 +701,7 @@ static bool test_LookupRids(struct torture_context *tctx,
static bool test_user(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
struct policy_handle *domain_handle,
uint32_t access_mask,
struct samr_DispEntryGeneral *u)
@@ -701,7 +710,7 @@ static bool test_user(struct torture_context *tctx,
torture_comment(tctx, "testing user %s (%d)\n", u->account_name.string, u->rid);
- torture_assert(tctx, test_LookupRids(tctx, p, domain_handle, u->rid),
+ torture_assert(tctx, test_LookupRids(tctx, b, domain_handle, u->rid),
"failed to call lookuprids");
{
@@ -712,7 +721,7 @@ static bool test_user(struct torture_context *tctx,
r.in.rid = u->rid;
r.out.user_handle = &user_handle;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_OpenUser(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_OpenUser_r(b, tctx, &r),
"failed to open user");
}
{
@@ -731,7 +740,7 @@ static bool test_user(struct torture_context *tctx,
torture_comment(tctx, "testing QueryUserInfo rid: %d level: %d\n",
u->rid, r.in.level);
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_QueryUserInfo(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_QueryUserInfo_r(b, tctx, &r),
talloc_asprintf(tctx, "failed to query user info level %d", r.in.level));
}
}
@@ -742,19 +751,19 @@ static bool test_user(struct torture_context *tctx,
r.in.user_handle = &user_handle;
r.out.rids = &rids;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_GetGroupsForUser(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_GetGroupsForUser_r(b, tctx, &r),
"failed to query groups for user");
}
torture_assert_ntstatus_ok(tctx,
- torture_samr_Close(tctx, p, &user_handle),
+ torture_samr_Close(tctx, b, &user_handle),
"failed to close user handle");
return true;
}
static bool test_samr_group(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
struct policy_handle *domain_handle,
uint32_t access_mask,
struct samr_SamEntry *g)
@@ -763,7 +772,7 @@ static bool test_samr_group(struct torture_context *tctx,
torture_comment(tctx, "testing group %s (%d)\n", g->name.string, g->idx);
- torture_assert(tctx, test_LookupRids(tctx, p, domain_handle, g->idx),
+ torture_assert(tctx, test_LookupRids(tctx, b, domain_handle, g->idx),
"failed to call lookuprids");
{
struct samr_OpenGroup r;
@@ -773,7 +782,7 @@ static bool test_samr_group(struct torture_context *tctx,
r.in.rid = g->idx;
r.out.group_handle = &group_handle;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_OpenGroup(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_OpenGroup_r(b, tctx, &r),
"failed to open group");
}
{
@@ -783,25 +792,25 @@ static bool test_samr_group(struct torture_context *tctx,
r.in.group_handle = &group_handle;
r.out.rids = &rids;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_QueryGroupMember(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_QueryGroupMember_r(b, tctx, &r),
"failed to query group member");
}
torture_assert_ntstatus_ok(tctx,
- torture_samr_Close(tctx, p, &group_handle),
+ torture_samr_Close(tctx, b, &group_handle),
"failed to close group handle");
return true;
}
static bool test_samr_alias(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
struct policy_handle *domain_handle,
struct samr_SamEntry *a)
{
torture_comment(tctx, "testing alias %s (%d)\n", a->name.string, a->idx);
- torture_assert(tctx, test_LookupRids(tctx, p, domain_handle, a->idx),
+ torture_assert(tctx, test_LookupRids(tctx, b, domain_handle, a->idx),
"failed to call lookuprids");
{
@@ -815,7 +824,7 @@ static bool test_samr_alias(struct torture_context *tctx,
r.in.sids = &sids;
r.out.rids = &rids;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_GetAliasMembership(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_GetAliasMembership_r(b, tctx, &r),
"failed to get alias membership");
}
@@ -824,7 +833,7 @@ static bool test_samr_alias(struct torture_context *tctx,
}
static bool test_samr_domain(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
uint32_t access_mask,
const char *domain_name,
struct policy_handle *connect_handle,
@@ -847,7 +856,7 @@ static bool test_samr_domain(struct torture_context *tctx,
r.out.num_entries = &num_entries;
r.out.resume_handle = &resume_handle;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_EnumDomains(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_EnumDomains_r(b, tctx, &r),
"failed to enum domains");
torture_assert_int_equal(tctx, num_entries, 2,
@@ -878,7 +887,7 @@ static bool test_samr_domain(struct torture_context *tctx,
r.in.domain_name = &name;
r.out.sid = &sid;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain_r(b, tctx, &r),
"failed to lookup domain");
domain_sid = dom_sid_dup(tctx, sid);
@@ -892,7 +901,7 @@ static bool test_samr_domain(struct torture_context *tctx,
r.in.sid = domain_sid;
r.out.domain_handle = &domain_handle;
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_OpenDomain(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_OpenDomain_r(b, tctx, &r),
"failed to open domain");
}
@@ -909,7 +918,7 @@ static bool test_samr_domain(struct torture_context *tctx,
r.in.level = levels[i];
- torture_assert_ntstatus_ok(tctx, dcerpc_samr_QueryDomainInfo(p, tctx, &r),
+ torture_assert_ntstatus_ok(tctx, dcerpc_samr_QueryDomainInfo_r(b, tctx, &r),
talloc_asprintf(tctx, "failed to query domain info level %d", r.in.level));
}
@@ -950,7 +959,7 @@ static void get_query_dispinfo_params(int loop_count,
static bool test_samr_users(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
uint32_t access_mask,
struct policy_handle *domain_handle)
{
@@ -981,7 +990,7 @@ static bool test_samr_users(struct torture_context *tctx,
&r.in.max_entries,
&r.in.buf_size);
- status = dcerpc_samr_QueryDisplayInfo(p, tctx, &r);
+ status = dcerpc_samr_QueryDisplayInfo_r(b, tctx, &r);
if (NT_STATUS_IS_ERR(status)) {
torture_assert_ntstatus_ok(tctx, status,
"failed to call QueryDisplayInfo");
@@ -989,7 +998,7 @@ static bool test_samr_users(struct torture_context *tctx,
for (i=0; i < info.info1.count; i++) {
torture_assert(tctx,
- test_user(tctx, p, domain_handle, access_mask, &info.info1.entries[i]),
+ test_user(tctx, b, domain_handle, access_mask, &info.info1.entries[i]),
"failed to test user");
}
loop_count++;
@@ -1002,7 +1011,7 @@ static bool test_samr_users(struct torture_context *tctx,
}
static bool test_samr_groups(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
uint32_t access_mask,
struct policy_handle *domain_handle)
{
@@ -1025,7 +1034,7 @@ static bool test_samr_groups(struct torture_context *tctx,
do {
int i;
- status = dcerpc_samr_EnumDomainGroups(p, tctx, &r);
+ status = dcerpc_samr_EnumDomainGroups_r(b, tctx, &r);
if (NT_STATUS_IS_ERR(status)) {
torture_assert_ntstatus_ok(tctx, status,
"failed to call EnumDomainGroups");
@@ -1033,7 +1042,7 @@ static bool test_samr_groups(struct torture_context *tctx,
for (i=0; i < num_entries; i++) {
torture_assert(tctx,
- test_samr_group(tctx, p, domain_handle, access_mask, &sam->entries[i]),
+ test_samr_group(tctx, b, domain_handle, access_mask, &sam->entries[i]),
"failed to test group");
}
@@ -1044,7 +1053,7 @@ static bool test_samr_groups(struct torture_context *tctx,
}
static bool test_samr_aliases(struct torture_context *tctx,
- struct dcerpc_pipe *p,
+ struct dcerpc_binding_handle *b,
uint32_t access_mask,
struct policy_handle *domain_handle)
{
@@ -1067,7 +1076,7 @@ static bool test_samr_aliases(struct torture_context *tctx,
do {
int i;
- status = dcerpc_samr_EnumDomainAliases(p, tctx, &r);
+ status = dcerpc_samr_EnumDomainAliases_r(b, tctx, &r);
if (NT_STATUS_IS_ERR(status)) {
torture_assert_ntstatus_ok(tctx, status,
"failed to call EnumDomainAliases");
@@ -1075,7 +1084,7 @@ static bool test_samr_aliases(struct torture_context *tctx,
for (i=0; i < num_entries; i++) {
torture_assert(tctx,
- test_samr_alias(tctx, p, domain_handle, &sam->entries[i]),
+ test_samr_alias(tctx, b, domain_handle, &sam->entries[i]),
"failed to test alias");
}
@@ -1091,39 +1100,40 @@ static bool torture_rpc_samr_workstation_query(struct torture_context *tctx,
{
struct policy_handle connect_handle;
struct policy_handle domain_handle;
+ struct dcerpc_binding_handle *b = p->binding_handle;
torture_assert_ntstatus_ok(tctx,
- torture_samr_Connect5(tctx, p, SEC_FLAG_MAXIMUM_ALLOWED,
+ torture_samr_Connect5(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED,
&connect_handle),
"failed to connect to samr server");
torture_assert(tctx,
- test_samr_domain(tctx, p, SEC_FLAG_MAXIMUM_ALLOWED,
+ test_samr_domain(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED,
lp_workgroup(tctx->lp_ctx),
&connect_handle, &domain_handle),
"failed to test domain");
torture_assert(tctx,
- test_samr_users(tctx, p, SEC_FLAG_MAXIMUM_ALLOWED,
+ test_samr_users(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED,
&domain_handle),
"failed to test users");
torture_assert(tctx,
- test_samr_groups(tctx, p, SEC_FLAG_MAXIMUM_ALLOWED,
+ test_samr_groups(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED,
&domain_handle),
"failed to test groups");
torture_assert(tctx,
- test_samr_aliases(tctx, p, SEC_FLAG_MAXIMUM_ALLOWED,
+ test_samr_aliases(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED,
&domain_handle),
"failed to test aliases");
torture_assert_ntstatus_ok(tctx,
- torture_samr_Close(tctx, p, &domain_handle),
+ torture_samr_Close(tctx, b, &domain_handle),
"failed to close domain handle");
torture_assert_ntstatus_ok(tctx,
- torture_samr_Close(tctx, p, &connect_handle),
+ torture_samr_Close(tctx, b, &connect_handle),
"failed to close connect handle");
return true;