diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-12-02 12:16:08 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-12-02 12:16:08 +0000 |
commit | ea507ee6059215b9605443ba3e9405089207e9e8 (patch) | |
tree | 743ca986b34d62f5e413447c0fea3c5cb415252c /source4/torture | |
parent | de32d669c6b7eb0053b843726e9520b1e20c85f6 (diff) | |
download | samba-ea507ee6059215b9605443ba3e9405089207e9e8.tar.gz samba-ea507ee6059215b9605443ba3e9405089207e9e8.tar.bz2 samba-ea507ee6059215b9605443ba3e9405089207e9e8.zip |
added netr_LogonControl2Ex()
I also added IDL for netr_DatabaseRedo() but I don't yet know how it
works
thats the last of the netlogon IDL !
(This used to be commit 387d8f25ff4858943d1389974127d03a58bf4c8f)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/netlogon.c | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index e7d77b35d1..682e28320d 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -645,7 +645,6 @@ static BOOL test_LogonControl2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) return ret; } - /* try a netlogon DatabaseSync2 */ @@ -697,6 +696,87 @@ static BOOL test_DatabaseSync2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } +/* + try a netlogon LogonControl2Ex +*/ +static BOOL test_LogonControl2Ex(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct netr_LogonControl2Ex r; + BOOL ret = True; + int i; + + r.in.logon_server = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p)); + + r.in.function_code = NETLOGON_CONTROL_REDISCOVER; + r.in.data.domain = lp_workgroup(); + + for (i=1;i<4;i++) { + r.in.level = i; + + printf("Testing LogonControl2Ex level %d function %d\n", + i, r.in.function_code); + + status = dcerpc_netr_LogonControl2Ex(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("LogonControl - %s\n", nt_errstr(status)); + ret = False; + } + } + + r.in.function_code = NETLOGON_CONTROL_TC_QUERY; + r.in.data.domain = lp_workgroup(); + + for (i=1;i<4;i++) { + r.in.level = i; + + printf("Testing LogonControl2Ex level %d function %d\n", + i, r.in.function_code); + + status = dcerpc_netr_LogonControl2Ex(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("LogonControl - %s\n", nt_errstr(status)); + ret = False; + } + } + + r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY; + r.in.data.domain = lp_workgroup(); + + for (i=1;i<4;i++) { + r.in.level = i; + + printf("Testing LogonControl2Ex level %d function %d\n", + i, r.in.function_code); + + status = dcerpc_netr_LogonControl2Ex(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("LogonControl - %s\n", nt_errstr(status)); + ret = False; + } + } + + r.in.function_code = NETLOGON_CONTROL_SET_DBFLAG; + r.in.data.debug_level = ~0; + + for (i=1;i<4;i++) { + r.in.level = i; + + printf("Testing LogonControl2Ex level %d function %d\n", + i, r.in.function_code); + + status = dcerpc_netr_LogonControl2Ex(p, mem_ctx, &r); + if (!NT_STATUS_IS_OK(status)) { + printf("LogonControl - %s\n", nt_errstr(status)); + ret = False; + } + } + + return ret; +} + + + BOOL torture_rpc_netlogon(int dummy) { NTSTATUS status; @@ -768,6 +848,10 @@ BOOL torture_rpc_netlogon(int dummy) ret = False; } + if (!test_LogonControl2Ex(p, mem_ctx)) { + ret = False; + } + torture_rpc_close(p); return ret; |