summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-10-21 02:11:54 +0200
committerGünther Deschner <gd@samba.org>2008-10-27 19:33:22 +0100
commitea6b4865ea292e36f7c8b2b645c08886ed50fe2b (patch)
tree7a5f9dac48bd31eb787af9f0b8e9fc6f86d014db /source4/torture/rpc
parent95c69caef6d4e1a680b88f07f14a62475e720059 (diff)
downloadsamba-ea6b4865ea292e36f7c8b2b645c08886ed50fe2b.tar.gz
samba-ea6b4865ea292e36f7c8b2b645c08886ed50fe2b.tar.bz2
samba-ea6b4865ea292e36f7c8b2b645c08886ed50fe2b.zip
s4-lsa: merge lsa_EnumPrivsAccount from s3 lsa idl.
Guenther
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/lsa.c12
-rw-r--r--source4/torture/rpc/samsync.c12
2 files changed, 14 insertions, 10 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 9cb209335b..62e0c22ce2 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -867,11 +867,13 @@ static bool test_EnumPrivsAccount(struct dcerpc_pipe *p,
{
NTSTATUS status;
struct lsa_EnumPrivsAccount r;
+ struct lsa_PrivilegeSet *privs = NULL;
bool ret = true;
printf("\nTesting EnumPrivsAccount\n");
r.in.handle = acct_handle;
+ r.out.privs = &privs;
status = dcerpc_lsa_EnumPrivsAccount(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -879,17 +881,17 @@ static bool test_EnumPrivsAccount(struct dcerpc_pipe *p,
return false;
}
- if (r.out.privs && r.out.privs->count > 0) {
+ if (privs && privs->count > 0) {
int i;
- for (i=0;i<r.out.privs->count;i++) {
+ for (i=0;i<privs->count;i++) {
test_LookupPrivName(p, mem_ctx, handle,
- &r.out.privs->set[i].luid);
+ &privs->set[i].luid);
}
ret &= test_RemovePrivilegesFromAccount(p, mem_ctx, handle, acct_handle,
- &r.out.privs->set[0].luid);
+ &privs->set[0].luid);
ret &= test_AddPrivilegesToAccount(p, mem_ctx, acct_handle,
- &r.out.privs->set[0].luid);
+ &privs->set[0].luid);
}
return ret;
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 257d2c81bc..26660921a4 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -1027,6 +1027,7 @@ static bool samsync_handle_account(TALLOC_CTX *mem_ctx, struct samsync_state *sa
struct lsa_OpenAccount a;
struct policy_handle acct_handle;
struct lsa_EnumPrivsAccount e;
+ struct lsa_PrivilegeSet *privs = NULL;
struct lsa_LookupPrivName r;
int i, j;
@@ -1049,6 +1050,7 @@ static bool samsync_handle_account(TALLOC_CTX *mem_ctx, struct samsync_state *sa
found_priv_in_lsa = talloc_zero_array(mem_ctx, bool, account->privilege_entries);
e.in.handle = &acct_handle;
+ e.out.privs = &privs;
status = dcerpc_lsa_EnumPrivsAccount(samsync_state->p_lsa, mem_ctx, &e);
if (!NT_STATUS_IS_OK(status)) {
@@ -1056,23 +1058,23 @@ static bool samsync_handle_account(TALLOC_CTX *mem_ctx, struct samsync_state *sa
return false;
}
- if ((account->privilege_entries && !e.out.privs)) {
+ if ((account->privilege_entries && !privs)) {
printf("Account %s has privileges in SamSync, but not LSA\n",
dom_sid_string(mem_ctx, dom_sid));
return false;
}
- if (!account->privilege_entries && e.out.privs && e.out.privs->count) {
+ if (!account->privilege_entries && privs && privs->count) {
printf("Account %s has privileges in LSA, but not SamSync\n",
dom_sid_string(mem_ctx, dom_sid));
return false;
}
- TEST_INT_EQUAL(account->privilege_entries, e.out.privs->count);
+ TEST_INT_EQUAL(account->privilege_entries, privs->count);
- for (i=0;i< e.out.privs->count; i++) {
+ for (i=0;i< privs->count; i++) {
r.in.handle = samsync_state->lsa_handle;
- r.in.luid = &e.out.privs->set[i].luid;
+ r.in.luid = &privs->set[i].luid;
status = dcerpc_lsa_LookupPrivName(samsync_state->p_lsa, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {