diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/Makefile.in | 1 | ||||
-rw-r--r-- | source3/rpcclient/cmd_wkssvc.c | 97 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 2 |
3 files changed, 35 insertions, 65 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index 4eea8f1815..532290ce21 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -637,6 +637,7 @@ RPCCLIENT_OBJ1 = rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o \ rpcclient/cmd_dfs.o \ rpcclient/cmd_ds.o rpcclient/cmd_echo.o \ rpcclient/cmd_shutdown.o rpcclient/cmd_test.o \ + rpcclient/cmd_wkssvc.o \ $(DISPLAY_SEC_OBJ) $(DISPLAY_DSDCINFO_OBJ) RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \ diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index de5b29880a..4f4c364ea2 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -1,85 +1,52 @@ -/* +/* Unix SMB/CIFS implementation. - NT Domain Authentication SMB / MSRPC client - Copyright (C) Andrew Tridgell 1994-1997 - Copyright (C) Luke Kenneth Casson Leighton 1996-1997 - + RPC pipe client + + Copyright (C) Günther Deschner 2007 + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -THIS IS NO LONGER USED - NEEDS REMOVAL. - #include "includes.h" +#include "rpcclient.h" -#define DEBUG_TESTING - -extern struct cli_state *smb_cli; - -extern FILE* out_hnd; - - -/**************************************************************************** -workstation get info query -****************************************************************************/ -void cmd_wks_query_info(struct client_info *info) +static WERROR cmd_wkssvc_wkstagetinfo(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + int argc, + const char **argv) { - fstring dest_wks; - fstring tmp; - WKS_INFO_100 ctr; - uint32 info_level = 100; - - bool res = True; - - memset((char *)&ctr, '\0', sizeof(ctr)); - - fstrcpy(dest_wks, "\\\\"); - fstrcat(dest_wks, info->dest_host); - strupper_m(dest_wks); - - if (next_token_nr(NULL, tmp, NULL, sizeof(tmp))) - { - info_level = (uint32)strtol(tmp, (char**)NULL, 10); + NTSTATUS status; + uint32_t level = 100; + union wkssvc_NetWkstaInfo info; + const char *server_name; + + server_name = cli->cli->desthost; + + status = rpccli_wkssvc_NetWkstaGetInfo(cli, mem_ctx, + server_name, + level, + &info); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); } - DEBUG(4,("cmd_wks_query_info: server:%s info level: %d\n", - dest_wks, info_level)); - - DEBUG(5, ("cmd_wks_query_info: smb_cli->fd:%d\n", smb_cli->fd)); - - /* open LSARPC session. */ - res = res ? cli_nt_session_open(smb_cli, PI_WKSSVC) : False; - - /* send info level: receive requested info. hopefully. */ - res = res ? do_wks_query_info(smb_cli, - dest_wks, info_level, &ctr) : False; - - /* close the session */ - cli_nt_session_close(smb_cli); - - if (res) - { - DEBUG(5,("cmd_wks_query_info: query succeeded\n")); + return WERR_OK; +} -#if 0 - display_wks_info_100(out_hnd, ACTION_HEADER , &ctr); - display_wks_info_100(out_hnd, ACTION_ENUMERATE, &ctr); - display_wks_info_100(out_hnd, ACTION_FOOTER , &ctr); -#endif +struct cmd_set wkssvc_commands[] = { - } - else - { - DEBUG(5,("cmd_wks_query_info: query failed\n")); - } -} + { "WKSSVC" }, + { "wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" }, + { NULL } +}; diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index d24a97c89e..ea7db88224 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -502,6 +502,7 @@ extern struct cmd_set ds_commands[]; extern struct cmd_set echo_commands[]; extern struct cmd_set shutdown_commands[]; extern struct cmd_set test_commands[]; +extern struct cmd_set wkssvc_commands[]; static struct cmd_set *rpcclient_command_list[] = { rpcclient_commands, @@ -515,6 +516,7 @@ static struct cmd_set *rpcclient_command_list[] = { echo_commands, shutdown_commands, test_commands, + wkssvc_commands, NULL }; |