diff options
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/echo.c | 8 | ||||
-rw-r--r-- | source4/torture/rpc/lsa.c | 52 |
2 files changed, 29 insertions, 31 deletions
diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c index 1d034c48df..8780b39f87 100644 --- a/source4/torture/rpc/echo.c +++ b/source4/torture/rpc/echo.c @@ -53,7 +53,7 @@ static BOOL test_echodata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) int i; NTSTATUS status; char *data_in, *data_out; - int len = 17; + int len = 1 + (random() % 5000); int len_out; printf("\nTesting EchoData\n"); @@ -92,7 +92,7 @@ static BOOL test_sourcedata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) int i; NTSTATUS status; char *data_out; - int len = 200000; + int len = 200000 + (random() % 5000); int len_out; printf("\nTesting SourceData\n"); @@ -126,7 +126,7 @@ static BOOL test_sinkdata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) int i; NTSTATUS status; char *data_in; - int len = 200000; + int len = 200000 + (random() % 5000); printf("\nTesting SinkData\n"); @@ -143,6 +143,8 @@ static BOOL test_sinkdata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) return False; } + printf("sunk %d bytes\n", len); + return True; } diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index cac7f80d5a..95a07ef0c6 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -1,7 +1,7 @@ /* Unix SMB/CIFS implementation. test suite for lsa rpc operations - Copyright (C) Tim Potter 2003 + Copyright (C) Andrew Tridgell 2003 This program is free software; you can redistribute it and/or modify @@ -21,38 +21,40 @@ #include "includes.h" -/* form a lsa open request */ -static DATA_BLOB blob_lsa_open_policy_req(TALLOC_CTX *mem_ctx, BOOL sec_qos, uint32 des_access) +static BOOL test_OpenPolicy(struct dcerpc_pipe *p) { - prs_struct qbuf; - LSA_Q_OPEN_POL q; - LSA_SEC_QOS qos; + struct lsa_ObjectAttribute attr; + struct policy_handle handle; + struct lsa_QosInfo qos; + NTSTATUS status; - ZERO_STRUCT(q); + qos.impersonation_level = 2; + qos.context_mode = 1; + qos.effective_only = 0; - /* Initialise parse structures */ - prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL); + attr.root_dir = NULL; + attr.object_name = NULL; + attr.attributes = 0; + attr.sec_desc = NULL; + attr.sec_qos = &qos; - /* Initialise input parameters */ - if (sec_qos) { - init_lsa_sec_qos(&qos, 2, 1, 0); - init_q_open_pol(&q, '\\', 0, des_access, &qos); - } else { - init_q_open_pol(&q, '\\', 0, des_access, NULL); + status = dcerpc_lsa_OpenPolicy(p, + "\\", + &attr, + SEC_RIGHTS_MAXIMUM_ALLOWED, + &handle); + if (!NT_STATUS_IS_OK(status)) { + printf("OpenPolicy failed - %s\n", nt_errstr(status)); + return False; } - if (lsa_io_q_open_pol("", &q, &qbuf, 0)) - return data_blob_talloc( - mem_ctx, prs_data_p(&qbuf), prs_offset(&qbuf)); - - return data_blob(NULL, 0); + return True; } BOOL torture_rpc_lsa(int dummy) { NTSTATUS status; struct dcerpc_pipe *p; - DATA_BLOB request, response; TALLOC_CTX *mem_ctx; mem_ctx = talloc_init("torture_rpc_lsa"); @@ -62,13 +64,7 @@ BOOL torture_rpc_lsa(int dummy) return False; } - request = blob_lsa_open_policy_req(mem_ctx, True, - SEC_RIGHTS_MAXIMUM_ALLOWED); - - status = cli_dcerpc_request(p, LSA_OPENPOLICY, mem_ctx, &request, &response); - if (!NT_STATUS_IS_OK(status)) { - d_printf("Failed to LSA_OPENPOLICY - %s\n", nt_errstr(status)); - } + test_OpenPolicy(p); torture_rpc_close(p); |