2008-05-12 13:56:18 +04:00
/*
Samba Unix / Linux SMB client library
2002-04-05 05:36:28 +04:00
net help commands
Copyright ( C ) 2002 Jim McDonough ( jmcd @ us . ibm . com )
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
2007-07-09 23:25:36 +04:00
the Free Software Foundation ; either version 3 of the License , or
2002-04-05 05:36:28 +04:00
( at your option ) any later version .
2008-05-12 13:56:18 +04:00
2002-04-05 05:36:28 +04:00
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 .
2008-05-12 13:56:18 +04:00
2002-04-05 05:36:28 +04:00
You should have received a copy of the GNU General Public License
2008-05-12 13:56:18 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2002-04-05 05:36:28 +04:00
*/
# include "includes.h"
2004-10-07 08:01:18 +04:00
# include "utils/net.h"
2002-04-05 05:36:28 +04:00
2008-05-15 12:14:41 +04:00
static int net_help_usage ( struct net_context * c , int argc , const char * * argv )
2002-04-05 05:36:28 +04:00
{
d_printf (
" \n " \
" Usage: net help <function> \n " \
" \n " \
" Valid functions are: \n " \
" RPC RAP ADS FILE SHARE SESSION SERVER DOMAIN PRINTQ USER GROUP VALIDATE \n " \
2003-08-29 00:24:25 +04:00
" GROUPMEMBER ADMIN SERVICE PASSWORD TIME LOOKUP GETLOCALSID SETLOCALSID \n " \
2006-05-16 21:40:28 +04:00
" SETDOMAINSID CHANGESCRETPW LOOKUP SAM \n " ) ;
2002-04-05 05:36:28 +04:00
return - 1 ;
}
2008-05-10 01:22:12 +04:00
static int net_usage ( struct net_context * c , int argc , const char * * argv )
2002-04-05 05:36:28 +04:00
{
d_printf ( " net time \t \t to view or set time information \n " \
2007-05-29 18:53:46 +04:00
" net lookup \t \t to lookup host name or ip address \n " \
2002-04-05 05:36:28 +04:00
" net user \t \t to manage users \n " \
2002-07-15 14:35:28 +04:00
" net group \t \t to manage groups \n " \
2006-02-04 01:19:41 +03:00
" net sam \t \t to edit the local user database directly \n " \
" net lookup \t \t to look up various things \n " \
2003-04-19 09:53:55 +04:00
" net groupmap \t \t to manage group mappings \n " \
2002-04-05 05:36:28 +04:00
" net join \t \t to join a domain \n " \
2002-09-25 19:19:00 +04:00
" net cache \t \t to operate on cache tdb file \n " \
" net getlocalsid [NAME] \t to get the SID for local name \n " \
" net setlocalsid SID \t to set the local domain SID \n " \
2006-05-16 21:40:28 +04:00
" net setdomainsid SID \t to set the domain SID on member servers \n " \
2003-08-29 00:24:25 +04:00
" net changesecretpw \t to change the machine password in the local secrets database only \n " \
" \t this requires the -f flag as a safety barrier \n " \
2003-12-01 16:58:43 +03:00
" net status \t \t Show server status \n " \
2007-06-23 02:37:07 +04:00
" net usersidlist \t to get a list of all users with their SIDs \n "
" net usershare \t \t to add, delete and list locally user-modifiable shares \n "
" net conf \t \t to view and edit samba's registry based configuration \n "
2002-04-05 05:36:28 +04:00
" \n " \
2002-07-15 14:35:28 +04:00
" net ads <command> \t to run ADS commands \n " \
" net rap <command> \t to run RAP (pre-RPC) commands \n " \
" net rpc <command> \t to run RPC commands \n " \
2002-04-05 05:36:28 +04:00
" \n " \
" Type \" net help <option> \" to get more information on that option \n " ) ;
2008-05-10 01:22:12 +04:00
net_common_flags_usage ( c , argc , argv ) ;
2002-04-05 05:36:28 +04:00
return - 1 ;
}
/*
handle " net help * " subcommands
*/
2008-05-10 01:22:12 +04:00
int net_help ( struct net_context * c , int argc , const char * * argv )
2002-04-05 05:36:28 +04:00
{
struct functable func [ ] = {
2008-05-15 12:14:41 +04:00
{ " ADS " , net_ads_usage } ,
{ " RAP " , net_rap_usage } ,
{ " RPC " , net_rpc_usage } ,
2002-04-05 05:36:28 +04:00
2008-05-13 15:52:58 +04:00
{ " FILE " , net_file_usage } ,
2008-05-14 16:24:21 +04:00
{ " SHARE " , net_share_usage } ,
2002-04-05 05:36:28 +04:00
{ " SESSION " , net_rap_session_usage } ,
{ " SERVER " , net_rap_server_usage } ,
{ " DOMAIN " , net_rap_domain_usage } ,
{ " PRINTQ " , net_rap_printq_usage } ,
2008-05-13 14:51:09 +04:00
{ " USER " , net_user_usage } ,
2008-05-13 15:44:28 +04:00
{ " GROUP " , net_group_usage } ,
2008-05-15 12:14:41 +04:00
{ " GROUPMAP " , net_groupmap_usage } ,
2008-05-13 13:11:35 +04:00
{ " JOIN " , net_join_usage } ,
2008-05-15 12:14:41 +04:00
{ " DOM " , net_dom_usage } ,
2002-04-05 05:36:28 +04:00
{ " VALIDATE " , net_rap_validate_usage } ,
{ " GROUPMEMBER " , net_rap_groupmember_usage } ,
{ " ADMIN " , net_rap_admin_usage } ,
{ " SERVICE " , net_rap_service_usage } ,
{ " PASSWORD " , net_rap_password_usage } ,
{ " TIME " , net_time_usage } ,
{ " LOOKUP " , net_lookup_usage } ,
2006-02-04 01:19:41 +03:00
{ " USERSHARE " , net_usershare_usage } ,
2004-10-12 15:58:01 +04:00
{ " USERSIDLIST " , net_usersidlist_usage } ,
2003-09-07 20:36:13 +04:00
# ifdef WITH_FAKE_KASERVER
2008-05-14 11:01:53 +04:00
{ " AFS " , net_afs_usage } ,
2003-09-07 20:36:13 +04:00
# endif
2006-02-04 01:19:41 +03:00
2008-05-15 12:14:41 +04:00
{ " HELP " , net_help_usage } ,
2002-04-05 05:36:28 +04:00
{ NULL , NULL } } ;
2008-05-10 01:22:12 +04:00
return net_run_function ( c , argc , argv , func , net_usage ) ;
2002-04-05 05:36:28 +04:00
}