summaryrefslogtreecommitdiff
path: root/source/utils
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-08-28 23:13:32 +0000
committerGerald Carter <jerry@samba.org>2002-08-28 23:13:32 +0000
commitf0a44a06d0640383cdafd7c6bcfbb2d71d91fcb1 (patch)
tree6a82f5d6ae181cc7b009b9d9238a9ec3075073d7 /source/utils
parenteb7ce6ae02a5eea505a9c971c47e3048a6bfe171 (diff)
downloadsamba-f0a44a06d0640383cdafd7c6bcfbb2d71d91fcb1.tar.gz
another sync with SAMBA_2_2. Regenerated docs after vl new strip-links.pl
change
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/smbpasswd.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index 527e2a38f68..df2d2d7ef6d 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -1,3 +1,4 @@
+
/*
* Unix SMB/Netbios implementation.
* Version 1.9.
@@ -33,7 +34,7 @@ extern int optind;
/* forced running in root-mode */
static BOOL local_mode;
-static BOOL joining_domain = False, got_pass = False, got_username = False;
+static BOOL joining_domain = False, got_pass = False, got_username = False, changing_trust_pw = FALSE;
static int local_flags = 0;
static BOOL stdin_passwd_get = False;
static fstring user_name, user_password;
@@ -94,6 +95,7 @@ static void usage(void)
#endif
printf(" -x delete user\n");
printf(" -j DOMAIN join domain name\n");
+ printf(" -t DOMAIN change trust account password on domain\n");
printf(" -S DOMAIN Retrieve the domain SID for DOMAIN\n");
printf(" -R ORDER name resolve order\n");
@@ -114,7 +116,7 @@ static void process_options(int argc, char **argv, BOOL amroot)
user_name[0] = '\0';
- while ((ch = getopt(argc, argv, "c:axdehmnj:r:sw:R:D:U:LS")) != EOF) {
+ while ((ch = getopt(argc, argv, "c:axdehmnj:t:r:sw:R:D:U:LS")) != EOF) {
switch(ch) {
case 'L':
local_mode = amroot = True;
@@ -155,6 +157,12 @@ static void process_options(int argc, char **argv, BOOL amroot)
strupper(new_domain);
joining_domain = True;
break;
+ case 't':
+ if (!amroot) goto bad_args;
+ new_domain = optarg;
+ strupper(new_domain);
+ changing_trust_pw = True;
+ break;
case 'r':
remote_machine = optarg;
break;
@@ -837,7 +845,7 @@ static int process_root(void)
*/
if ( ((local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) == (LOCAL_ADD_USER|LOCAL_DELETE_USER))
|| ( (local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER))
- && ((remote_machine != NULL) || joining_domain) ) )
+ && ((remote_machine != NULL) || joining_domain || changing_trust_pw) ) )
{
usage();
}
@@ -876,6 +884,17 @@ static int process_root(void)
}
}
+
+ /* Change Trust Password */
+
+ if (changing_trust_pw) {
+ if (change_trust_account_password(new_domain, remote_machine)) {
+ return 0;
+ }
+ return 1;
+ }
+
+
/*
* get the domain sid from a PDC and store it in secrets.tdb
* Used for Samba PDC/BDC installations.