summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-03 16:44:39 +0000
committerAndrew Tridgell <tridge@samba.org>2004-04-03 16:44:39 +0000
commit9bc3b91cca4a93ec70406d1e92680033ad531aae (patch)
tree7340efd2b1ef3211e3f03c6b35b338032706564d /source4/torture/rpc
parentee44733f94864fb0a1ae15d48e3335c0705a82ae (diff)
downloadsamba-9bc3b91cca4a93ec70406d1e92680033ad531aae.tar.gz
samba-9bc3b91cca4a93ec70406d1e92680033ad531aae.tar.bz2
samba-9bc3b91cca4a93ec70406d1e92680033ad531aae.zip
added idl and test suite for lsa_CreateTrustedDomain()
(This used to be commit cdb47511531cb8ef19334088eecb14971e189a4f)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/lsa.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 7f49e4cef6..3b7e4dbe5d 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -324,7 +324,7 @@ static BOOL test_CreateAccount(struct dcerpc_pipe *p,
r.in.handle = handle;
r.in.sid = newsid;
- r.in.access = SEC_RIGHTS_MAXIMUM_ALLOWED;
+ r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
r.out.acct_handle = &acct_handle;
status = dcerpc_lsa_CreateAccount(p, mem_ctx, &r);
@@ -340,6 +340,46 @@ static BOOL test_CreateAccount(struct dcerpc_pipe *p,
return True;
}
+
+static BOOL test_CreateTrustedDomain(struct dcerpc_pipe *p,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct lsa_CreateTrustedDomain r;
+ struct lsa_TrustInformation trustinfo;
+ struct dom_sid *domsid;
+ struct policy_handle dom_handle;
+
+ printf("Testing CreateTrustedDomain\n");
+
+ if (!find_domain_sid(p, mem_ctx, handle, &domsid)) {
+ return False;
+ }
+
+ domsid->sub_auths[domsid->num_auths-1] ^= 0xF0F0F0F0;
+
+ trustinfo.sid = domsid;
+ init_lsa_Name(&trustinfo.name, "torturedomain");
+
+ r.in.handle = handle;
+ r.in.info = &trustinfo;
+ r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
+ r.out.dom_handle = &dom_handle;
+
+ status = dcerpc_lsa_CreateTrustedDomain(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("CreateTrustedDomain failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ if (!test_Delete(p, mem_ctx, &dom_handle)) {
+ return False;
+ }
+
+ return True;
+}
+
static BOOL test_EnumAccountRights(struct dcerpc_pipe *p,
TALLOC_CTX *mem_ctx,
struct policy_handle *acct_handle,
@@ -635,6 +675,10 @@ BOOL torture_rpc_lsa(int dummy)
ret = False;
}
+ if (!test_CreateTrustedDomain(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
if (!test_EnumAccounts(p, mem_ctx, &handle)) {
ret = False;
}