net: Fix several typos in comments.
[Samba.git] / source / rpcclient / cmd_test.c
blobdd956604cc579c960aff50df8368f1c74ec94548
1 /*
2 Unix SMB/CIFS implementation.
3 RPC pipe client
5 Copyright (C) Volker Lendecke 2005
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 3 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, see <http://www.gnu.org/licenses/>.
21 #include "includes.h"
22 #include "rpcclient.h"
24 static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
25 int argc, const char **argv)
27 struct rpc_pipe_client *lsa_pipe = NULL, *samr_pipe = NULL;
28 NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
29 POLICY_HND pol;
31 d_printf("testme\n");
33 lsa_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
34 PI_LSARPC, &status);
35 if (lsa_pipe == NULL) goto done;
37 samr_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
38 PI_SAMR, &status);
39 if (samr_pipe == NULL) goto done;
41 status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False,
42 SEC_RIGHTS_QUERY_VALUE, &pol);
44 if (!NT_STATUS_IS_OK(status))
45 goto done;
47 status = rpccli_lsa_Close(lsa_pipe, mem_ctx, &pol);
49 if (!NT_STATUS_IS_OK(status))
50 goto done;
52 done:
53 TALLOC_FREE(lsa_pipe);
54 TALLOC_FREE(samr_pipe);
56 return status;
59 /* List of commands exported by this module */
61 struct cmd_set test_commands[] = {
63 { "TESTING" },
65 { "testme", RPC_RTYPE_NTSTATUS, cmd_testme, NULL,
66 -1, NULL, "Sample test", "testme" },
68 { NULL }