summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/lsa.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-10 12:42:45 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-10 12:42:45 +0000
commit657dc577b614f388b55bd52a16e8e014c72bf2db (patch)
tree50268c1c8a416538ac422e0f9fec8df63ea6b4e0 /source4/torture/rpc/lsa.c
parent4659d4f9e2bfdbd253ff14e9181dd65023ff6c6a (diff)
downloadsamba-657dc577b614f388b55bd52a16e8e014c72bf2db.tar.gz
samba-657dc577b614f388b55bd52a16e8e014c72bf2db.tar.bz2
samba-657dc577b614f388b55bd52a16e8e014c72bf2db.zip
added idl and test code for lsa_LookupPrivName()
(This used to be commit c742227ec31cbf9b0093b5259095c9812b341d8d)
Diffstat (limited to 'source4/torture/rpc/lsa.c')
-rw-r--r--source4/torture/rpc/lsa.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 0e316ff395..8dd18042f0 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -271,8 +271,32 @@ static BOOL test_LookupSids(struct dcerpc_pipe *p,
return True;
}
+static BOOL test_LookupPrivName(struct dcerpc_pipe *p,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle,
+ struct lsa_LUID *luid)
+{
+ NTSTATUS status;
+ struct lsa_LookupPrivName r;
+
+ r.in.handle = handle;
+ r.in.luid_high = luid->high;
+ r.in.luid_low = luid->low;
+
+ status = dcerpc_lsa_LookupPrivName(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("\nLookupPrivName failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ printf(" '%s'\n", r.out.name->name);
+
+ return True;
+}
+
static BOOL test_EnumPrivsAccount(struct dcerpc_pipe *p,
- TALLOC_CTX *mem_ctx,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle,
struct policy_handle *acct_handle)
{
NTSTATUS status;
@@ -295,10 +319,12 @@ static BOOL test_EnumPrivsAccount(struct dcerpc_pipe *p,
struct lsa_PrivilegeSet *privs = r.out.privs;
int i;
for (i=0;i<privs->count;i++) {
- printf("luid=%08x-%08x attribute=0x%08x\n",
+ printf("luid=%08x-%08x attribute=0x%08x ",
privs->set[i].luid.low,
privs->set[i].luid.high,
privs->set[i].attribute);
+ test_LookupPrivName(p, mem_ctx, handle,
+ &privs->set[i].luid);
}
}
@@ -357,7 +383,7 @@ static BOOL test_OpenAccount(struct dcerpc_pipe *p,
return False;
}
- if (!test_EnumPrivsAccount(p, mem_ctx, &acct_handle)) {
+ if (!test_EnumPrivsAccount(p, mem_ctx, handle, &acct_handle)) {
return False;
}