[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-432-g1d615e3

Günther Deschner gd at samba.org
Mon Dec 3 12:08:52 GMT 2007


The branch, v3-2-test has been updated
       via  1d615e3ac397106f47c51ace36c01a8f6e1d5d13 (commit)
      from  bbbeeba163f173d774937103a36560a4a4f49d4b (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 1d615e3ac397106f47c51ace36c01a8f6e1d5d13
Author: Günther Deschner <gd at samba.org>
Date:   Mon Dec 3 12:42:17 2007 +0100

    Reanimate rpcclient wkssvc command.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/Makefile.in            |    1 +
 source/rpcclient/cmd_wkssvc.c |   97 +++++++++++++---------------------------
 source/rpcclient/rpcclient.c  |    2 +
 3 files changed, 35 insertions(+), 65 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index 4eea8f1..532290c 100644
--- a/source/Makefile.in
+++ b/source/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/source/rpcclient/cmd_wkssvc.c b/source/rpcclient/cmd_wkssvc.c
index de5b298..4f4c364 100644
--- a/source/rpcclient/cmd_wkssvc.c
+++ b/source/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/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c
index d24a97c..ea7db88 100644
--- a/source/rpcclient/rpcclient.c
+++ b/source/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
 };
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list