summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-15 07:51:19 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-15 07:51:19 +0000
commitbcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c (patch)
tree539a1fb803b4b762bad8fdbad9d1e6446d5240f0 /source4/torture/rpc
parent5a28ca7bf3250f951826aa0726e4487b88062abe (diff)
downloadsamba-bcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c.tar.gz
samba-bcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c.tar.bz2
samba-bcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c.zip
run LookupDomain on each domain returned from EnumDomains in samr
(This used to be commit 947b9f8ced486d34ee6710a921fb985ea14e2bb1)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/samr.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 12d4ebbe93..2dd77e6ec5 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -21,6 +21,28 @@
#include "includes.h"
+static BOOL test_LookupDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle, struct samr_Name *domain)
+{
+ NTSTATUS status;
+ struct samr_LookupDomain r;
+
+ printf("Testing LookupDomain(%s)\n", domain->name);
+
+ r.in.handle = handle;
+ r.in.domain = domain;
+
+ status = dcerpc_samr_LookupDomain(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("LookupDomain failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ NDR_PRINT_DEBUG(dom_sid2, r.out.sid);
+
+ return True;
+}
+
static BOOL test_EnumDomains(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
@@ -28,7 +50,8 @@ static BOOL test_EnumDomains(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct samr_EnumDomains r;
uint32 resume_handle = 0;
- uint32 num_entries;
+ uint32 num_entries=0;
+ int i;
r.in.handle = handle;
r.in.resume_handle = &resume_handle;
@@ -44,6 +67,12 @@ static BOOL test_EnumDomains(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
NDR_PRINT_DEBUG(samr_SamArray, r.out.sam);
+ if (r.out.sam) {
+ for (i=0;i<r.out.sam->count;i++) {
+ test_LookupDomain(p, mem_ctx, handle, &r.out.sam->entries[i].name);
+ }
+ }
+
return True;
}
@@ -53,6 +82,7 @@ static BOOL test_Connect(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
struct samr_Connect r;
+ struct samr_Connect4 r4;
r.in.system_name = 0;
r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
@@ -64,6 +94,17 @@ static BOOL test_Connect(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
+ r4.in.system_name = "win2003";
+ r4.in.unknown = 0;
+ r4.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
+ r4.out.handle = handle;
+
+ status = dcerpc_samr_Connect4(p, mem_ctx, &r4);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("Connect4 failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
return True;
}