From 0f64ce0179c97487f94f42344e6a858bcd01c577 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 10 Mar 2008 05:17:09 +0100 Subject: Use rpccli_srvsvc_NetShareGetInfo in 2 places in "net". Guenther (This used to be commit 2ce76ce2bccefb4a072bed039a4837ae334dea55) --- source3/utils/net_rpc.c | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 399ace8d40..15450cfafa 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -4748,20 +4748,25 @@ static void show_userlist(struct rpc_pipe_client *pipe_hnd, SEC_DESC *root_sd = NULL; struct cli_state *cli = pipe_hnd->cli; int i; - SRV_SHARE_INFO info; + union srvsvc_NetShareInfo info; WERROR result; + NTSTATUS status; uint16 cnum; - result = rpccli_srvsvc_net_share_get_info(pipe_hnd, mem_ctx, netname, - 502, &info); + status = rpccli_srvsvc_NetShareGetInfo(pipe_hnd, mem_ctx, + pipe_hnd->cli->desthost, + netname, + 502, + &info, + &result); - if (!W_ERROR_IS_OK(result)) { + if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(result)) { DEBUG(1, ("Coult not query secdesc for share %s\n", netname)); return; } - share_sd = info.share.info502.info_502_str.sd; + share_sd = info.info502->sd; if (share_sd == NULL) { DEBUG(1, ("Got no secdesc for share %s\n", netname)); @@ -4781,7 +4786,6 @@ static void show_userlist(struct rpc_pipe_client *pipe_hnd, for (i=0; i\n", ctx->whoami); return NT_STATUS_INVALID_PARAMETER; } - result = rpccli_srvsvc_net_share_get_info( - pipe_hnd, mem_ctx, argv[0], 2, &info); - if (!W_ERROR_IS_OK(result)) { + status = rpccli_srvsvc_NetShareGetInfo(pipe_hnd, mem_ctx, + pipe_hnd->cli->desthost, + argv[0], + 2, + &info, + &result); + if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(result)) { goto done; } - d_printf("Name: %s\n", - rpcstr_pull_unistr2_talloc(mem_ctx, - &info2->info_2_str.uni_netname)); - d_printf("Comment: %s\n", - rpcstr_pull_unistr2_talloc(mem_ctx, - &info2->info_2_str.uni_remark)); - - d_printf("Path: %s\n", - rpcstr_pull_unistr2_talloc(mem_ctx, - &info2->info_2_str.uni_path)); - d_printf("Password: %s\n", - rpcstr_pull_unistr2_talloc(mem_ctx, - &info2->info_2_str.uni_passwd)); + d_printf("Name: %s\n", info.info2->name); + d_printf("Comment: %s\n", info.info2->comment); + d_printf("Path: %s\n", info.info2->path); + d_printf("Password: %s\n", info.info2->password); done: return werror_to_ntstatus(result); -- cgit