2 Unix SMB/CIFS implementation.
3 test suite for lsa rpc operations
4 Copyright (C) Tim Potter 2003
5 Copyright (C) Andrew Tridgell 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 /* Helper function for RPC-OPEN test */
25 static DATA_BLOB blob_lsa_open_policy_req(TALLOC_CTX *mem_ctx, BOOL sec_qos,
34 /* Initialise parse structures */
36 prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
38 /* Initialise input parameters */
40 init_lsa_sec_qos(&qos, 2, 1, 0);
41 init_q_open_pol(&q, '\\', 0, des_access, &qos);
43 init_q_open_pol(&q, '\\', 0, des_access, NULL);
46 if (lsa_io_q_open_pol("", &q, &qbuf, 0))
47 return data_blob_talloc(
48 mem_ctx, prs_data_p(&qbuf), prs_offset(&qbuf));
50 return data_blob(NULL, 0);
53 BOOL torture_rpc_lsa(int dummy)
56 struct dcerpc_pipe *p;
57 DATA_BLOB request, response;
60 mem_ctx = talloc_init("torture_rpc_lsa");
62 status = torture_rpc_connection(&p, "lsarpc");
63 if (!NT_STATUS_IS_OK(status)) {
67 request = blob_lsa_open_policy_req(mem_ctx, True,
68 SEC_RIGHTS_MAXIMUM_ALLOWED);
70 status = cli_dcerpc_request(p, LSA_OPENPOLICY, mem_ctx, &request, &response);
71 if (!NT_STATUS_IS_OK(status)) {
72 d_printf("Failed to LSA_OPENPOLICY - %s\n", nt_errstr(status));
77 return NT_STATUS_IS_OK(status);