2 Samba Unix/Linux SMB client library
4 Copyright (C) 2002 Jim McDonough (jmcd@us.ibm.com)
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "utils/net.h"
23 static int help_usage(struct net_context
*c
, int argc
, const char **argv
)
27 "Usage: net help <function>\n"\
29 "Valid functions are:\n"\
30 " RPC RAP ADS FILE SHARE SESSION SERVER DOMAIN PRINTQ USER GROUP VALIDATE\n"\
31 " GROUPMEMBER ADMIN SERVICE PASSWORD TIME LOOKUP GETLOCALSID SETLOCALSID\n"\
32 " SETDOMAINSID CHANGESCRETPW LOOKUP SAM\n");
36 int net_help_status(struct net_context
*c
, int argc
, const char **argv
)
38 d_printf(" net status sessions [parseable] "
39 "Show list of open sessions\n");
40 d_printf(" net status shares [parseable] "
41 "Show list of open shares\n");
45 static int net_usage(struct net_context
*c
, int argc
, const char **argv
)
47 d_printf(" net time\t\tto view or set time information\n"\
48 " net lookup\t\tto lookup host name or ip address\n"\
49 " net user\t\tto manage users\n"\
50 " net group\t\tto manage groups\n"\
51 " net sam\t\tto edit the local user database directly\n"\
52 " net lookup\t\tto look up various things\n"\
53 " net groupmap\t\tto manage group mappings\n"\
54 " net join\t\tto join a domain\n"\
55 " net cache\t\tto operate on cache tdb file\n"\
56 " net getlocalsid [NAME]\tto get the SID for local name\n"\
57 " net setlocalsid SID\tto set the local domain SID\n"\
58 " net setdomainsid SID\tto set the domain SID on member servers\n"\
59 " net changesecretpw\tto change the machine password in the local secrets database only\n"\
60 " \tthis requires the -f flag as a safety barrier\n"\
61 " net status\t\tShow server status\n"\
62 " net usersidlist\tto get a list of all users with their SIDs\n"
63 " net usershare\t\tto add, delete and list locally user-modifiable shares\n"
64 " net conf\t\tto view and edit samba's registry based configuration\n"
66 " net ads <command>\tto run ADS commands\n"\
67 " net rap <command>\tto run RAP (pre-RPC) commands\n"\
68 " net rpc <command>\tto run RPC commands\n"\
70 "Type \"net help <option>\" to get more information on that option\n");
71 net_common_flags_usage(c
, argc
, argv
);
76 handle "net help *" subcommands
78 int net_help(struct net_context
*c
, int argc
, const char **argv
)
80 struct functable func
[] = {
81 {"ADS", net_ads_help
},
82 {"RAP", net_rap_help
},
83 {"RPC", net_rpc_help
},
85 {"FILE", net_file_usage
},
86 {"SHARE", net_share_usage
},
87 {"SESSION", net_rap_session_usage
},
88 {"SERVER", net_rap_server_usage
},
89 {"DOMAIN", net_rap_domain_usage
},
90 {"PRINTQ", net_rap_printq_usage
},
91 {"USER", net_user_usage
},
92 {"GROUP", net_group_usage
},
93 {"GROUPMAP", net_help_groupmap
},
94 {"JOIN", net_join_usage
},
95 {"DOM", net_help_dom
},
96 {"VALIDATE", net_rap_validate_usage
},
97 {"GROUPMEMBER", net_rap_groupmember_usage
},
98 {"ADMIN", net_rap_admin_usage
},
99 {"SERVICE", net_rap_service_usage
},
100 {"PASSWORD", net_rap_password_usage
},
101 {"TIME", net_time_usage
},
102 {"LOOKUP", net_lookup_usage
},
103 {"USERSHARE", net_usershare_usage
},
104 {"USERSIDLIST", net_usersidlist_usage
},
105 #ifdef WITH_FAKE_KASERVER
106 {"AFS", net_afs_usage
},
109 {"HELP", help_usage
},
112 return net_run_function(c
, argc
, argv
, func
, net_usage
);