diff options
-rw-r--r-- | source4/librpc/idl/samr.idl | 6 | ||||
-rw-r--r-- | source4/torture/rpc/samr.c | 18 | ||||
-rw-r--r-- | source4/utils/ndrdump.c | 17 |
3 files changed, 37 insertions, 4 deletions
diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl index 43db18a298..d7ae25a88a 100644 --- a/source4/librpc/idl/samr.idl +++ b/source4/librpc/idl/samr.idl @@ -806,7 +806,11 @@ /************************/ /* Function 0x39 */ - NTSTATUS samr_CONNECT2(); + NTSTATUS samr_Connect2( + [in] unistr *system_name, + [in] uint32 access_mask, + [out,ref] policy_handle *handle + ); /************************/ /* Function 0x3a */ diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 07faf2c165..f7006241b5 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -857,7 +857,9 @@ static BOOL test_Connect(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, { NTSTATUS status; struct samr_Connect r; + struct samr_Connect2 r2; struct samr_Connect4 r4; + BOOL ret = True; r.in.system_name = 0; r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED; @@ -866,7 +868,17 @@ static BOOL test_Connect(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Connect(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("Connect failed - %s\n", nt_errstr(status)); - return False; + ret = False; + } + + r2.in.system_name = ""; + r2.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED; + r2.out.handle = handle; + + status = dcerpc_samr_Connect2(p, mem_ctx, &r2); + if (!NT_STATUS_IS_OK(status)) { + printf("Connect2 failed - %s\n", nt_errstr(status)); + ret = False; } r4.in.system_name = ""; @@ -877,10 +889,10 @@ static BOOL test_Connect(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Connect4(p, mem_ctx, &r4); if (!NT_STATUS_IS_OK(status)) { printf("Connect4 failed - %s\n", nt_errstr(status)); - return False; + ret = False; } - return True; + return ret; } diff --git a/source4/utils/ndrdump.c b/source4/utils/ndrdump.c index c81a9948f3..6118192b33 100644 --- a/source4/utils/ndrdump.c +++ b/source4/utils/ndrdump.c @@ -24,6 +24,15 @@ struct dcerpc_interface_table *pipes[] = { &dcerpc_table_samr, &dcerpc_table_lsarpc, &dcerpc_table_netdfs, + &dcerpc_table_atsvc, + &dcerpc_table_dcerpc, + &dcerpc_table_rpcecho, + &dcerpc_table_epmapper, + &dcerpc_table_eventlog, + &dcerpc_table_spoolss, + &dcerpc_table_srvsvc, + &dcerpc_table_winreg, + &dcerpc_table_wkssvc, NULL }; @@ -175,5 +184,13 @@ int main(int argc, char *argv[]) pr.depth = 1; f->ndr_print(&pr, function, flags, st); + if (!NT_STATUS_IS_OK(status) || + ndr->offset != ndr->data_size) { + printf("dump FAILED\n"); + exit(1); + } + + printf("dump OK\n"); + return 0; } |