diff options
Diffstat (limited to 'source3/rpcclient/cmd_srvsvc.c')
-rw-r--r-- | source3/rpcclient/cmd_srvsvc.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c index 9e5b2054ee..f4ff11adf1 100644 --- a/source3/rpcclient/cmd_srvsvc.c +++ b/source3/rpcclient/cmd_srvsvc.c @@ -23,6 +23,7 @@ */ #include "includes.h" +#include "rpcclient.h" /* Display server query info */ @@ -180,12 +181,12 @@ static void display_srv_info_102(SRV_INFO_102 *sv102) /* Server query info */ -static NTSTATUS cmd_srvsvc_srv_query_info(struct cli_state *cli, int argc, - char **argv) +static NTSTATUS cmd_srvsvc_srv_query_info(struct cli_state *cli, + TALLOC_CTX *mem_ctx, + int argc, char **argv) { uint32 info_level = 101; SRV_INFO_CTR ctr; - TALLOC_CTX *mem_ctx; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; if (argc > 2) { @@ -196,20 +197,9 @@ static NTSTATUS cmd_srvsvc_srv_query_info(struct cli_state *cli, int argc, if (argc == 2) info_level = atoi(argv[1]); - if (!(mem_ctx = talloc_init())) { - DEBUG(0,("cmd_srvsvc_srv_query_info: talloc_init failed\n")); - return result; - } - - /* Initialise RPC connection */ - - if (!cli_nt_session_open (cli, PIPE_SRVSVC)) { - DEBUG(0, ("Could not initialize srvsvc pipe!\n")); - goto done; - } - result = cli_srvsvc_net_srv_get_info(cli, mem_ctx, info_level, &ctr); + if (!NT_STATUS_IS_OK(result)) { goto done; } @@ -229,8 +219,6 @@ static NTSTATUS cmd_srvsvc_srv_query_info(struct cli_state *cli, int argc, } done: - talloc_destroy(mem_ctx); - return result; } @@ -240,7 +228,7 @@ struct cmd_set srvsvc_commands[] = { { "SRVSVC" }, - { "srvinfo", cmd_srvsvc_srv_query_info, "Server query info", "" }, + { "srvinfo", cmd_srvsvc_srv_query_info, PIPE_SRVSVC, "Server query info", "" }, { NULL } }; |