summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-17 05:25:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:17 -0500
commit826efc9c4674943405be6957a651529ef0c02f39 (patch)
treeae4de9d45560311ba24c83c66f1a101c560d5f71
parentb03a02ab25df3d6d043c75a77b6f17cbe0bb454f (diff)
downloadsamba-826efc9c4674943405be6957a651529ef0c02f39.tar.gz
samba-826efc9c4674943405be6957a651529ef0c02f39.tar.bz2
samba-826efc9c4674943405be6957a651529ef0c02f39.zip
r255: added samr_SetDomainInfo IDL and test code
(This used to be commit 9f12fb39dbac886582d0ccce418491522c042fe6)
-rw-r--r--source4/librpc/idl/samr.idl11
-rw-r--r--source4/torture/rpc/samr.c25
2 files changed, 35 insertions, 1 deletions
diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl
index 1226d1f770..8c48a7dbac 100644
--- a/source4/librpc/idl/samr.idl
+++ b/source4/librpc/idl/samr.idl
@@ -209,7 +209,16 @@
/************************/
/* Function 0x09 */
- NTSTATUS samr_SET_DOMAIN_INFO();
+ /*
+ only levels 1, 3, 4, 6, 7, 9, 12 are valid for this
+ call in w2k3
+ */
+ NTSTATUS samr_SetDomainInfo(
+ [in,ref] policy_handle *handle,
+ [in] uint16 level,
+ [in,switch_is(level),ref] samr_DomainInfo *info
+ );
+
/************************/
/* Function 0x0a */
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 39b181e1ad..74edc53c94 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -1154,7 +1154,9 @@ static BOOL test_QueryDomainInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
struct samr_QueryDomainInfo r;
+ struct samr_SetDomainInfo s;
uint16 levels[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13};
+ uint16 set_ok[] = {1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0};
int i;
BOOL ret = True;
@@ -1171,6 +1173,29 @@ static BOOL test_QueryDomainInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
continue;
}
+
+ printf("Testing SetDomainInfo level %u\n", levels[i]);
+
+ s.in.handle = handle;
+ s.in.level = levels[i];
+ s.in.info = r.out.info;
+
+ status = dcerpc_samr_SetDomainInfo(p, mem_ctx, &s);
+ if (set_ok[i]) {
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("SetDomainInfo level %u failed - %s\n",
+ r.in.level, nt_errstr(status));
+ ret = False;
+ continue;
+ }
+ } else {
+ if (!NT_STATUS_EQUAL(NT_STATUS_INVALID_INFO_CLASS, status)) {
+ printf("SetDomainInfo level %u gave %s - should have been NT_STATUS_INVALID_INFO_CLASS\n",
+ r.in.level, nt_errstr(status));
+ ret = False;
+ continue;
+ }
+ }
}
return True;