summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2003-04-14 10:14:40 +0000
committerJelmer Vernooij <jelmer@samba.org>2003-04-14 10:14:40 +0000
commit10f2346810bbe4d81551994089e1a7d79955bb1f (patch)
treeb24abe8a927507bc9dada382b4cb847f7780c607
parente121d0b4d6787c5cbe5e1e6c8d466112dc44fad9 (diff)
downloadsamba-10f2346810bbe4d81551994089e1a7d79955bb1f.tar.gz
samba-10f2346810bbe4d81551994089e1a7d79955bb1f.tar.bz2
samba-10f2346810bbe4d81551994089e1a7d79955bb1f.zip
Change ADS CHOSTPASS to ADS CHANGETRUSTPW and add a
general CHANGETRUSTPW that calls ADS CHANGETRUSTPW or RPC CHANGETRUSTPW depending on what we have. (This used to be commit 17d27db5c9d3511444fc2770d4452647284e8014)
-rw-r--r--source3/utils/net.c9
-rw-r--r--source3/utils/net_ads.c13
-rw-r--r--source3/utils/net_rpc.c4
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 0f2d673b4b..5a8265f0b9 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"\
@@ -940,7 +940,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;
@@ -1117,7 +1117,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}
};
@@ -1136,7 +1136,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},
@@ -1167,6 +1167,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},