rpcclient/cmd_test.c

説明を見る。
00001 /* 
00002    Unix SMB/CIFS implementation.
00003    RPC pipe client
00004 
00005    Copyright (C) Volker Lendecke 2005
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011    
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016    
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 /* List of commands exported by this module */
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 };

Sambaに対してSat Aug 29 21:23:23 2009に生成されました。  doxygen 1.4.7