summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/autoidl.c2
-rw-r--r--source4/torture/rpc/samr.c72
2 files changed, 69 insertions, 5 deletions
diff --git a/source4/torture/rpc/autoidl.c b/source4/torture/rpc/autoidl.c
index 6021f10c49..1c164af333 100644
--- a/source4/torture/rpc/autoidl.c
+++ b/source4/torture/rpc/autoidl.c
@@ -227,7 +227,7 @@ static void test_scan_call(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_ta
static void test_auto_scan(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_table *iface)
{
- test_scan_call(mem_ctx, iface, 0x26);
+ test_scan_call(mem_ctx, iface, 0x42);
}
BOOL torture_rpc_autoidl(int dummy)
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 7433627743..3e8ff53771 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -61,6 +61,62 @@ static BOOL test_Close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return True;
}
+static BOOL test_Shutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct samr_Shutdown r;
+
+ if (lp_parm_int(-1, "torture", "dangerous") != 1) {
+ printf("samr_Shutdown disabled - enable dangerous tests to use\n");
+ return True;
+ }
+
+ r.in.handle = handle;
+
+ printf("testing samr_Shutdown\n");
+
+ status = dcerpc_samr_Shutdown(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("samr_Shutdown failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ return True;
+}
+
+static BOOL test_SetDsrmPassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ NTSTATUS status;
+ struct samr_SetDsrmPassword r;
+ struct samr_Name name;
+ struct samr_Hash hash;
+
+ if (lp_parm_int(-1, "torture", "dangerous") != 1) {
+ printf("samr_SetDsrmPassword disabled - enable dangerous tests to use\n");
+ return True;
+ }
+
+ E_md4hash("TeSTDSRM123", hash.hash);
+
+ init_samr_Name(&name, "Administrator");
+
+ r.in.name = &name;
+ r.in.unknown = 0;
+ r.in.hash = &hash;
+
+ printf("testing samr_SetDsrmPassword\n");
+
+ status = dcerpc_samr_SetDsrmPassword(p, mem_ctx, &r);
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
+ printf("samr_SetDsrmPassword failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ return True;
+}
+
static BOOL test_QuerySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)
@@ -241,10 +297,10 @@ static BOOL test_SetUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
TEST_USERINFO_INT(2, code_page, 21, code_page, __LINE__, 0);
TEST_USERINFO_INT(21, code_page, 21, code_page, __LINE__, 0x00800000);
- TEST_USERINFO_INT(4, logon_hours.bitmap[3], 3, logon_hours.bitmap[3], __LINE__, 0);
- TEST_USERINFO_INT(4, logon_hours.bitmap[3], 5, logon_hours.bitmap[3], __LINE__, 0);
- TEST_USERINFO_INT(4, logon_hours.bitmap[3], 21, logon_hours.bitmap[3], __LINE__, 0);
- TEST_USERINFO_INT(21, logon_hours.bitmap[3], 21, logon_hours.bitmap[3], __LINE__, 0x00002000);
+ TEST_USERINFO_INT(4, logon_hours.bitmap[3], 3, logon_hours.bitmap[3], 1, 0);
+ TEST_USERINFO_INT(4, logon_hours.bitmap[3], 5, logon_hours.bitmap[3], 2, 0);
+ TEST_USERINFO_INT(4, logon_hours.bitmap[3], 21, logon_hours.bitmap[3], 3, 0);
+ TEST_USERINFO_INT(21, logon_hours.bitmap[3], 21, logon_hours.bitmap[3], 4, 0x00002000);
#if 0
/* these fail with win2003 - it appears you can't set the primary gid?
@@ -2637,6 +2693,14 @@ BOOL torture_rpc_samr(int dummy)
ret = False;
}
+ if (!test_SetDsrmPassword(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
+ if (!test_Shutdown(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
if (!test_Close(p, mem_ctx, &handle)) {
ret = False;
}