summaryrefslogtreecommitdiff
path: root/source3/utils/net.c
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-03-15 22:04:53 +0000
committerJim McDonough <jmcd@samba.org>2002-03-15 22:04:53 +0000
commite9394d52389c27dd529355de7baec96e18963b49 (patch)
treedd92ac2f5f63655775fb45305bcc74ebd4a217b4 /source3/utils/net.c
parentbb38f48f6f2b5a5b8803c622e40107bb15876625 (diff)
downloadsamba-e9394d52389c27dd529355de7baec96e18963b49.tar.gz
samba-e9394d52389c27dd529355de7baec96e18963b49.tar.bz2
samba-e9394d52389c27dd529355de7baec96e18963b49.zip
Add autodetect for net join, as well as some more help updates
(This used to be commit 951006374e48d80a5128d870bdc255bf8c22cb6a)
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r--source3/utils/net.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index a8ef721512..109807851a 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -302,6 +302,22 @@ struct cli_state *net_make_ipc_connection(unsigned flags)
}
+static int net_join(int argc, const char **argv)
+{
+ if (lp_security() < SEC_DOMAIN) {
+ d_printf("Error: security setting must be DOMAIN or ADS to "\
+ "joing a domain\n\n");
+ return -1;
+ }
+ if (lp_security() == SEC_ADS) {
+ if (net_ads_join(argc, argv) == 0)
+ return 0;
+ else
+ d_printf("ADS join did not work, trying RPC...\n");
+ }
+ return net_rpc_join(argc, argv);
+}
+
static int net_usage(int argc, const char **argv)
{
d_printf(" net time\t\t to view or set time information\n"\
@@ -335,7 +351,7 @@ static int net_help(int argc, const char **argv)
struct functable func[] = {
{"ADS", net_ads_usage},
{"RAP", net_rap_help},
- {"RPC", net_rpc_usage},
+ {"RPC", net_rpc_help},
{"FILE", net_rap_file_usage},
{"SHARE", net_rap_share_usage},
@@ -381,6 +397,7 @@ static struct functable net_func[] = {
{"PASSWORD", net_rap_password},
{"TIME", net_time},
{"LOOKUP", net_lookup},
+ {"JOIN", net_join},
{"HELP", net_help},
{NULL, NULL}