summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_wkssvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient/cmd_wkssvc.c')
-rw-r--r--source3/rpcclient/cmd_wkssvc.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c
index 474c53f347..0b8f469af3 100644
--- a/source3/rpcclient/cmd_wkssvc.c
+++ b/source3/rpcclient/cmd_wkssvc.c
@@ -33,36 +33,48 @@ extern int DEBUGLEVEL;
#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, int argc, char *argv[])
+void cmd_wks_query_info(struct client_info *info)
{
fstring dest_wks;
+ fstring tmp;
WKS_INFO_100 ctr;
uint32 info_level = 100;
BOOL res = True;
- bzero(&ctr, sizeof(ctr));
+ memset((char *)&ctr, '\0', sizeof(ctr));
fstrcpy(dest_wks, "\\\\");
fstrcat(dest_wks, info->dest_host);
strupper(dest_wks);
- if (argc > 1)
+ if (next_token(NULL, tmp, NULL, sizeof(tmp)))
{
- info_level = (uint32)strtol(argv[1], (char**)NULL, 10);
+ info_level = (uint32)strtol(tmp, (char**)NULL, 10);
}
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, PIPE_WKSSVC) : False;
+
/* send info level: receive requested info. hopefully. */
- res = res ? wks_query_info( dest_wks, info_level, &ctr) : False;
+ 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)
{