summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/lsa.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-03 17:21:26 +0000
committerAndrew Tridgell <tridge@samba.org>2004-04-03 17:21:26 +0000
commitc582f5cf1d94e7c8d3bc8ef63eb4b6e3a6dc1e0f (patch)
tree15209d0f3b58cb5fb0489e4ebf5308794198fb3b /source4/torture/rpc/lsa.c
parent84d009d52ecfff08e01374de91260aeffe40b9d9 (diff)
downloadsamba-c582f5cf1d94e7c8d3bc8ef63eb4b6e3a6dc1e0f.tar.gz
samba-c582f5cf1d94e7c8d3bc8ef63eb4b6e3a6dc1e0f.tar.bz2
samba-c582f5cf1d94e7c8d3bc8ef63eb4b6e3a6dc1e0f.zip
added IDL and test for lsa_OpenSecret()
(This used to be commit dd95cd141dc63f16e14f4c9392529653084b5a2a)
Diffstat (limited to 'source4/torture/rpc/lsa.c')
-rw-r--r--source4/torture/rpc/lsa.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index f50d189dd2..5aab8b366a 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -386,7 +386,9 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p,
{
NTSTATUS status;
struct lsa_CreateSecret r;
- struct policy_handle sec_handle;
+ struct lsa_OpenSecret r2;
+ struct policy_handle sec_handle, sec_handle2;
+ struct lsa_Delete d;
printf("Testing CreateSecret\n");
@@ -402,10 +404,30 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p,
return False;
}
+ r2.in.handle = handle;
+ r2.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
+ init_lsa_Name(&r2.in.name, "torturesecret");
+ r2.out.sec_handle = &sec_handle2;
+
+ printf("Testing OpenSecret\n");
+
+ status = dcerpc_lsa_OpenSecret(p, mem_ctx, &r2);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("OpenSecret failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
if (!test_Delete(p, mem_ctx, &sec_handle)) {
return False;
}
+ d.in.handle = &sec_handle2;
+ status = dcerpc_lsa_Delete(p, mem_ctx, &d);
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
+ printf("Second delete expected INVALID_HANDLE - %s\n", nt_errstr(status));
+ return False;
+ }
+
return True;
}