From e9394d52389c27dd529355de7baec96e18963b49 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 15 Mar 2002 22:04:53 +0000 Subject: Add autodetect for net join, as well as some more help updates (This used to be commit 951006374e48d80a5128d870bdc255bf8c22cb6a) --- source3/utils/net.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source3/utils/net.c') 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} -- cgit