diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net.c | 9 | ||||
-rw-r--r-- | source3/utils/net_ads.c | 13 | ||||
-rw-r--r-- | source3/utils/net_rpc.c | 4 |
3 files changed, 20 insertions, 6 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c index f8ed590d4b..9d8441e649 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -305,6 +305,14 @@ static int net_join(int argc, const char **argv) return net_rpc_join(argc, argv); } +static int net_changetrustpw(int argc, const char **argv) +{ + if (net_ads_check() == 0) + return net_ads_changetrustpw(argc, argv); + + return net_rpc_changetrustpw(argc, argv); +} + static int net_share(int argc, const char **argv) { if (net_rpc_check(0)) @@ -485,6 +493,7 @@ static struct functable net_func[] = { {"ADMIN", net_rap_admin}, {"SERVICE", net_rap_service}, {"PASSWORD", net_rap_password}, + {"CHANGETRUSTPW", net_changetrustpw}, {"TIME", net_time}, {"LOOKUP", net_lookup}, {"JOIN", net_join}, diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index b4697d73dd..71b7a0802f 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -47,7 +47,7 @@ int net_ads_usage(int argc, const char **argv) "\nnet ads password <username@realm> -Uadmin_username@realm%%admin_pass"\ "\n\tchange a user's password using an admin account"\ "\n\t(note: use realm in UPPERCASE)\n"\ -"\nnet ads chostpass"\ +"\nnet ads changetrustpw"\ "\n\tchange the trust account password of this machine in the AD tree\n"\ "\nnet ads printer [info | publish | remove] <printername> <servername>"\ "\n\t lookup, add, or remove directory entry for a printer\n"\ @@ -929,7 +929,7 @@ static int net_ads_password(int argc, const char **argv) } -static int net_ads_change_localhost_pass(int argc, const char **argv) +int net_ads_changetrustpw(int argc, const char **argv) { ADS_STRUCT *ads; char *host_principal; @@ -1106,7 +1106,7 @@ int net_ads_help(int argc, const char **argv) {"LEAVE", net_ads_leave}, {"STATUS", net_ads_status}, {"PASSWORD", net_ads_password}, - {"CHOSTPASS", net_ads_change_localhost_pass}, + {"CHANGETRUSTPW", net_ads_changetrustpw}, #endif {NULL, NULL} }; @@ -1125,7 +1125,7 @@ int net_ads(int argc, const char **argv) {"USER", net_ads_user}, {"GROUP", net_ads_group}, {"PASSWORD", net_ads_password}, - {"CHOSTPASS", net_ads_change_localhost_pass}, + {"CHANGETRUSTPW", net_ads_changetrustpw}, {"PRINTER", net_ads_printer}, {"SEARCH", net_ads_search}, {"DN", net_ads_dn}, @@ -1156,6 +1156,11 @@ int net_ads_help(int argc, const char **argv) return net_ads_noads(); } +int net_ads_changetrustpw(int argc, const char **argv) +{ + return net_ads_noads(); +} + int net_ads_join(int argc, const char **argv) { return net_ads_noads(); diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 863d420ff3..a35cdd0b5b 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -205,7 +205,7 @@ static NTSTATUS rpc_changetrustpw_internals(const DOM_SID *domain_sid, struct cl * @return A shell status integer (0 for success) **/ -static int rpc_changetrustpw(int argc, const char **argv) +int net_rpc_changetrustpw(int argc, const char **argv) { return run_rpc_command(NULL, PI_NETLOGON, NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC, rpc_changetrustpw_internals, argc, argv); @@ -2250,7 +2250,7 @@ int net_rpc(int argc, const char **argv) {"group", net_rpc_group}, {"share", net_rpc_share}, {"file", net_rpc_file}, - {"changetrustpw", rpc_changetrustpw}, + {"changetrustpw", net_rpc_changetrustpw}, {"trustdom", rpc_trustdom}, {"abortshutdown", rpc_shutdown_abort}, {"shutdown", rpc_shutdown}, |