From feb4f52f134d463c9871cd1709897a4b9ccfc6d2 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 3 Dec 2001 04:39:23 +0000 Subject: This is another major rework of the 'net' command. This time, all the existing functionality has been moved into 'net rap', ready for new commands in the 'net ads' and 'net rpc' categories. In particular, we hope to have the abilty to autoselect the appropriate backend to use based on smb.conf or other paramaters. This will allow 'net user' to work no matter what the remote server. The new 'net rpc' command will soon gain a 'net rpc join' and a 'net rpc user' based on the existing samba code. Also in this commit, the connection establishment code has been almost entirly reworked, and now has some minor sense of sainity to it. In particular, we can now connect to hosts *other* than localhost! We also have the ability to state on a per-command basis whether the 'localhost' is a sane default value. (A net join, for example, would not be sane against localhost). Unfortunetly we have had to make the basic paramaters global variables, but the 'cli' is not opened and closed on a per-command basis. Andrew Bartlett (This used to be commit 8739d426caabe3794a018dd28ab139b08f88b603) --- source3/Makefile.in | 2 +- source3/utils/net.c | 1133 ++++----------------------------------------- source3/utils/net_rap.c | 1161 +++++++++++++++++++++++++++++++++++++++++++++++ source3/utils/net_rpc.c | 36 ++ 4 files changed, 1274 insertions(+), 1058 deletions(-) create mode 100644 source3/utils/net_rap.c create mode 100644 source3/utils/net_rpc.c diff --git a/source3/Makefile.in b/source3/Makefile.in index 0691047b8c..1aa3e02efa 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -319,7 +319,7 @@ CLIENT_OBJ = client/client.o client/clitar.o \ $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \ $(READLINE_OBJ) -NET_OBJ = utils/net.o utils/net_ads.o \ +NET_OBJ = utils/net.o utils/net_ads.o utils/net_rap.o utils/net_rpc.o \ $(LIBSMB_OBJ) $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) diff --git a/source3/utils/net.c b/source3/utils/net.c index 5a92766fa5..1c62ab5442 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -5,10 +5,13 @@ Copyright (C) 2001 Steve French (sfrench@us.ibm.com) Copyright (C) 2001 Jim McDonough (jmcd@us.ibm.com) Copyright (C) 2001 Andrew Tridgell (tridge@samba.org) + Copyright (C) 2001 Andrew Bartlett (abartlet@samba.org) Originally written by Steve and Jim. Largely rewritten by tridge in November 2001. + Reworked again by abartlet in December 2001 + 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 2 of the License, or @@ -36,6 +39,7 @@ /*****************************************************/ #include "includes.h" +#include "../utils/net.h" /***********************************************************************/ /* Beginning of internationalization section. Translatable constants */ @@ -49,257 +53,25 @@ #define YES_STRING "Yes" #define NO_STRING "No" -#define NET_USAGE \ - "\nUsage: \n"\ - " net domain \tto list domains \n"\ - " net file \tto list open files on a server \n"\ - " net group \tto list user groups \n"\ - " net groupmember to list users in a group \n"\ - " net password\t to change the password of a user\n"\ - " net printq \tto list the print queues on a server\n"\ - " net server \tto list servers in a domain\n"\ - " net session \tto list clients with open sessions to a server\n"\ - " net share \tto list shares exported by a server\n"\ - " net user \tto list users\n"\ - " net validate \tto check whether a user and the corresponding password are valid\n"\ - " net help\n"\ - "\nType \"net help