00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "includes.h"
00023 #include "rpcclient.h"
00024
00025 static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00026 int argc, const char **argv)
00027 {
00028 struct rpc_pipe_client *lsa_pipe = NULL, *samr_pipe = NULL;
00029 NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
00030 POLICY_HND pol;
00031
00032 d_printf("testme\n");
00033
00034 lsa_pipe = cli_rpc_pipe_open_noauth(cli->cli, PI_LSARPC, &status);
00035 if (lsa_pipe == NULL) goto done;
00036
00037 samr_pipe = cli_rpc_pipe_open_noauth(cli->cli, PI_SAMR, &status);
00038 if (samr_pipe == NULL) goto done;
00039
00040 status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False,
00041 SEC_RIGHTS_QUERY_VALUE, &pol);
00042
00043 if (!NT_STATUS_IS_OK(status))
00044 goto done;
00045
00046 status = rpccli_lsa_close(lsa_pipe, mem_ctx, &pol);
00047
00048 if (!NT_STATUS_IS_OK(status))
00049 goto done;
00050
00051 done:
00052 if (lsa_pipe != NULL) cli_rpc_pipe_close(lsa_pipe);
00053 if (samr_pipe != NULL) cli_rpc_pipe_close(samr_pipe);
00054
00055 return status;
00056 }
00057
00058
00059
00060 struct cmd_set test_commands[] = {
00061
00062 { "TESTING" },
00063
00064 { "testme", RPC_RTYPE_NTSTATUS, cmd_testme, NULL,
00065 -1, NULL, "Sample test", "testme" },
00066
00067 { NULL }
00068 };