summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-17 06:19:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:18 -0500
commit90fd8aef69af6ee2636adc2c19e160fc34081876 (patch)
treef5cc225ff0b701e57e5274216c9e9fec1341b06f /source4
parenta106e7c7f20b9e510bb829a9a0a6bf3c9e39389f (diff)
downloadsamba-90fd8aef69af6ee2636adc2c19e160fc34081876.tar.gz
samba-90fd8aef69af6ee2636adc2c19e160fc34081876.tar.bz2
samba-90fd8aef69af6ee2636adc2c19e160fc34081876.zip
r257: added samr_SetGroupInfo() IDL and test code
(This used to be commit fe1fc81ba76515b79069881d2d62f60201314d04)
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/idl/samr.idl6
-rw-r--r--source4/torture/rpc/samr.c25
2 files changed, 30 insertions, 1 deletions
diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl
index 348d58bec4..14371f56ae 100644
--- a/source4/librpc/idl/samr.idl
+++ b/source4/librpc/idl/samr.idl
@@ -374,7 +374,11 @@
/************************/
/* Function 0x15 */
- NTSTATUS samr_SET_GROUPINFO();
+ NTSTATUS samr_SetGroupInfo(
+ [in,ref] policy_handle *handle,
+ [in] uint16 level,
+ [in,switch_is(level),ref] samr_GroupInfo *info
+ );
/************************/
/* Function 0x16 */
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 6e593bc2c5..1e38b8ad70 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -859,7 +859,9 @@ static BOOL test_QueryGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
struct samr_QueryGroupInfo r;
+ struct samr_SetGroupInfo s;
uint16 levels[] = {1, 2, 3, 4};
+ uint16 set_ok[] = {0, 1, 1, 1};
int i;
BOOL ret = True;
@@ -875,6 +877,29 @@ static BOOL test_QueryGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
levels[i], nt_errstr(status));
ret = False;
}
+
+ printf("Testing SetGroupInfo level %u\n", levels[i]);
+
+ s.in.handle = handle;
+ s.in.level = levels[i];
+ s.in.info = r.out.info;
+
+ status = dcerpc_samr_SetGroupInfo(p, mem_ctx, &s);
+ if (set_ok[i]) {
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("SetGroupInfo 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("SetGroupInfo level %u gave %s - should have been NT_STATUS_INVALID_INFO_CLASS\n",
+ r.in.level, nt_errstr(status));
+ ret = False;
+ continue;
+ }
+ }
}
return ret;