diff options
author | Jim McDonough <jmcd@samba.org> | 2002-03-15 22:04:53 +0000 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2002-03-15 22:04:53 +0000 |
commit | e9394d52389c27dd529355de7baec96e18963b49 (patch) | |
tree | dd92ac2f5f63655775fb45305bcc74ebd4a217b4 /source3/utils/net.c | |
parent | bb38f48f6f2b5a5b8803c622e40107bb15876625 (diff) | |
download | samba-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.c | 19 |
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} |